申请扮演角色
最近更新时间: 2024-09-03 18:49:37
1. 接口描述
接口请求域名: sts.api3.cloud.sunhongs.com。
申请扮演角色
默认接口请求频率限制:20次/秒。
接口更新时间:2022-07-06 16:48:44。
接口只验签名不鉴权。
2. 输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数。
| 参数名称 | 必选 | 允许NULL | 类型 | 描述 |
|---|---|---|---|---|
| Action | 是 | 否 | String | 公共参数,本接口取值:AssumeRole |
| Version | 是 | 否 | String | 公共参数,本接口取值:2018-08-13 |
| Region | 是 | 否 | String | 公共参数,本接口不需要传递此参数。 |
| RoleArn | 是 | 否 | String | 角色的资源描述。<br>普通角色:<br>qcs::cam::uin/12345678:role/4611686018427397919、qcs::cam::uin/12345678:roleName/testRoleName<br>服务角色:<br>qcs::cam::uin/12345678:role/tencentcloudServiceRole/4611686018427397920、qcs::cam::uin/12345678:role/tencentcloudServiceRoleName/testServiceRoleName |
| RoleSessionName | 是 | 否 | String | 临时会话名称,由用户自定义名称 |
| DurationSeconds | 否 | 否 | Uint64 | 指定临时证书的有效期,单位:秒,默认 7200 秒,最长可设定有效期为 43200 秒 |
| UserUin | 否 | 否 | Uint64 | 腾讯云业务帐号代理用户操作其帐户资源时,传入用户uin,缺省为用户的ownerUin。其他情况无需该参数 |
| Policy | 否 | 否 | String | 策略描述注意:1、policy 需要做 urlencode(如果通过 GET 方法请求云 API,发送请求前,所有参数都需要按照云 API 规范再 urlencode 一次)。2、策略语法参照CAM 策略语法。3、策略中不能包含 principal 元素。 |
| AssumeUin | 否 | 否 | Uint64 | 操作子账户Uin,携带至token中,cam-auth鉴权时会返回 |
3. 输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| Credentials | Credentials | 临时安全证书 |
| ExpiredTime | Uint64 | 证书无效的时间,返回 Unix 时间戳,精确到秒 |
| Expiration | String | 证书无效的时间,以 iso8601 格式的 UTC 时间表示 |
| RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
4. 错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码。
| 错误码 | 描述 |
|---|---|
| ResourceNotFound.RoleNotFound | The role corresponding to the account does not exist. |
| UnauthorizedOperation | Unauthorized operation. |
| InternalError.GetAppIdError | Failed to get the appid. |
| InternalError.SystemError | Internal error. Please check and try again. |
| InvalidParameter.StrategyInvalid | Invalid policy. |
| InvalidParameter.GrantOtherResource | Unauthorized access to the resource. |
| InvalidParameter.OverTimeError | The expiration time exceeds the threshold. |
| InvalidParameter.ResouceError | Resource error. |
| InternalError.DbError | Database error. |
| InternalError.EncryptError | Encryption failed. |
| InvalidParameter.AccountNotAvaliable | The account does not exist or is unavailable. |
| InvalidParameter.StrategyFormatError | Policy syntax error. |
| InvalidParameter.ExtendStrategyOverSize | The extension policy is too large. |
| InvalidParameter.ParamError | Invalid parameter. |
| InvalidParameter.PolicyTooLong | The policy is too long. |
| InternalError.GetSeedTokenError | Failed to get the seed token. |
| InvalidParameter.TempCodeNotAvaliable | Invalid TCB temp code. |