You need to enable JavaScript to run this app.
导航
DescribeImageSharePermission - 查询镜像共享信息
最近更新时间:2024.05.21 10:26:16首次发布时间:2022.07.01 09:23:41

调用 DescribeImageSharePermission 接口,查询自定义镜像已经共享的所有用户。

调试

请求参数

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

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

DescribeImageSharePermission

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

Version
String

2020-04-01

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

ImageId
String

image-ebgy1og99tfct0gw****

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

MaxResults
Integer

15

分页查询时设置的每页行数:

  • 默认值:15
  • 取值范围:1~100
NextToken
String

--

分页查询凭证,用于标记分页的位置,初次调用该接口时无需设置。下次查询时,取值为上一次API调用返回的NextToken参数值。

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
Accounts
Array of AccountsForDescribeImageSharePermission

--

镜像共享的账户。

ImageId
String

image-4431h3l7hl31a0******

镜像ID。

NextToken
String

bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq******

本次调用返回的查询凭证值,返回为空表示该页为末页。

请求示例

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

返回示例

{
    "ResponseMetadata": {
        "RequestId": "202106111445100102252431000052****",
        "Action": "DescribeImageSharePermission",
        "Version": "2020-04-01",
        "Service": "ecs",
        "Region": "cn-beijing"
    },
    "Result": {
        "NextToken":"bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq******",
        "ImageId": "image-ebgy1og99tfct0gw****",
        "Accounts": [
            {
                "AccountId": "210005****"
            }
        ]
    }
}

错误码

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

状态码
错误码
错误信息
说明
400
InvalidArgument
The specified argument is invalid.

指定的参数不合法。

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.

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