DescribePoliciesV2
Queries one or more policies.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hbr:DescribePoliciesV2 |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| MaxResults |
integer |
No |
The maximum number of entries to return for a single request. Valid values: 10 to 100. Default value: 10. |
10 |
| NextToken |
string |
No |
The token used to retrieve the next page of policies. |
caeba0bbb2be03f84eb48b699f0a |
| PolicyId |
string |
No |
The ID of the policy. |
po-000************2l6 |
| RuleScope |
string |
No |
The scope used to filter rules when querying policies. |
BACKUP |
| AccountScope |
string |
No |
The scope of accounts to which the policy applies. |
SPECIFIED_ACCOUNT |
| Accounts |
array<object> |
No |
The list of account information specified when querying policies. |
|
|
object |
No |
|||
| CrossAccountType |
string |
No |
The account association type, which is used to distinguish between the current account and cross-account scenarios. |
CROSS_ACCOUNT_BY_RD |
| CrossAccountUserId |
integer |
No |
The Alibaba Cloud account ID of the account whose resources need to be backed up. |
1234567890123456 |
| CrossAccountRoleName |
string |
No |
The name of the RAM role created in the account whose resources need to be backed up. |
hbrcrossrole |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
DescribePoliciesResponse |
||
| Policies |
array<object> |
The list of policies. |
|
|
array<object> |
The policy details. |
||
| CreatedTime |
integer |
The creation time. The value is a UNIX timestamp in seconds. |
1650248136 |
| UpdatedTime |
integer |
The update time. The value is a UNIX timestamp in seconds. |
1662080404 |
| PolicyId |
string |
The ID of the policy. |
po-000************bkz |
| PolicyName |
string |
The Policy Name. |
Daily backup + geo-redundancy |
| PolicyDescription |
string |
The description of the policy. |
Back up data at 10:00 AM every day and replicate it to Shanghai |
| Rules |
array<object> |
The list of policy rules. |
|
|
array<object> |
The policy rule details. |
||
| RuleId |
string |
The ID of the rule. |
rule-000************f1e |
| RuleType |
string |
The type of the rule. Each policy must have at least one BACKUP rule and exactly one TRANSITION rule. Valid values:
|
BACKUP |
| Schedule |
string |
The backup schedule. This parameter is required only when RuleType is set to BACKUP. Format:
|
I|1648647166|P1D |
| BackupType |
string |
The backup type. This parameter is required only when RuleType is set to BACKUP. Set the value to COMPLETE, which indicates full backup. |
COMPLETE |
| VaultId |
string |
The ID of the backup vault. This parameter is required only when RuleType is set to BACKUP. |
v-000**************kgm |
| ReplicationRegionId |
string |
The ID of the destination region for replication. This parameter is required only when RuleType is set to REPLICATION. |
cn-shanghai |
| Retention |
integer |
The retention period. This parameter is required only when RuleType is set to TRANSITION or REPLICATION.
|
7 |
| RetentionRules |
array<object> |
The list of special retention rules. This parameter is required only when RuleType is set to TRANSITION. |
|
|
object |
The special retention rule. |
||
| AdvancedRetentionType |
string |
The type of the special retention rule. Valid values:
|
YEARLY |
| WhichSnapshot |
integer |
The sequence number of the backup to which the rule applies. Currently, only the first backup is supported. Set the value to 1. |
1 |
| Retention |
integer |
The special retention period for the backup. The minimum value is 1, in days. |
730 |
| ArchiveDays |
integer |
The period after which backups are archived. This parameter is required only when RuleType is set to TRANSITION. Unit: days. |
30 |
| KeepLatestSnapshots |
integer |
Specifies whether to retain at least one backup version. Valid values:
|
1 |
| DataSourceFilters |
array<object> |
The data source filtering rules. This parameter is required only when RuleType is set to TAG. |
|
|
array<object> |
|||
| SourceType |
string |
The data source type. Valid values:
|
UDM_ECS |
DataSourceIds
deprecated
|
array |
[Deprecated] |
|
deprecated
|
string |
[Deprecated] |
**[Deprecated]** |
| AccountScope |
string |
The scope of accounts to which the policy applies. |
SPECIFIED_ACCOUNT |
| Accounts |
array<object> |
The list of account information in the data source filtering conditions. |
|
|
object |
|||
| CrossAccountType |
string |
The account association type, which is used to distinguish between the current account and cross-account scenarios. |
CROSS_ACCOUNT_BY_RD |
| CrossAccountUserId |
integer |
The Alibaba Cloud account ID of the account whose resources need to be backed up. |
1234567890123456 |
| CrossAccountRoleName |
string |
The name of the RAM role created in the account whose resources need to be backed up. |
hbrcrossrole |
| TagFilters |
array<object> |
The resource tag filtering rules. This parameter is required only when RuleType is set to TAG. |
|
|
object |
|||
| Key |
string |
The tag key. |
env |
| Value |
string |
The tag value. An empty value indicates any value. |
prod |
| Operator |
string |
The tag matching rule. Valid values:
|
EQUAL |
| Immutable |
boolean |
Specifies whether to enable backup locking. This field is valid only when PolicyType is set to UDM_ECS_ONLY. |
true |
| PolicyBindingCount |
integer |
The number of data sources bound to the policy. |
5 |
| PolicyType |
string |
The policy type. Valid values:
|
STANDARD |
| BusinessStatus |
string |
The user business status. |
ACTIVE |
| NextToken |
string |
The token used to retrieve the next page of policies. |
caeba0bbb2be03f84eb48b699f0a |
| MaxResults |
integer |
The maximum number of entries to return for a single request. Valid values: 10 to 100. Default value: 10. |
10 |
| TotalCount |
integer |
The total number of entries. |
12 |
| Success |
boolean |
Indicates whether the request is successful. Valid values:
|
true |
| Code |
string |
The return code. A value of 200 indicates success. |
200 |
| Message |
string |
The return message. If the request is successful, "successful" is returned. If an error occurs, the corresponding error message is returned. |
successful |
| RequestId |
string |
The ID of the request. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Examples
Success response
JSON format
{
"Policies": [
{
"CreatedTime": 1650248136,
"UpdatedTime": 1662080404,
"PolicyId": "po-000************bkz",
"PolicyName": "Daily backup + geo-redundancy",
"PolicyDescription": "Back up at 10:00 AM every day and replicate to Shanghai",
"Rules": [
{
"RuleId": "rule-000************f1e",
"RuleType": "BACKUP",
"Schedule": "I|1648647166|P1D",
"BackupType": "COMPLETE",
"VaultId": "v-000**************kgm",
"ReplicationRegionId": "cn-shanghai",
"Retention": 7,
"RetentionRules": [
{
"AdvancedRetentionType": "YEARLY",
"WhichSnapshot": 1,
"Retention": 730
}
],
"ArchiveDays": 30,
"KeepLatestSnapshots": 1,
"DataSourceFilters": [
{
"SourceType": "UDM_ECS",
"DataSourceIds": [
"**[Deprecated]**"
],
"AccountScope": "SPECIFIED_ACCOUNT",
"Accounts": [
{
"CrossAccountType": "CROSS_ACCOUNT_BY_RD",
"CrossAccountUserId": 1234567890123456,
"CrossAccountRoleName": "hbrcrossrole"
}
]
}
],
"TagFilters": [
{
"Key": "env",
"Value": "prod",
"Operator": "EQUAL"
}
],
"Immutable": true
}
],
"PolicyBindingCount": 5,
"PolicyType": "STANDARD",
"BusinessStatus": "ACTIVE"
}
],
"NextToken": "caeba0bbb2be03f84eb48b699f0a",
"MaxResults": 10,
"TotalCount": 12,
"Success": true,
"Code": "200",
"Message": "successful",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.