Last updated: 2018-10-12 16:03:01

    1. API Description

    Domain name for API request:

    This API (ModifyImageSharePermission) is used to modify the image sharing information.

    • The accounts to which an image is shared can create instances from this image.
    • Each custom image can be shared to a maximum of 50 accounts.
    • A shared image can only be used to create instances and its name and description cannot be changed.
    • An image can only be shared to the accounts in the same region as the source account.

    A maximum of 10 requests can be initiated per second for this API.

    Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example:

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common parameter. The value used for this API: ModifyImageSharePermission
    Version Yes String Common parameter. The value used for this API: 2017-03-12
    Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
    ImageId Yes String Image ID, such as img-gvbnzy6f. Image ID can be obtained by either of the following ways:
  • From the ImageId field returned by the API DescribeImages.
  • Via the Image console.
    The specified image ID must identify an image with a status of NORMAL. For more information on image statuses, please see Image Data Sheet.
  • AccountIds.N Yes Array of String List of account IDs receiving shared image. For the format of array parameters, please see API Introduction. The account ID is different from QQ number. To query the account ID, please see the Account ID column in Account Information.
    Permission Yes String Operations including SHARE and CANCEL. SHARE means sharing, and CANCEL means canceling sharing.

    3. Output Parameters

    Parameter Name Type Description
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Error Codes

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InvalidAccountId.NotFound Invalid account ID.
    InvalidAccountIs.YourSelf You cannot share images to yourself.
    OverQuota The number of shared images exceeds the quota limit.

    5. Example

    Example 1 Share an image

    Input example
    &<Common request parameters>

    Output example

      "Response": {
        "RequestId": "71e69b56-32be-4412-ab45-49eded6a87be"

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback