You need to enable JavaScript to run this app.
导航
ModifyImageSharePermission - 修改镜像共享信息
最近更新时间:2024.05.21 10:26:16首次发布时间:2022.07.01 09:24:00

调用 ModifyImageSharePermission 接口,管理镜像共享权限。

注意事项

  • 仅状态为“可用”的自定义镜像支持共享镜像。
  • 不能将已获取到的共享镜像共享给其他火山引擎账户。
  • 不支持跨地域共享镜像。
  • 共享给其他火山引擎账户的镜像无法直接删除,需先取消该镜像的全部共享关系后方可删除。
  • 获取到共享镜像的火山引擎账户,只可以使用共享镜像创建或重装实例,不能删除或修改共享镜像。
  • 共享镜像为用户私有镜像,火山引擎无法确保其安全性和完整性,请谨慎确认并使用来自于可信任的共享账户的共享镜像。

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

ModifyImageSharePermission

要执行的操作,取值:ModifyImageSharePermission。

Version
String

2020-04-01

API的版本,取值:2020-04-01。

AddAccounts.N
Array of String

AddAccounts.1=210005****&AddAccounts.2=210007****

添加共享的账户。最多支持50个账户。

  • 参数 - N:表示账户的序号。
  • 多个账户之间用&分隔。
ImageId
String

image-ebgy1og99tfct0gw****

镜像ID。您可以调用DescribeImages接口并传入Visibility=private参数,查询获取自定义镜像ID。

RemoveAccounts.N
Array of String

RemoveAccounts.1=210000****&RemoveAccounts.2=210000****

删除共享的账户。

  • 参数 - N:表示账户的序号。
  • 多个账户之间用&分隔。

返回参数

本接口无特有的返回参数。更多信息请见返回结构

请求示例

GET /?Action=ModifyImageSharePermission&Version=2020-04-01&ImageId=image-ebgy1og99tfct0gw****&AddAccounts.1=210005**** HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
Service: ecs

返回示例

{
    "ResponseMetadata": {
        "RequestId": "202106111445100102252431000052****",
        "Action": "ModifyImageSharePermission",
        "Version": "2020-04-01",
        "Service": "ecs",
        "Region": "cn-beijing"
    },
    "Result": {}
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
InvalidAccount.Malformed
The specified Account is malformed.

指定的账户不合法。

400
InvalidArgument
The specified argument is invalid.

指定的参数不合法。

400
InvalidImageStatus
The specified image is not in the correct status for the request.

当前镜像的状态不支持此操作。

400
LimitExceeded.MaximumShareImageAccount
You've reached the limit on the number of account that you can share.

指定的单个镜像共享账户超过限制。

400
MissingParameter.AddAccountsAndRemoveAccounts
The required parameter AddAccountsAndRemoveAccounts is not supplied.

指定的参数AddAccounts和RemoveAccounts同时不存在。

400
MissingParameter.ImageId
The required parameter ImageId is not supplied.

镜像ID不能为空。

404
InvalidImage.NotFound
The specified image does not exist.

指定的镜像不存在。

500
InternalError
An internal error has occurred.

内部错误,请重试。如果多次尝试失败,请提交工单。