ModifyImageSharePermission

Last Updated: Feb 26, 2018

Description

Shares a custom image to other Alibaba Cloud users. Alternatively, withdraws the sharing authorization from other Alibaba Cloud users. Other users can create ECS instances (CreateInstance) or replace the system disks (ReplaceSystemDisk) by using the shared images. When you call this interface, consider the following:

  • You can only share your custom images to other Alibaba Cloud users.

  • One image can be shared to a maximum of 10 Alibaba Cloud accounts at a time. Or up to 10 accounts to whom a custom image is shared can be removed at a time. If more than 10 account IDs are specified in the parameter AddAccount.n or RemoveAccount.n, the parameter takes no effect.

  • One image can be shared to 50 Alibaba Cloud accounts at most. However, you can open a ticket if you want to share it with more users.

  • If an instance is created (CreateInstance) by using a shared image, once the image owner withdraws the sharing authorization or deletes the custom image (DeleteImage), the specified instance cannot be reinitialized (ReInitDisk).

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: ModifyImageSharePermission.
RegionId String Yes ID of the region to where the custom image belongs. For more information, see Regions and zones.
ImageId String Yes ID of the custom image.
AddAccount.n String No IDs of to-be-added Alibaba Cloud accounts where the image is shared.
Value range of n: [1, 10].
If n is greater than 10, this parameter is ignored.
RemoveAccount.n String No IDs of to-be-removed Alibaba Cloud accounts where the image is shared.
Value range of n: [1, 10].
If n is greater than 10, this parameter is ignored.

Response parameters

All parameters are common response parameters. For more information, see Common parameters .

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=ModifyImageSharePermission
  2. &RegionId=cn-hangzhou
  3. &ImageId=m-281234567
  4. &AddAccount.1=23412345234
  5. &<Common Request Parameters>

Response example

XML format

  1. <ModifyImageSharePermissionResponse>
  2. <RequestId>C8B26B44-0189-443E-9816-D951F59623A9</RequestId>
  3. </ModifyImageSharePermissionResponse>

JSON format

  1. {
  2. "RequestId": "C8B26B44-0189-443E-9816-D951F59623A9"
  3. }

Error codes

Error code Error message HTTP status code Meaning
IncorrectImageStatus The image is not available. 400 The specified image is unavailable.
InvalidRegionId.NotFound The specified region does not exist. 400 The specified RegionId does not exist. For more information, see Regions and Zones.
MissingParameter An input parameter RegionId that is mandatory for processing the request is not supplied. 400 You must specified the RegionId parameter. For more information, see Regions and Zones.
MissingParameter An input parameter ImageId that is mandatory for processing the request is not supplied. 400 You must specified the ImageId parameter.
OperationDeined.EncryptedSnapshot The image contains encrypted snapshots, which do not support share. 403 This action fails because the specified image contains encrypted snapshot.
InvalidImageId.NotFound The specified ImageId does not exist. 403 The specified ImageId does not exist.
QuotaExceed.ShareImageUser The shared image user quota exceeds. 403 You can only share a custom image to 50 Alibaba Cloud users at most. Open a ticket if you want to share it with more users.
InvalidAccount.Forbbiden The specified account does not yourself. 404 You cannot share images to yourself.
InvalidAccount.NotFound The specified parameter AddAccount.n or RemoveAccount.n does not exist. 404 The specified account ID listed in the parameter AddAccount.n or RemoveAccount.n does not exist.
Thank you! We've received your feedback.