Querying the Policy Group List
Function
This API is used to query the policy group list.
URI
GET /v5/{project_id}/policy/groups
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID |
Parameter | Mandatory | Type | Description |
---|---|---|---|
enterprise_project_id | No | String | Enterprise project ID. To query all enterprise projects, set this parameter to all_granted_eps. |
group_name | No | String | Policy group name |
offset | No | Integer | Offset, which specifies the start position of the record to be returned. |
limit | No | Integer | Number of records displayed on each page. |
container_mode | No | Boolean | Whether to query the container edition policy. |
Request Parameters
Parameter | Mandatory | Type | Description |
---|---|---|---|
X-Auth-Token | Yes | String | User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token. |
region | Yes | String | Region ID |
Response Parameters
Status code: 200
Parameter | Type | Description |
---|---|---|
total_num | Integer | Total number |
data_list | Array of PolicyGroupResponseInfo objects | Policy group list |
Parameter | Type | Description |
---|---|---|
group_name | String | Policy group name |
group_id | String | Policy group ID |
description | String | Description of the policy group |
deletable | Boolean | Whether a policy group can be deleted |
host_num | Integer | Number of associated servers |
default_group | Boolean | Whether a policy group is the default policy group |
support_os | String | Supported OS. The options are as follows:
|
support_version | String | Supported versions. The options are as follows:
|
Example Requests
Query the policy group list of all enterprise projects.
GET https://{endpoint}/v5/{project_id}/policy/groups?offset=0&limit=100&enterprise_project_id=all_granted_eps
Example Responses
Status code: 200
Request succeeded.
{"data_list" : [ {"default_group" : true,"deletable" : false,"description" : "container policy group for linux","group_id" : "c831f177-226d-4b91-be0f-bcf98d04ef5d","group_name" : "tenant_linux_container_default_policy_group ","host_num" : 0,"support_version" : "hss.version.container.enterprise","support_os" : "Linux"}, {"default_group" : true,"deletable" : false,"description" : "enterprise policy group for windows","group_id" : "1ff54b90-1b3e-42a9-a1da-9883a83385ce","group_name" : "tenant_windows_enterprise_default_policy_group ","host_num" : 0,"support_version" : "hss.version.enterprise","support_os" : "Windows"}, {"default_group" : true,"deletable" : false,"description" : "enterprise policy group for linux","group_id" : "1069bcc0-c806-4ccd-a35d-f1f7456805e9","group_name" : "tenant_linux_enterprise_default_policy_group ","host_num" : 1,"support_version" : "hss.version.enterprise","support_os" : "Linux"}, {"default_group" : true,"deletable" : false,"description" : "premium policy group for windows","group_id" : "11216d24-9e91-4a05-9212-c4c1d646ee79","group_name" : "tenant_windows_premium_default_policy_group ","host_num" : 0,"support_version" : "hss.version.premium","support_os" : "Linux"}, {"default_group" : true,"deletable" : false,"description" : "premium policy group for linux","group_id" : "e6e1228a-7bb4-424f-a42b-755162234da7","group_name" : "tenant_linux_premium_default_policy_group ","host_num" : 0,"support_version" : "hss.version.premium","support_os" : "Windows"} ],"total_num" : 5}
Status Codes
Status Code | Description |
---|---|
200 | Request succeeded. |
Error Codes
See Error Codes.
- URI