All Products
Search
Document Center

Elastic Compute Service:ModifyImageSharePermission

Last Updated:Mar 19, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

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-bp18ygjuqnwhechc****
LaunchPermissionstringNo
Note This parameter is in invitational preview and is not publicly available.
hide
AddAccountarrayNo

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.

stringNo

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
RemoveAccountarrayNo

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.

stringNo

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
IsPublicbooleanNo

Specifies whether to publish or unpublish a community image. Valid values:

  • true: publishes the custom image as a community image.
  • false: unpublishes a community image. The unpublish operation takes effect only on community images.

Default value: false.

false

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParameterThe input parameter "RegionId" that is mandatory for processing this request is not supplied.-
400InvalidGroup.MalformedThe specified Group is wrongly formed.-
400UnnecessaryParameter.LaunchPermissionThe specified parameter "LaunchPermission" is unnecessary if paramter "AddAccounts" or "RemoveAccounts" exist.-
400InvalidParameter.LaunchPermissionThe specified parameter "LaunchPermission" is invalid.-
400ForbiddenParameter.LaunchPermissionThe specified parameter "LaunchPermission" is forbidden for current account.-
403AssumeRoleErrorRequires a RAM role of AliyunECSShareEncryptImageDefaultRole before sharing encrypted image.Before you share encrypted images, make sure that the AliyunECSShareEncryptImageDefaultRole RAM role is attached to your account.
403ImageDescription.ContainsSensitiveWordsThe specified image description contains sensitive words.-
403ImageName.ContainsSensitiveWordsThe specified image name contains sensitive words.-
403Image.PublicThe specified image is public image.-
403CurrentRegion.NotSupportPublicImagePublic image is not supported for current region.-
403Image.NotPublicThe specified image is not public image.The specified image is not published as a community image and cannot be unpublished.
403OperationDeined.FullImageThe encrypted image contains multiple snapshots, which do not support share.-
403QuotaExceed.ShareImageThe shared Image Quota exceeds.The maximum number of custom images that can be shared has been reached.
403QuotaExceed.ShareImageUserThe shared Image user Quota exceeds.The maximum number of accounts to which a single image can be shared is exceeded.
403InvalidImageId.BidMismatchCannot share image with other bid user.The image cannot be shared among users of different carriers.
403OperationDeined.EncryptedSnapshotThe image contains encrypted snapshots, which do not support share.The specified image contains encrypted snapshots and cannot be shared.
403OperationDenied.InvalidImageStatusThe specified image cannot be shared when it is deprecated.-
403PublicImageAgreement.NotSignedThe current account has not signed "Community Image Terms of Service".You have not signed the Community Image Terms of Service.
404InvalidImageId.NotFoundThe specified ImageId does not exist.The specified image does not exist in this account. Check whether the image ID is correct.
404InvalidAccount.NotFoundThe specified parameter "AddAccount.n" or "RemoveAccount.n" does not exist.-
404InvalidAccount.ForbbidenThe specified Account does not yourself.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 timeSummary of changesOperation
2023-12-11The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    delete Error Codes: 400
    delete Error Codes: 404
2023-04-19The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    delete Error Codes: 400
    delete Error Codes: 404
2023-04-10The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    delete Error Codes: 400
    delete Error Codes: 404
2021-06-23The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    delete Error Codes: 400
    delete Error Codes: 404