GetCompartment
get
/20160918/compartments/{compartment_id}
Get the specified compartment's information. This operation does not return a list of all the resources inside the compartment. There is no single API operation that lists all resources of all types in a compartment. To find out what resources are in a compartment, use the List operation for each resource type, specifying the OCID of the compartment as a parameter in the request. For example, call the Compute service ListInstances operation or the Block Storage service ListVolumes operation.
Request
Supported Media Types
- application/json
Path Parameters
-
compartmentId(required): string
The OCID of the compartment.
Query Parameters
-
verboseLevel: string
This parameter is required to retrieve securityZoneId associated with the compartment.Allowed Values:
[ "securityZone" ]
Response
Supported Media Types
- application/json
200 Response
The compartment was retrieved.
Headers
-
etag: string
For optimistic concurrency control. See if-match.
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
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.
Show Source
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.
-
compartmentId(required):
string
The OCID of the parent compartment containing the compartment.
-
definedTags:
object definedTags
Additional Properties Allowed: additionalPropertiesDefined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"Operations": {"CostCenter": "42"}}
-
description(required):
string
Minimum Length:
1
Maximum Length:400
The description you assign to the compartment. Does not need to be unique, and it is changeable. -
freeformTags:
object freeformTags
Additional Properties Allowed: additionalPropertiesFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Example: {"Department": "Finance"}
-
id(required):
string
The OCID of the compartment.
-
inactiveStatus:
integer(int64)
The detailed status of INACTIVE lifecycleState.
-
isAccessible:
boolean
Indicates whether or not the compartment is accessible for the user making the request. Returns true when the user has INSPECT permissions directly on a resource in the compartment or indirectly (permissions can be on a resource in a subcompartment).
-
isMaximumSecurityZone:
boolean
Flag indicate whether this compartment has Security Zone enabled.
-
lifecycleState(required):
string
Minimum Length:
1
Maximum Length:64
Allowed Values:[ "CREATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED" ]
The compartment's current state. After creating a compartment, make sure its lifecycleState changes from CREATING to ACTIVE before using it. -
name(required):
string
Minimum Length:
1
Maximum Length:100
The name you assign to the compartment during creation. The name must be unique across all compartments in the parent. Avoid entering confidential information. -
securityZoneId:
string
The OCID of the Security Zone this compartment is associated with.
-
timeCreated(required):
string(date-time)
Date and time the compartment was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
Nested Schema : definedTags
Type:
object
Additional Properties Allowed
Show Source
-
object additionalProperties
Additional Properties Allowed: additionalPropertiesKey-value pair representing a defined tag key and value, scoped to a namespace. Example: {"CostCenter": "42"}
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
-
object additionalProperties
The value of the tag. Only the String type is supported.
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.
400 Response
Bad Request
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
403 Response
Forbidden
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
404 Response
Not Found
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
500 Response
Internal Server Error
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload
Default Response
An error has occurred.
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. Provide this request OCID if you need to contact Oracle about this request.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing..Example:
UnknownError
-
message(required):
string
A human-readable error string.Example:
error validating payload