Obtaining the Policy List
Function
This API is used to obtain the policy list.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{domain_id}/tenant/rule-sets/query
Parameter | Mandatory | Type | Description |
|---|---|---|---|
domain_id | Yes | String | Definition: Tenant ID, that is, domain ID of a user. Constraints: N/A Range: The value consists of 32 characters, including digits and letters. Default value: N/A |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
offset | Yes | Integer | Definition: Offset where the query starts. Constraints: N/A Value range: The offset value must be no less than 0. Default value: N/A |
limit | Yes | Integer | Definition: Number of records of each query. Constraints: N/A Value range: The value is no less than 0. Default value: N/A |
include_tenant_rule_set | Yes | Boolean | Definition: Whether tenant-level rules are included. Constraints: N/A Value range:
Default value: N/A |
name | No | String | Definition: Policy name, which can be used for fuzzy search. Constraints: The policy name can contain only characters, letters, digits, hyphens (-), and underscores (_). Value range: Enter a maximum of 128 characters. Default value: N/A |
is_valid | No | Boolean | Definition: Whether the policy is valid. Constraints: N/A Value range:
Default value: N/A |
type | No | String | Definition: Policy type. Constraints: N/A Value range: N/A Default value: N/A |
cloud_project_id | No | String | Definition: Project ID. For details, see Obtaining a Project ID. Constraints: N/A Value range: The value consists of 32 characters, including digits and letters. Default value: N/A |
Request Parameters
Parameter | Mandatory | Type | Description |
|---|---|---|---|
X-Auth-Token | Yes | String | Definition: User token. Obtain a token (the value of the X-Subject-Token response header) by calling the IAM API for . Constraints: N/A Value range: N/A Default value: N/A |
Response Parameters
Status code: 200
Parameter | Type | Description |
|---|---|---|
data | Array of RuleSet objects | Definition: List of rule instances. Value range: N/A |
total | Long | Definition: Total number of rules. Value range: N/A |
Parameter | Type | Description |
|---|---|---|
id | String | Definition: Rule template instance ID. Value range: N/A |
name | String | Definition: Rule template instance name. Value range: N/A |
type | String | Definition: Rule instance type. Value range: N/A |
version | String | Definition: Rule instance version. Value range: N/A |
operator | String | Definition: Latest operator of the rule instance. Value range: N/A |
operate_time | Long | Definition: Time when the rule was last operated. Value range: N/A |
is_valid | Boolean | Definition: Whether the rule instance takes effect. Value range:
|
level | String | Definition: Effective level of a rule instance. Value range: N/A |
is_public | Boolean | Definition: Whether the rule instance is system-level. Value range:
|
is_legacy | Boolean | Definition: Whether the rule instance data is from version 1.0. Range:
|
Status code: 400
Parameter | Type | Description |
|---|---|---|
error_msg | String | Parameter description: Error message. Value range: N/A |
error_code | String | Parameter description: Error code. Value range: N/A |
Example Requests
GET https://{endpoint}/v2/ce8df55870164338a72d7e828a966a2a/tenant/rule-sets/query?name=&limit=2&offset=1&cloud_project_id= Example Responses
Status code: 200
OK
{
"data" : [ {
"id" : "30782f30c92e4c1dbc3c596075970d67",
"name" : "Creating a Tenant-Level Policy -apitest-rKaG on DJtest",
"level" : "tenant",
"is_valid" : true,
"version" : "67e915e472554f719abe513c28728d9f",
"operator" : "xxx",
"is_public" : false,
"operate_time" : 1692695390000
}, {
"id" : "4f5fb96022974a2781174584f799d8c2",
"name" : "Creating a Tenant-Level Policy on DJtest-apitest-S190",
"level" : "tenant",
"is_valid" : true,
"version" : "61ebfef577c34406b5647ac1d83e7bb8",
"operator" : "xxx",
"is_public" : false,
"operate_time" : 1692695390000
} ],
"total" : 333
} Status Codes
Status Code | Description |
|---|---|
200 | OK |
400 | Bad request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
