Create an OrchestrationV2
/platform/v1/orchestration/
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
- 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
Description of this orchestration
-
desired_state:
string
Specify the desired state of this orchestration:
active
,inactive
, orsuspend
. 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. -
name:
string
The three-part name (
/Compute-identity_domain/user/object
) of the orchestration. -
objects:
array 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(optional):
array tags
Strings that describe the orchestration and help you identify it.
-
version(optional):
integer
Version of this orchestration. It is automatically generated by the server.
array
-
Array of:
object OrchestrationObject-post-request
The request body contains details of the orchestration object that you want to create.
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
The default Compute Classic account, such as /Compute-acme/default.
-
description(optional):
string
Description of this orchestration
-
desired_state(optional):
string
The
desired_state
specified in the orchestration JSON file. A unique identifier for this orchestration. -
id(optional):
string
Unique identifier of this orchestration
-
name(optional):
string
The three-part name (
/Compute-identity_domain/user/object
) of the orchestration. -
objects(optional):
array objects
List of orchestration objects
-
status(optional):
string
Current status of this orchestration
-
tags(optional):
array tags
Strings that describe the orchestration and help you identify it.
-
time_audited(optional):
string
Time the orchestration was last audited
-
time_created(optional):
string
The time when the orchestration was added to Compute Classic.
-
time_updated(optional):
string
The time when the orchestration was last updated in Compute Classic.
-
uri(optional):
string
Uniform Resource Identifier
-
user(optional):
string
Name of the user who added this orchestration or made the most recent update to this orchestration.
-
version(optional):
integer
Version of this orchestration. It is automatically generated by the server.
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 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 theoc3
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" }