管理镜像共享权限。您可以将自己的自定义镜像共享给其他阿里云账号,也可以发布为社区镜像供他人使用。
接口说明
调用该接口前,请您仔细阅读共享自定义镜像。
调用该接口时,请注意以下共享规则:
-
共享限制:只能共享自己账号下创建的自定义镜像,每份镜像最多可共享给 50 个阿里云账号,每份镜像一次最多共享给 10 个阿里云账号。
-
实例影响:使用共享镜像创建 ECS 实例( RunInstances )后,一旦自定义镜像拥有者解除了镜像共享关系,或者删除了自定义镜像( DeleteImage ),该实例将无法初始化系统盘( ReInitDisk )。
发布或下架社区镜像,您需要注意:
-
责任与协议:社区镜像由其所有者负责质量和迭代更新,阿里云仅提供平台支持。发布前请确保您已了解并签署社区镜像协议,否则不允许发布,社区镜像详情见发布社区镜像。
-
加密限制:加密镜像不可发布为社区镜像。
-
公开性:社区镜像完全公开,在镜像所属地域下,所有阿里云账号均可使用。
-
功能限制:社区镜像不支持共享、导出或复制。
-
下架影响:社区镜像下架后,将不再对其他阿里云账号公开,但已共享的镜像关系会继续保持。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ecs:ModifyImageSharePermission |
update |
*Image
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
自定义镜像所属的地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。 |
cn-hangzhou |
| ImageId |
string |
是 |
被共享的自定义镜像 ID。 重要 不再支持共享使用服务密钥加密的镜像,仅支持共享使用用户主密钥 CMK 加密的镜像,使用服务密钥加密的镜像在共享时将会报错。 |
m-bp18ygjuqnwhechc**** |
| LaunchPermission |
string |
否 |
说明
该参数正在邀测中,暂不支持使用。 |
hide |
| AddAccount |
array |
否 |
授权共享镜像的阿里云账号 ID。N 的取值范围:1~10,若一次提交超过 10 个阿里云账号,系统将只处理前 10 个,忽略多余的账号。 |
1234567890 |
|
string |
否 |
授权共享镜像的阿里云账号 ID。 |
1234567890 |
|
| RemoveAccount |
array |
否 |
删除镜像共享的阿里云账号 ID。N 的取值范围:1~10,若一次提交超过 10 个阿里云账号,系统将只处理前 10 个,忽略多余的账号。 |
1234567890 |
|
string |
否 |
删除镜像共享的阿里云账号 ID。 |
1234567890 |
|
| IsPublic |
boolean |
否 |
是否发布或下架社区镜像。取值范围:
默认值:false。 |
false |
| DryRun |
boolean |
否 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
示例
正常返回示例
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
异常返回示例
JSON格式
{
"RequestId": "C8B26B44-0189-443E-9816-D951F59623A9"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | MissingParameter | The input parameter "RegionId" that is mandatory for processing this request is not supplied. | |
| 400 | InvalidGroup.Malformed | The specified Group is wrongly formed. | 指定的组不存在。 |
| 400 | UnnecessaryParameter.LaunchPermission | The specified parameter "LaunchPermission" is unnecessary if paramter "AddAccounts" or "RemoveAccounts" exist. | |
| 400 | InvalidParameter.LaunchPermission | The specified parameter "LaunchPermission" is invalid. | |
| 400 | ForbiddenParameter.LaunchPermission | The specified parameter "LaunchPermission" is forbidden for current account. | |
| 403 | AssumeRoleError | Requires a RAM role of AliyunECSShareEncryptImageDefaultRole before sharing encrypted image. | 您在共享加密镜像前需要添加 AliyunECSShareEncryptImageDefaultRole RAM 角色。 |
| 403 | ImageDescription.ContainsSensitiveWords | The specified image description contains sensitive words. | 指定的镜像描述包含敏感词汇。 |
| 403 | ImageName.ContainsSensitiveWords | The specified image name contains sensitive words. | 指定的镜像名称包含敏感词汇。 |
| 403 | Image.Public | The specified image is public image. | |
| 403 | CurrentRegion.NotSupportPublicImage | Public image is not supported for current region. | |
| 403 | Image.NotPublic | The specified image is not public image. | 您指定的镜像不是公共权限,不能修改为私有权限。 |
| 403 | OperationDeined.FullImage | The encrypted image contains multiple snapshots, which do not support share. | |
| 403 | QuotaExceed.ShareImage | The shared Image Quota exceeds. | |
| 403 | QuotaExceed.ShareImageUser | The shared Image user Quota exceeds. | |
| 403 | InvalidImageId.BidMismatch | Cannot share the image with users %s of other sites. | 无法共享镜像给其他站点的用户。 |
| 403 | OperationDeined.EncryptedSnapshot | The image contains encrypted snapshots, which do not support share. | 指定的镜像含有加密快照,不支持共享这种镜像。 |
| 403 | OperationDenied.InvalidImageStatus | The specified image cannot be shared when it is deprecated. | 不能共享已经被弃用的镜像。 |
| 403 | PublicImageAgreement.NotSigned | The current account has not signed "Community Image Terms of Service". | 当前账户没有签署社区镜像协议。 |
| 403 | InvalidParameter.IsPublic | The specified parameter IsPublic is conflicted with other parameters. | 指定的参数IsPublic与其他参数冲突。 |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK(Customer Master Key) lacks authorization to add tags to the ECS service. | 用户主密钥(CMK)未授权ECS服务添加标签权限。 |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK (Customer Master Key) must be in an active state. | 用户主密钥(CMK)需要处于活动状态。 |
| 403 | InvalidOperation.ServiceKeyEncryptedImageUnsupported | The specified service key encrypted image is not supported for this operation. Please switch to a CMK (Customer Master Key) encrypted image and retry. | 服务密钥镜像不支持该操作,请更换使用CMK密钥后重试。 |
| 403 | OperationDenied.KMSKeyUnauthorized | The operation is denied due to missing KMS key authorization. Please check the KMS key permissions and ensure the key is properly authorized for this operation. | |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | 指定的镜像在该用户账号下不存在,请您检查镜像 ID 是否正确。 |
| 404 | InvalidAccount.NotFound | The specified account %s in parameter "AddAccount.n" or "RemoveAccount.n" does not exist. | AddAccount或者RemoveAccount中的账号不存在。 |
| 404 | InvalidAccount.Forbbiden | The specified Account does not yourself. | |
| 404 | InvalidKMSKeyId.NotFound | The KMS key used by the disk does not exist. | 磁盘使用的 KMS 密钥不存在. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。