CreateCompartment

post

/20160918/compartments

Create a new compartment in the specified compartment. Specify the OCID of the parent compartment for the compartment OCID in the request.

You must specify a name for the compartment, which must be unique across all compartments in your tenancy. You can use either the compartment name or OCID when writing policies for the compartment.

You must specify a description for the compartment, although it can be an empty string).

After you send your request, the new object's lifecycleState will temporarily be CREATING. Before using the object, first make sure its lifecycleState has changed to ACTIVE.

Request

Supported Media Types
Header Parameters
  • Minimum Length: 1
    Maximum Length: 64
    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
Body ()
Request object for creating a new compartment.
Root Schema : CreateCompartmentDetails
Type: object
Show Source
Nested Schema : definedTags
Type: object
Additional Properties Allowed
Show Source
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"Operations": {"CostCenter": "42"}}
Nested Schema : freeformTags
Type: object
Additional Properties Allowed
Show Source
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Example: {"Department": "Finance"}
Nested Schema : additionalProperties
Type: object
Additional Properties Allowed
Show Source
Key-value pair representing a defined tag key and value, scoped to a namespace. Example: {"CostCenter": "42"}
Nested Schema : additionalProperties
Type: object
The value of the tag. Only the String type is supported.
Back to Top

Response

Supported Media Types

200 Response

The compartment is being created.
Headers
  • For optimistic concurrency control. See if-match.
  • Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Body ()
Root Schema : Compartment
Type: object
A compartment is a collection of related resources. Compartments are a fundamental component for organizing and isolating cloud resources. For example, use compartments to separate resources for one project or business unit from another, or to manage access to the resources through the use of IAM Service policies.

A common approach is to create a compartment for each major part of your organization. To place a resource in a compartment, simply specify the compartment OCID when you create the resource. For example, to launch an instance into a particular compartment, specify the OCID of that compartment in the LaunchInstance request.

Avoid entering confidential information when you supply string values using the API.

Show Source
Nested Schema : definedTags
Type: object
Additional Properties Allowed
Show Source
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"Operations": {"CostCenter": "42"}}
Nested Schema : freeformTags
Type: object
Additional Properties Allowed
Show Source
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Example: {"Department": "Finance"}
Nested Schema : additionalProperties
Type: object
Additional Properties Allowed
Show Source
Key-value pair representing a defined tag key and value, scoped to a namespace. Example: {"CostCenter": "42"}
Nested Schema : additionalProperties
Type: object
The value of the tag. Only the String type is supported.
Example Response (application-json)
{   "id": "ocid1.compartment.aaaaaaaayzexampleuniqueID",   "compartmentId": "ocid1.tenancy.aaaaaaaaba3pexampleuniqueID",   "name": "Network",   "description": "For network components",   "lifecycleState": "ACTIVE",   "timeCreated": "2016-11-18T23:01:40.936Z" } 

429 Response

Too Many Requests
Headers
  • Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Body ()
Root Schema : Error
Type: object
The properties that define an error.
Show Source

Default Response

An error has occurred.
Headers
  • Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Body ()
Root Schema : Error
Type: object
The properties that define an error.
Show Source
Back to Top