Querying Built-in Policies
Function
This API is used to query all built-in policies.
Calling Method
For details, see Calling APIs.
URI
GET /v1/resource-manager/policy-definitions
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
limit |
No |
Integer |
Specifies the maximum number of records to return. Minimum: 1 Maximum: 500 Default: 500 |
|
marker |
No |
String |
Specifies the pagination parameter. You can use the marker value in a subsequent call to request the next set of list items. Minimum: 4 Maximum: 400 |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Language |
No |
String |
Specifies the language of the information to return. The default name is zh-cn, which can be zh-cn and en-us. Default: zh-cn |
|
X-Auth-Token |
No |
String |
Specifies the invoker's token. |
|
X-Security-Token |
No |
String |
Specifies a temporary security credential. This parameter is mandatory when you make an API call using a temporary security credential. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
value |
Array of PolicyDefinition objects |
Specifies the policy definition list. |
|
page_info |
PageInfo object |
Specifies the pagination object. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Specifies the policy ID. |
|
name |
String |
Specifies the policy name. |
|
display_name |
String |
Specifies the policy display name. |
|
policy_type |
String |
Specifies the policy type. |
|
description |
String |
Specifies the description of the policy definition. |
|
policy_rule_type |
String |
Specifies the syntax type of the policy. |
|
policy_rule |
Object |
Specifies the policy rule. |
|
trigger_type |
String |
Specifies the trigger type. |
|
keywords |
Array of strings |
Specifies keywords. |
|
default_resource_types |
Array of default_resource_types objects |
Specifies the list of default resource types. |
|
parameters |
Map<String,PolicyParameterDefinition> |
Specifies the policy parameter. |
|
Parameter |
Type |
Description |
|---|---|---|
|
provider |
String |
Specifies the cloud service name. |
|
type |
String |
Specifies the resource type. |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Specifies the name of the policy parameter. |
|
description |
String |
Specifies the description of the policy parameter. |
|
allowed_values |
Array of objects |
Specifies the allowed values of the policy parameter. |
|
default_value |
String |
Specifies the default value of the policy parameter. |
|
minimum |
Float |
Specifies the minimum value of the policy parameter. This parameter is valid for Interger or Float parameters. |
|
maximum |
Float |
Specifies the maximum value of the policy parameter. This parameter is valid for Interger or Float parameters. |
|
min_items |
Integer |
Specifies the minimum number of the policy parameter. This parameter is valid for Array parameters. |
|
max_items |
Integer |
Specifies the maximum number of the policy parameter. This parameter is valid for Array parameters. |
|
min_length |
Integer |
Specifies the minimum string length for policy parameters or for each item. This parameter is valid for String or Array parameters. |
|
max_length |
Integer |
Specifies the maximum string length for policy parameters or for each item. This parameter is valid for String or Array parameters. |
|
pattern |
String |
Specifies the pattern for policy parameters or for each item. This parameter is valid for String or Array parameters. |
|
type |
String |
Specifies the type of the policy parameter. |
|
Parameter |
Type |
Description |
|---|---|---|
|
current_count |
Integer |
Specifies the resource quantity on the current page. Minimum: 0 Maximum: 200 |
|
next_marker |
String |
Specifies the marker value of the next page. Minimum: 4 Maximum: 400 |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Specifies the error code. |
|
error_msg |
String |
Specifies the error message. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Specifies the error code. |
|
error_msg |
String |
Specifies the error message. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Specifies the error code. |
|
error_msg |
String |
Specifies the error message. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Specifies the error code. |
|
error_msg |
String |
Specifies the error message. |
Example Requests
None
Example Responses
Status code: 200
Operation succeeded.
{
"value" : [ {
"id" : "5fa365476eed194ccb2c04d1",
"name" : "volumes-encrypted-check",
"display_name" : "Enable encryption for the attached EVS volumes.",
"policy_type" : "builtin",
"description" : "An EVS disk is non-compliant if it has been mounted but not encrypted.",
"policy_rule_type" : "dsl",
"policy_rule" : {
"allOf" : [ {
"value" : "${resource().provider}",
"comparator" : "equals",
"pattern" : "evs"
}, {
"value" : "${resource().type}",
"comparator" : "equals",
"pattern" : "volumes"
}, {
"value" : "${resource().properties.status}",
"comparator" : "equals",
"pattern" : "in-use"
}, {
"anyOf" : [ {
"value" : "${resource().properties.metadata}",
"comparator" : "notContainsKey",
"pattern" : "systemEncrypted"
}, {
"value" : "${resource().properties.metadata.systemEncrypted}",
"comparator" : "equals",
"pattern" : "0"
} ]
} ]
},
"keywords" : [ "evs", "ecs" ],
"parameters" : { }
} ],
"page_info" : {
"current_count" : 1,
"next_marker" : null
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Operation succeeded. |
|
400 |
Invalid parameter. |
|
403 |
Authentication failed or you do not have the operation permissions. |
|
404 |
Resources not found. |
|
500 |
Server error. |
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.