Create an OrchestrationV2

post

/platform/v1/orchestration/

To use an orchestration to control the provisioning and life cycle of objects in Compute Classic, you must define the orchestration in a JSON-format file and then use this request to add an orchestration to Compute Classic.

Prerequisites:

* You must have already created the orchestration file that you want to upload. See Building Your First Orchestration v2.

* You should also validate your JSON file. You can do this by using a third-party tool, such as JSONLint, or any other validation tool of your choice. If your JSON isn't valid, then an error occurs when you upload the orchestration. Oracle doesn't support or endorse any third-party validation tool.

If you upload an orchestrations v2 file with the desired_state specified as active, the orchestration is activated automatically and the objects defined in it are created.

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 orchestrationV2 that you want to create.
Root Schema : OrchestrationV2-post-request
Type: object
The request body contains details of the orchestrationV2 that you want to create.
Show Source
  • /Compute-identity_domain/default
  • Description of this orchestration
  • Specify the desired state of this orchestration: active, inactive, or suspend. You can manage the state of the orchestration objects by changing the desired state of the orchestration.

    * active: Creates all the orchestration objects defined in the orchestration.

    * inactive: Adds the orchestration to Compute Classic, but does not create any of the orchestration objects defined in the orchestration.

  • The three-part name (/Compute-identity_domain/user/object) of the orchestration.
  • objects
    The list of objects in the orchestration. An object is the primary building block of an orchestration. An orchestration can contain up to 100 objects.
  • tags
    Strings that describe the orchestration and help you identify it.
  • Version of this orchestration. It is automatically generated by the server.
Nested Schema : objects
Type: array
The list of objects in the orchestration. An object is the primary building block of an orchestration. An orchestration can contain up to 100 objects.
Show Source
Nested Schema : tags
Type: array
Strings that describe the orchestration and help you identify it.
Show Source
Nested 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

Response

Supported Media Types

201 Response

Created. See Status Codes for information about other possible HTTP status codes.
Headers
Body ()
Root Schema : OrchestrationV2-response
Type: object
Show Source
Nested Schema : objects
Type: array
List of orchestration objects
Show Source
Nested Schema : tags
Type: array
Strings that describe the orchestration and help you identify it.
Show Source
Nested 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

Examples

cURL Command

The following example shows how to create an orchestration 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 "@orchestration.json"
        https://api-z999.compute.us0.oraclecloud.com/platform/v1/orchestration/
  • 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 1: Request Body Containing a Single Object

The following example shows the sample request body for creating an orchestration called /Compute-acme/jack.jones@example.com/firstOrchestration which a single security list object. As the desired_state is specified as inactive, so the orchestration is added to Compute Classic but the security list is not created.

{
	"desired_state": "inactive",
	"name": "/Compute-acme/jack.jones@example.com/firstOrchestration",
	"objects": [{
		"template": {
			"name": "/Compute-acme/jack.jones@example.com/seclist"
		},
		"label": "my-first-seclist",
		"type": "SecList"
	}]
}

Example 1: Response Body

{
	"status": "inactive",
	"account": "/Compute-acme/default",
	"time_updated": null,
	"description": "",
	"tags": [],
	"uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/orchestration/Compute-acme/jack.jones@example.com/firstOrchestration",
	"time_created": "2017-03-08T14:14:25Z",
	"name": "/Compute-acme/jack.jones@example.com/firstOrchestration",
	"time_audited": null,
	"objects": [{
		"relationships": [],
		"account": "/Compute-acme/default",
		"time_updated": null,
		"description": "",
		"user": "/Compute-acme/jack.jones@example.com",
		"persistent": false,
		"uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/firstOrchestration/c18a1d1b-fdf4-48fd-b6f7-271bfa4d8bd7",
		"template": {
			"name": "/Compute-acme/jack.jones@example.com/seclist"
		},
		"label": "my-first-seclist",
		"time_audited": null,
		"version": 1,
		"health": {
			"status": "inactive"
		},
		"time_created": "2017-03-08T14:14:25Z",
		"orchestration": "/Compute-acme/jack.jones@example.com/firstOrchestration",
		"type": "SecList",
		"name": "/Compute-acme/jack.jones@example.com/firstOrchestration/c18a1d1b-fdf4-48fd-b6f7-271bfa4d8bd7"
	}],
	"user": "/Compute-acme/jack.jones@example.com",
	"version": 1,
	"id": "dd3d3d40-a2ab-434f-be5c-1acfbb200872",
	"desired_state": "inactive"
}

Example 2: Request Body Containing Multiple Objects

The following shows an example of the request body content in the orchestration.json file.

Some lines may be truncated with ellipses (...) for readability.

