Find an Account Registered in the System
Prerequisites
Code Example
// Retrieve and format a date
c = Calendar.getInstance()
c.add(Calendar.MONTH, -1)
df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
time = df.format(c.getTime()).replace('+', '%2B')
// Filter labs by last-modified on specified date
labsURI = "http://${hostname}/api/v2/labs?last-modified=" + time
labs = GLSRestApiUtils.httpGET(labsURI, username, password)
// For each lab, retrieve it
labs.'lab'.each {
labResource = GLSRestApiUtils.httpGET(it.@uri, username, password)
println "Welcome to the team, ${labResource.name.text()}"
labState = labResource.'shipping-address'.state.text()
// If lab is in Washington, print message
if (labState == "WA") {
println "Go Huskies!"
}
}Expected Output and Results
Attachments
Last updated
Was this helpful?