All Products
Search
Document Center

Elastic Compute Service:DescribeImageSharePermission

Last Updated:Nov 14, 2024

Queries the accounts with which a custom image is shared. When you call this operation, you can specify parameters, such as RegionId and ImageId, in the request. The response can be displayed by page. By default, 10 entries are displayed on each page.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is 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.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeImageSharePermissionget
*Image
acs:ecs:{#regionId}:{#accountId}:image/{#imageId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the custom image. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
ImageIdstringYes

The ID of the custom image.

m-bp1caf3yicx5jlfl****
PageNumberintegerNo

The page number.

Pages start from page 1.

Default value: 1

1
PageSizeintegerNo

The number of entries per page.

Valid values: 1 to 100.

Default value: 10.

10

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page.

10
TotalCountinteger

The total number of entries returned.

1
ImageIdstring

The ID of the custom image.

m-bp1caf3yicx5jlfl****
RegionIdstring

The region ID of the custom image.

cn-hangzhou
ShareGroupsarray<object>

The shared groups.

ShareGroupobject
Groupstring

The shared group.

all
Accountsarray<object>

The Alibaba Cloud accounts.

Accountobject
AliyunIdstring

The ID of the Alibaba Cloud account.

1234567890
SharedTimestring

The time when the image was shared. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2023-01-01T12:05:00Z

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "PageNumber": 1,
  "PageSize": 10,
  "TotalCount": 1,
  "ImageId": "m-bp1caf3yicx5jlfl****",
  "RegionId": "cn-hangzhou",
  "ShareGroups": {
    "ShareGroup": [
      {
        "Group": "all"
      }
    ]
  },
  "Accounts": {
    "Account": [
      {
        "AliyunId": "1234567890",
        "SharedTime": "2023-01-01T12:05:00Z"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParameterThe input parameter "RegionId "that is mandatory for processing this request is not supplied.-
400MissingParameterThe input parameter "ImageId "that is mandatory for processing this request is not supplied.-
404InvalidImageId.NotFoundThe specified ImageId does not exist.The specified image does not exist in this account. Check whether the image ID is correct.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-05-17The Error code has changed. The response structure of the API has changedView Change Details