Manages the sharing of a custom image.
Operation description
When you call this operation, take note of the following items:
- You can share only your own custom images with other Alibaba Cloud accounts.
- You can share a custom image with up to 10 Alibaba Cloud accounts at a time. You can specify up to 10 Alibaba Cloud account IDs by using the AddAccount.N or RemoveAccount.N parameter. If you specify more than 10 account IDs, the parameter will be ignored.
- You can share a custom image with up to 50 Alibaba Cloud accounts.
- After you create an instance from a shared custom image by calling the RunInstances operation, you cannot call the ReInitDisk operation to reinitialize the system disk of the instance if the image owner unshares the image or calls the DeleteImage operation to delete the image.
When you publish or unpublish a community image, take note of the following items:
- Alibaba Cloud provides only the platform on which community images can be published and managed. The owner of a community image is responsible for the quality and updates of the image. Make sure that you read and agree to the Community Image Agreement. Otherwise, you cannot publish community images. For more information, see Publish a community image
- You cannot publish encrypted images as community images.
- All community images are publicly available. All Alibaba Cloud accounts that reside in the same region as a community image can access the image.
- You cannot share, export, or copy community images.
- After a community image is unpublished, it is no longer available to other Alibaba Cloud accounts. If a custom image is shared to other Alibaba cloud accounts before it is published as a community image, the accounts can still use the image after it is unpublished.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the custom image. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
ImageId | string | Yes | The ID of the custom image. | m-bp18ygjuqnwhechc**** |
LaunchPermission | string | No | Note
This parameter is in invitational preview and is not publicly available.
| hide |
AddAccount | array | No | The ID of Alibaba Cloud account N with which you want to share the custom image. Valid values of N: 1 to 10. If the value of N is greater than 10, this parameter is ignored. | |
string | No | The ID of Alibaba Cloud account N with which you want to share the custom image. Valid values of N: 1 to 10. If the value of N is greater than 10, this parameter is ignored. | 1234567890 | |
RemoveAccount | array | No | The ID of Alibaba Cloud account N from which you want to unshare the custom image. Valid values of N: 1 to 10. If the value of N is greater than 10, this parameter is ignored. | |
string | No | The ID of Alibaba Cloud account N from which you want to unshare the custom image. Valid values of N: 1 to 10. If the value of N is greater than 10, this parameter is ignored. | 1234567890 | |
IsPublic | boolean | No | Specifies whether to publish or unpublish a community image. Valid values:
Default value: false. | false |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
- | |||
- | |||
- | |||
- | |||
- | |||
Before you share encrypted images, make sure that the AliyunECSShareEncryptImageDefaultRole RAM role is attached to your account. | |||
- | |||
- | |||
- | |||
- | |||
The specified image is not published as a community image and cannot be unpublished. | |||
- | |||
The maximum number of custom images that can be shared has been reached. | |||
The maximum number of accounts to which a single image can be shared is exceeded. | |||
The image cannot be shared among users of different carriers. | |||
The specified image contains encrypted snapshots and cannot be shared. | |||
- | |||
You have not signed the Community Image Terms of Service. | |||
The specified image does not exist in this account. Check whether the image ID is correct. | |||
- | |||
You are attempting to share the image to your own account. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
see changesets | ||||||||||
| ||||||||||
see changesets | ||||||||||
| ||||||||||
see changesets | ||||||||||
| ||||||||||
see changesets | ||||||||||
|