Queries the cross-account authorization information of an ECR for a specified network instance.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| vpc:DescribeVpcGrantRulesToEcr | list | *VPC acs:vpc:{#regionId}:{#accountId}:vpc/{#InstanceId} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| MaxResults | integer | No | The number of entries to return per page. Valid values: 1 to 100. Default value: 10. | 50 |
| NextToken | string | No | A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:
| FFmyTO70tTpLG6I3FmYAXGKPd**** |
| InstanceId | string | No | The ID of the network instance. | vpc-wz9ek66wd7tl5xqpy**** |
| EcrInstanceId | string | No | The ID of the ECR that you want to query. | ecr-ncxadcujadncsa**** |
| EcrOwnerId | long | No | The ID of the Alibaba Cloud account to which the ECR belongs. Note
If you want to connect to a network instance that belongs to a different account, this parameter is required.
| 192732132151**** |
| RegionId | string | Yes | The region ID of the network instance that you want to query. | cn-hangzhou |
| ResourceGroupId | string | No | The ID of the resource group to which the network instance belongs. | rg-acfmxazb4ph6aiy**** |
| Tags | array<object> | No | The tag. | |
| object | No | Details of the tag. | ||
| Key | string | No | The key of the tag. You must specify at least one tag key and at most 20 tag keys. The tag key cannot be an empty string. A tag key can be up to 128 characters in length. It cannot start with | FinanceDept |
| Value | string | No | The value of the tag. You can enter a maximum of 20 tag values. The tag value can be an empty string. The tag key can be up to 128 characters in length, and cannot start with | FinanceJoshua |
| InstanceType | string | No | The type of instance. Valid values:
| VPC |
Response parameters
Examples
Sample success responses
JSONformat
{
"NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
"RequestId": "66342E8E-5E87-5FF9-80C7-C3E3571A****",
"TotalCount": 10,
"GrantRuleModels": [
{
"InstanceId": "vpc-wz9ek66wd7tl5xqpy****",
"Type": "VPC",
"InstanceUid": 0,
"RegionNo": "cn-hangzhou",
"EcrId": "ecr-tz7w3chlaptxr2****",
"EcrOwnerId": 0,
"CreationTime": "2024-09-09T02:14:51Z"
}
]
}Error codes
For a list of error codes, visit the Service error codes.
