Gets the available compartments for a given tenancyId

get

/appstore/publisher/v1/ocitenancies/{tenancyId}/compartments

Get the available compartments for a given tenancyId of a partner.

Request

Path Parameters
Query Parameters
  • Limit tells how many records to return (starting from the offset). Limit should be greater than zero and less than or equal to 100 (default=30).
  • Offset and limit together determine how many records to return from the collection. Offset is the starting index of the records to return, which should be greater than or equal to zero (default=0).
Back to Top

Response

Supported Media Types

200 Response

Successful Operation
Body ()
Root Schema : collection
Type: object
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : TenancyCompartment
Type: object
Show Source

400 Response

Invalid Parameter Value

401 Response

Not Authorized

404 Response

Entity Not Found

500 Response

System Error
Back to Top

Examples

The following example fetches the compartments for a given tenancy, by submitting a GET request on the REST resource using cURL.

cURL Example

curl -X GET -H "Authorization: Bearer Access-token"  -H "X-Oracle-UserId: partner-email" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/ocitenancies/15786747/compartments?limit=100"

Request Header

Authorization: Bearer Access-token 
X-Oracle-UserId: fname.lname@oracle.com 

Request Body

NONE

HTTP Status Code:

200 OK

JSON Response:

{  
   "items":[  
      {  
         "TenancyCompartment":{  
            "id":"ocid1.compartment.region1..aaaaaaaa3wbgnc7d4644drvokszlp6usigamqdwzofzb2qjdxfwvxf6od5jq",
            "compartmentId":"ocid1.tenancy.oc1..aaaaaaaaqaeq3aymehirrbetu7kxpzctvqfhqpy3hk7rjde6na7457pfyj7q",
            "name":"acme",
            "description":"Compartent for acme App Catalog Listings ",
            "lifecycleState":"Active"
         }
      },
      {  
         "TenancyCompartment":{  
            "id":"ocid1.compartment.region1..aaaaaaaaelzb6xjh2zsebgziqnbsdva7sk4ngmfq3m3r2vcgwkss4efum7gq",
            "compartmentId":"ocid1.tenancy.oc1..aaaaaaaaqaeq3aymehirrbetu7kxpzctvqfhqpy3hk7rjde6na7457pfyj7q",
            "name":"test",
            "description":"...",
            "lifecycleState":"Active"
         }
      },
      {  
         "TenancyCompartment":{  
            "id":"ocid1.tenancy.oc1..aaaaaaaaqaeq3aymehirrbetu7kxpzctvqfhqpy3hk7rjde6na7457pfyj7q",
            "compartmentId":"ocid1.tenancy.oc1..aaaaaaaaqaeq3aymehirrbetu7kxpzctvqfhqpy3hk7rjde6na7457pfyj7q",
            "name":"vkvemula",
            "lifecycleState":"Active"
         }
      }
   ],
   "hasMore":false,
   "count":3,
   "totalResults":3,
   "links":[  
      {  
         "rel":"CANONICAL",
         "href":"https://ocm-apis.us.oracle.com/appstore/publisher/v1/ocitenancies/15786747/compartments"
      },
      {  
         "rel":"SELF",
         "href":"https://ocm-apis.us.oracle.com/appstore/publisher/v1/ocitenancies/15786747/compartments?limit=100"
      }
   ]
}
Back to Top