This sample orchestration does the following:

  • Defines an instance with the label demo_instance and the oc3 shape.

  • Associates the IP reservation /Compute-acme/jack.jones@example.com/ip1 with the instance.

  • Attaches the bootable storage volume /Compute-acme/jack.jones@example.com/boot_vol1 to the instance.

  • Attaches the data storage volume /Compute-acme/jack.jones@example.com/vol1 to the instance.

  • Associates the SSH public key /Compute-acme/jack.jones@example.com/sshkey1 with the instance.

Note:

To learn about the structure of an orchestration, see Orchestration v2 Templates in Using Oracle Cloud Infrastructure Compute Classic. For information about all the attributes that you can define in an orchestration, see Attributes in Orchestrations v2 in Using Oracle Cloud Infrastructure Compute Classic.

{
  "description": "Simple orchestration with an SSH key",
  "name": "/Compute-acme/jack.jones@example.com/simple_orchestration",
  "desired_state": "active",
  "objects": [
    {
      "type": "SSHKey",
      "label": "my_key",
      "template": {
        "enabled": true,
        "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqSgGcmYDmjnkm4Oa...",
        "name": "/Compute-acme/jack.jones@example.com/sshkey1"
      }
    },
    {
      "type": "StorageVolume",
      "label": "boot_volume",
      "description": "Boot disk for your instance",
      "bootable": true,
      "persistent": true,
      "template": {
        "properties": [
          "/oracle/public/storage/default"
        ],
        "size": "10G",
        "imagelist": "/oracle/public/oel6",
        "name": "/Compute-acme/jack.jones@example.com/boot_vol1"
      }
    },
    {
      "type": "StorageVolume",
      "label": "data_volume",
      "description": "Data disk for your instance",
      "persistent": true,
      "template": {
        "properties": [
          "/oracle/public/storage/default"
        ],
        "size": "2G",
        "name": "/Compute-acme/jack.jones@example.com/vol1"
      }
    },
    {
      "type": "IPReservation",
      "label": "ip_reservation",
      "description": "IP reservation for your instance",
      "persistent": true,
      "template": {
        "parentpool": "/oracle/public/ippool",
        "name": "/Compute-acme/jack.jones@example.com/ip1"
        "permanent": true
      }
    },
    {
      "type": "Instance",
      "description": "demo instance",
      "label": "demo_instance",
      "template": {
        "label": "demo_instance",
        "name": "/Compute-acme/jack.jones@example.com/demo_instance",
        "shape": "oc3",
        "imagelist": "/oracle/public/oel6",
        "networking": {
          "eth0": {
            "nat": "ipreservation:{{ip_reservation:name}}"
          }
        },
        "storage_attachments": [
          {
            "index": 1,
            "volume": "{{boot_volume:name}}"
          },
          {
            "index": 2,
            "volume": "{{data_volume:name}}"
          }
        ],
        "boot_order": [
          1
        ],
        "sshkeys": [
          "{{my_key:name}}"
        ]
      }
    }
  ],
  "tags": [
    "sample"
  ]
}

Example 2: Response Body

The following example shows the response body in JSON format.

Some lines may be truncated with ellipses (...) for readability.

