expect_cloudobject

expect_cloudobject looks for a specific cloudobject and creates one if not found. If an identifier is specified, expect_cloudobject will search for a cloud object with the given identifier. if none is found, then a new cloud object will be created and assigned the given identifier. Identifiers are stored in the object's "__id" value.

Format:

expect_cloudobject(type,[identifier])

Parameters:

Parameter Type Description
type string The type of of the object to search for.
identifier string  [Optional]An identifier to search for. The identifier is used to look for a specific cloudobject of the given type.

Returned Value:

Type Description
cloudobject Return value will be the cloudobject found or newly created

Examples

 configuration = expect_cloudobject("Configuration")
 security_settings_for_department = expect_cloudobject("Settings",department)
 settings = expect_cloudobject("Settings", user_id)
 if (!settings.has_been_set_up) {
    settings.default_location = "usa"
    settings.has_been_set_up = true
 }