ListPolicies
GET {{baseUrl}}/policies/?compartmentId={{compartment_ocid}}&limit=693&sortBy=NAME&sortOrder=ASC
Lists the policies in the specified compartment (either the tenancy or another of your compartments). See Where to Get the Tenancy's OCID and User's OCID.
To determine which policies apply to a particular group or compartment, you must view the individual statements inside all your policies. There isn't a way to automatically obtain that information via the API.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
compartmentId | string | (Required) The OCID of the compartment (remember that the tenancy is simply the root compartment). | |
page | string | The value of the opc-next-page response header from the previous "List" call. | |
limit | number | The maximum number of items to return in a paginated "List" call. | |
name | string | A filter to only return resources that match the given name exactly. | |
sortBy | string | The field to sort by. You can provide one sort order (sortOrder ). Default order for | |
TIMECREATED is descending. Default order for NAME is ascending. The NAME | |||
sort order is case sensitive. |
Note: In general, some "List" operations (for example, ListInstances
) let you
optionally filter by Availability Domain if the scope of the resource type is within a
single Availability Domain. If you call one of these "List" operations without specifying
an Availability Domain, the resources are grouped by Availability Domain, then sorted.
|
| sortOrder
| string | | The sort order to use, either ascending (ASC
) or descending (DESC
). The NAME sort order
is case sensitive.
|
| lifecycleState
| string | | A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
|
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Date | string | (Required) Current Date | |
Authorization | string | (Required) Signature Authentication on Authorization header |
RESPONSES
status: OK
[{"id":"ullamco aute","compartmentId":"labore Ut commodo","name":"ea nostru","statements":["non elit","ipsum exercitation Ut Duis con"],"description":"aute sint est ut","timeCreated":"1948-09-15T05:20:31.759Z","lifecycleState":"DELETED","definedTags":{},"freeformTags":{},"inactiveStatus":78218227,"versionDate":"1978-08-25T04:41:43.516Z"},{"id":"veniam ullamco D","compartmentId":"deserunt","name":"amet nisi","statements":["adipisicing","consectetur quis"],"description":"sit aliqua nostrud exercitation","timeCreated":"1987-02-03T13:31:22.419Z","lifecycleState":"ACTIVE","definedTags":{},"freeformTags":{},"inactiveStatus":37425970,"versionDate":"1971-09-24T11:45:54.871Z"}]