{
  "status": "activating",
  "account": "/Compute-acme/default",
  "time_updated": "2016-12-08T11:17:55Z",
  "description": "Simple orchestration with an SSH key",
  "tags": [
    "sample"
  ],
  "uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/orchestration/Compute-acme/jack.jones@example.com/simple_orchestration",
  "time_created": "2016-12-08T11:17:55Z",
  "name": "/Compute-acme/jack.jones@example.com/simple_orchestration",
  "time_audited": null,
  "version": 1,
  "user": "/Compute-acme/jack.jones@example.com",
  "id": "b81f9221-8163-4e5e-b80c-5bce282bf5ec",
  "objects": [
    {
      "relationships": [
        
      ],
      "account": "/Compute-acme/default",
      "time_updated": "2016-12-08T11:17:55Z",
      "description": "",
      "persistent": false,
      "uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/simple_orchestration/b4d30808-ea83-4b3e-91f2-df0cb63e6e14",
      "time_created": "2016-12-08T11:17:55Z",
      "label": "my_key",
      "time_audited": null,
      "orchestration": "/Compute-acme/jack.jones@example.com/simple_orchestration",
      "version": 1,
      "health": {
        "status": "inactive"
      },
      "user": "/Compute-acme/jack.jones@example.com",
      "template": {
        "enabled": false,
        "name": "/Compute-acme/jack.jones@example.com/sshkey1",
        "key": "ssh-rsa AAAAB3Nza..."
      },
      "type": "SSHKey",
      "name": "/Compute-acme/jack.jones@example.com/simple_orchestration/b4d30808-ea83-4b3e-91f2-df0cb63e6e14"
    },
    {
      "relationships": [],
      "account": "/Compute-acme/default",
      "time_updated": "2016-12-08T11:17:55Z",
      "description": "Boot disk for your instance",
      "persistent": true,
      "uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/simple_orchestration/c6d8b580-ae43-4418-81d9-f17c9c7aa127",
      "time_created": "2016-12-08T11:17:55Z",
      "label": "boot_volume",
      "time_audited": null,
      "orchestration": "/Compute-acme/jack.jones@example.com/simple_orchestration",
      "version": 1,
      "health": {
        "status": "inactive"
      },
      "user": "/Compute-acme/jack.jones@example.com",
      "template": {
        "size": "2G",
        "properties": [
          "/oracle/public/storage/default"
        ],
        "name": "/Compute-acme/jack.jones@example.com/boot_vol1"
      },
      "type": "StorageVolume",
      "name": "/Compute-acme/jack.jones@example.com/simple_orchestration/c6d8b580-ae43-4418-81d9-f17c9c7aa127"
    },
    {
      "relationships": [],
      "account": "/Compute-acme/default",
      "time_updated": "2016-12-08T11:17:55Z",
      "description": "Data disk for your instance",
      "persistent": true,
      "uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/simple_orchestration/446bbfcc-5a47-42b6-bafa-5ebc50a5bd80",
      "time_created": "2016-12-08T11:17:55Z",
      "label": "data_volume",
      "time_audited": null,
      "orchestration": "/Compute-acme/jack.jones@example.com/simple_orchestration",
      "version": 1,
      "health": {
        "status": "inactive"
      },
      "user": "/Compute-acme/jack.jones@example.com",
      "template": {
        "size": "2G",
        "properties": [
          "/oracle/public/storage/default"
        ],
        "name": "/Compute-acme/jack.jones@example.com/vol1"
      },
      "type": "StorageVolume",
      "name": "/Compute-acme/jack.jones@example.com/simple_orchestration/446bbfcc-5a47-42b6-bafa-5ebc50a5bd80"
    },
    {
      "relationships": [],
      "account": "/Compute-acme/default",
      "time_updated": "2016-12-08T11:17:55Z",
      "description": "IP reservation for your instance",
      "persistent": true,
      "uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/simple_orchestration/4084e068-0ab4-4921-afaa-fee6c984ecb3",
      "time_created": "2016-12-08T11:17:55Z",
      "label": "ip_reservation",
      "time_audited": null,
      "orchestration": "/Compute-acme/jack.jones@example.com/simple_orchestration",
      "version": 1,
      "health": {
        "status": "inactive"
      },
      "user": "/Compute-acme/jack.jones@example.com",
      "template": {
        "parentpool": "/oracle/public/ippool",
        "permanent": true
      },
      "type": "IPReservation",
      "name": "/Compute-acme/jack.jones@example.com/simple_orchestration/4084e068-0ab4-4921-afaa-fee6c984ecb3"
    },
    {
      "relationships": [],
      "account": "/Compute-acme/default",
      "time_updated": "2017-04-08T11:17:55Z",
      "description": "demo instance",
      "persistent": false,
      "uri": "https://api-z999.compute.us0.oraclecloud.com/platform/v1/object/Compute-acme/jack.jones@example.com/simple_orchestration/70195508-90cf-46f3-8cd4-e7dd01062063",
      "time_created": "2017-04-08T11:17:55Z",
      "label": "demo_instance",
      "time_audited": null,
      "orchestration": "/Compute-acme/jack.jones@example.com/simple_orchestration",
      "version": 1,
      "health": {
        "status": "inactive"
      },
      "user": "/Compute-acme/jack.jones@example.com",
      "template": {
        "networking": {
          "eth0": {
            "nat": "ipreservation:{{ip_reservation:name}}"
          }
        },
        "name": "/Compute-acme/jack.jones@example.com/instance",
        "boot_order": [
          1
        ],
        "storage_attachments": [
          {
            "volume": "{{boot_volume:name}}",
            "index": 1
          },
          {
            "volume": "{{data_volume:name}}",
            "index": 2
          }
        ],
        "label": "demo_instance",
        "shape": "oc3",
        "imagelist": "/oracle/public/oel6",
        "sshkeys": [
          "{{my_key:name}}"
        ]
      },
      "type": "Instance",
      "name": "/Compute-acme/jack.jones@example.com/simple_orchestration/70195508-90cf-46f3-8cd4-e7dd01062063"
    }
  ],
  "desired_state": "active"
}