最近更新时间:2023.07.25 18:39:31
首次发布时间:2022.07.01 09:22:45
调用 DescribeInstancesIamRoles 接口查询一台或多台实例上已绑定的IAM角色。
名称 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeInstancesIamRoles | 要执行的操作,取值:DescribeInstancesIamRoles。 |
Version | String | 是 | 2020-04-01 | API的版本,取值:2020-04-01。 |
InstanceIds.N | String | 否 | InstanceIds.1=i-cm9tn4z1eohuu4d3****&InstanceIds.2=i-3tiegs1y963vj0**** | 实例ID,最多支持100个ID。
|
MaxResults | Integer | 否 | 10 | 分页查询时设置的每页行数:
|
NextToken | String | 否 | - | 分页查询凭证,用于标记分页的位置,初次调用该接口时无需设置。下次查询时,取值为上一次API调用返回的NextToken 参数值。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
InstancesIamRoles | Array of Struct | - | 符合条件的AssumeRole集合,具体请参见下表“ InstancesIamRole结构 ”。 |
NextToken | String | bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq****** | 本次调用返回的查询凭证值,返回为空表示该页为末页。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
InstanceId | String | i-3thhlu8byl4bwbha**** | 实例ID。 |
RoleNames | List | ["EcsTestRole","hello_role"] | 实例绑定的IAM角色名称。 |
GET /?Action=DescribeInstancesIamRoles&Version=2020-04-01&InstanceIds.1=i-cm9tn4z1eohuu4d3**** HTTP/1.1 Host: open.volcengineapi.com Region: cn-beijing Service: ecs
{ "ResponseMetadata": { "RequestId": "2021110417394001022514606307******", "Action": "DescribeInstancesIamRoles", "Version": "2020-04-01", "Service": "ecs", "Region": "cn-beijing" }, "Result": { "InstancesIamRoles": [ { "InstanceId": "i-cm9tn4z1eohuu4d3****", "RoleNames": [ "EcsTestRole" ] } ], "NextToken": "" } }
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidArgument | The specified argument is invalid. | 指定的参数不合法。 |
400 | LimitExceeded.MaximumInstanceIds | You've reached the limit on the number of InstanceIds that you can set. | 指定的实例数量超过最大限制。 |
429 | FlowLimitExceeded | You've reach the limit on request rate of resources. | 您已超过资源请求限速。 |
500 | InternalError | An internal error has occurred. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |