Create an Orchestration Object

post

/platform/v1/object/

Adds an object to the specified orchestration v2.

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

Supported Media Types
Header Parameters
Body ()
The request body contains details of the orchestration object that you want to create.
Root Schema : OrchestrationObject-post-request
Type: object
The request body contains details of the orchestration object that you want to create.
Show Source
  • /Compute-identity_domain/default
  • A text string describing the object.
  • The desired state of this object
  • 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.
  • 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.
  • The three-part name (/Compute-identity_domain/user/object) of the orchestration to which the object belongs.
  • 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 to false. 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
    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
    Additional Properties Allowed: additionalProperties
    The 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 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.

  • 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 of this object, generated by the server
Nested Schema : relationships
Type: array
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.

Show Source
Nested Schema : template
Type: object
Additional Properties Allowed
Show Source
The 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 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.

Nested Schema : items
Type: object
Additional Properties Allowed
Show Source
Nested Schema : additionalProperties
Type: object
Nested Schema : additionalProperties
Type: object
Back to Top

Response

Supported Media Types

201 Response

Created. See Status Codes for information about other possible HTTP status codes.
Headers
Body ()
Root Schema : OrchestrationObject-response
Type: object
Show Source
Nested Schema : health
Type: object
Additional Properties Allowed
Show Source
Dictionary containing the current state of the object
Nested Schema : relationships
Type: array
List of relationships to other objects
Show Source
Nested Schema : template
Type: object
Additional Properties Allowed
Show Source
Template of this object object
Nested Schema : additionalProperties
Type: object
Nested Schema : items
Type: object
Additional Properties Allowed
Show Source
Nested Schema : additionalProperties
Type: object
Nested Schema : additionalProperties
Type: object
Back to Top

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_stateof 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.

Back to Top