Create an Orchestration Object
/platform/v1/object/
The action of the orchestration object you add is determined by the desired_state
of the orchestration it is associated with.
* Objects are created when the desired_state
of the associated orchestration is set to active
.
* Objects are deleted when the desired_state
of the associated orchestration is set to inactive
.
* Only non-persistent objects are deleted when the desired_state
of the associated orchestration is set to suspend
. Peristent objects are not deleted when the associated orchestration is suspended. To make an object persistent, set the persistent attribute to true. When an object is set to persist, it is not deleted when the orchestration is suspended. If the persistent objects are not already in the active
state, they are created. If the orchestration is terminated, then all the objects are deleted. If you set the persistent attribute of an object to true, then you must set the persistent attribute of all the dependent objects as well to true. For example, if a persistent instance references a bootable storage volume, the storage volume must also be persistent. For more information, see Object Persistence in Orchestrations v2 in Using Oracle Cloud Infrastructure Compute Classic.
To change the desired_state
of an orchestration, send the PUT /platform/v1/orchestration/{name}/?desired_state={state} HTTP request.
You can determine the status of an object by viewing its health
parameter.
Required Role: To complete this task, you must have the Compute_Operations
role. If this role isn't assigned to you or you're not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.
Request
- application/oracle-compute-v3+json
-
Cookie: string
The Cookie: header must be included with every request to the service. It must be set to the value of the set-cookie header in the response received to the POST /authenticate/ call.
object
-
account(optional):
string
/Compute-identity_domain/default
-
description(optional):
string
A text string describing the object.
-
desired_state(optional):
string
The desired state of this object
-
label:
string
A text string describing the object. Labels can't include spaces. In an orchestration, the label for each object must be unique. Maximum length is 256 characters.
-
name(optional):
string
The four-part name of the object (
/Compute-identity_domain/user/orchestration/object
). If you don't specify a name for this object, the name is generated automatically. Object names can contain only alphanumeric characters, hyphens, underscores, and periods. Object names are case-sensitive. When you specify the object name, ensure that an object of the same type and with the same name doesn't already exist. If such a object already exists, then another object of the same type and with the same name won't be created and the existing object won't be updated. -
orchestration:
string
The three-part name (
/Compute-identity_domain/user/object
) of the orchestration to which the object belongs. -
persistent(optional):
boolean
Specifies whether the object should persist when the orchestration is suspended. Specify one of the following:
*
true
: The object persists when the orchestration is suspended.*
false
: The object is deleted when the orchestration is suspended.By default,
persistent
is set tofalse
. It is recommended that you specify true for storage volumes and other critical objects. Persistence applies only when you're suspending an orchestration. When you terminate an orchestration, all the objects defined in it are deleted. -
relationships(optional):
array relationships
The relationship between the objects that are created by this orchestration. The only supported relationship is depends, indicating that the specified target objects must be created first.
Note that when recovering from a failure, the orchestration doesn't consider object relationships. Orchestrations v2 use object references to recover interdependent objects to a healthy state. SeeObject References and Relationships in Using Oracle Cloud Infrastructure Compute Classic.
-
template:
object template
Additional Properties Allowed: additionalPropertiesThe template attribute defines the properties or characteristics of the Compute Classic object that you want to create, as specified by the
type
attribute.The fields in the template section vary depending on the specified type. See Orchestration v2 Attributes Specific to Each Object Type in Using Oracle Cloud Infrastructure Compute Classic to determine the parameters that are specific to each object
type
that you want to create.For example, if you want to create a storage volume, the
type
would beStorageVolume
, and thetemplate
would includesize
andbootable
. If you want to create an instance, the type would beInstance
, and the template would include instance-specific attributes, such asimagelist
andshape
. -
type:
string
Specify one of the following object types that you want to create.
* Acl
* Backup
* BackupConfiguration
* Instance
* IpAddressAssociation
* IpAddressPrefixSet
* IpAddressReservation
* IpNetwork
* IpNetworkExchange
* IPReservation
* OSSContainer
* Restore
* Route
* SecApplication
* SecIPList
* SecList
* SecRule
* SecurityProtocol
* SecurityRule
* SSHKey
* StorageAttachment
* StorageSnapshot
* StorageSnapshot
* StorageVolume
* VirtualNicSet
For the most up-to-date information about the supported object types, see Object Types in Orchestgations v2 in Using Oracle Cloud Infrastructure Compute Classic.
-
version(optional):
integer
Version of this object, generated by the server
array
Note that when recovering from a failure, the orchestration doesn't consider object relationships. Orchestrations v2 use object references to recover interdependent objects to a healthy state. SeeObject References and Relationships in Using Oracle Cloud Infrastructure Compute Classic.
-
Array of:
object items
Additional Properties Allowed: additionalProperties
object
type
attribute.The fields in the template section vary depending on the specified type. See Orchestration v2 Attributes Specific to Each Object Type in Using Oracle Cloud Infrastructure Compute Classic to determine the parameters that are specific to each object type
that you want to create.
For example, if you want to create a storage volume, the type
would be StorageVolume
, and the template
would include size
and bootable
. If you want to create an instance, the type would be Instance
, and the template would include instance-specific attributes, such as imagelist
and shape
.
object
object
Response
- application/oracle-compute-v3+json
201 Response
-
set-cookie: string
The cookie value is returned if the session is extended
object
-
account(optional):
string
/Compute-identity_domain/default
-
description(optional):
string
Description of this object
-
desired_state(optional):
string
The desired state of this object
-
health(optional):
object health
Additional Properties Allowed: additionalPropertiesDictionary containing the current state of the object
-
label(optional):
string
Human-readable identifier for this object
-
name(optional):
string
Name of this object, generated by the server
-
orchestration(optional):
string
The orchestration to which this object belongs
-
persistent(optional):
boolean
If the value is
true
, it indicates that the object is not deleted when the associated orchestration is suspended. If persistent is set tofalse
, the object is deleted when the associated orchestration is suspended. -
relationships(optional):
array relationships
List of relationships to other objects
-
template(optional):
object template
Additional Properties Allowed: additionalPropertiesTemplate of this object object
-
time_audited(optional):
string
Time the object was last audited
-
time_created(optional):
string
Object creation time
-
time_updated(optional):
string
Object modification time
-
type(optional):
string
Type of object this object represents
-
uri(optional):
string
Uniform Resource Identifier
-
user(optional):
string
User acting on this object
-
version(optional):
integer
Version of this object, generated by the server
object
array
-
Array of:
object items
Additional Properties Allowed: additionalProperties
object
object
object
object
Examples
cURL Command
The following example shows how to create resource by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.
Enter the command on a single line. Line breaks are used in this example for readability.
curl -i -X POST -H "Cookie: $COMPUTE_COOKIE" -H "Content-Type: application/oracle-compute-v3+json" -H "Accept: application/oracle-compute-v3+json" -d "@addObject.json" https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/
-
COMPUTE_COOKIE
is the name of the variable in which you stored the authentication cookie earlier. For information about retrieving the authentication cookie and storing it in a variable, see Authentication. -
api-z999.compute.us0.oraclecloud.com
is an example REST endpoint URL. Change this value to the REST endpoint URL of your Compute Classic site. For information about finding out REST endpoint URL for your site, see Send Requests.
Example of Request Body
The following shows an example of the request body content in the addObject.json
file to create a security list with default attribute values. As persistent
is set to true
, a persistent security list is created. A persistent object is not deleted when the orchestration is suspended. /Compute-acme/jack.jones@example.com/seclist1
is the name of the persistent security list that is created, and /Compute-acme/jack.jones@example.com/myOrchestration/seclist1
is the name of the orchestration object that will track this security list. The state of the security list is determined by the desired_state
of the associated orchestration, /Compute-acme/jack.jones@example.com/myOrchestration
.
{ "type":"SecList", "orchestration": "/Compute-acme/jack.jones@example.com/myOrchestration", "name": "/Compute-acme/jack.jones@example.com/myOrchestration/seclist1", "label": "mySeclist1", "persistent": true, "template": { "name": "/Compute-acme/jack.jones@example.com/seclist1" }, "description": "a persistent security list" }
Example of Response Body
The following example shows the response body in JSON format.
{{
"relationships": [],
"account": "/Compute-acme/default",
"time_updated": null,
"desired_state": "inherit",
"description": "a persistent security list",
"user": "/Compute-acme/jack.jones@example.com",
"persistent": true,
"uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/myOrchestration/seclist1",
"template": {
"name": "/Compute-acme/jack.jones@example.com/seclist1"
},
"label": "mySeclist1",
"time_audited": null,
"version": 1,
"health": {
"status": "inactive"
},
"time_created": "2017-03-10T11:05:39Z",
"orchestration": "/Compute-acme/jack.jones@example.com/myOrchestration",
"type": "SecList",
"name": "/Compute-acme/jack.jones@example.com/myOrchestration/seclist1"
}
You can find the current status of the object by looking at the value of the health
parameter in the response. By default, the desired_state
of the orchestration object is inherited from the associated orchestration. As the desired_state
of the associated orchestration is inactive
, the security list object is also inactive
.