调用CreateServiceLinkedRole创建服务关联角色。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
ServiceName | string | 是 | 服务名称。 具体信息,请参见支持服务关联角色的云服务。 | polardb.aliyuncs.com |
CustomSuffix | string | 否 | 角色名称后缀。 角色名称(含后缀)的总长度为 1~64 个字符,可包含英文字母、数字、半角句号(.)和短划线(-)。 例如:假设后缀为 | Example |
Description | string | 否 | 服务关联角色描述。 只有允许自定义后缀的服务关联角色才能填写角色描述,否则,角色描述将使用预设值且不能修改。 长度为 1~1024 个字符。 | Service Linked Role for PolarDB. PolarDB will use this role to access your resources in other services. |
返回参数
示例
正常返回示例
JSON
格式
{
"RequestId": "FE58D7CF-03BC-432A-B42D-BC3390C8C2E1",
"Role": {
"Arn": "acs:ram::177242285274****:role/aliyunserviceroleforpolardb",
"AssumeRolePolicyDocument": "{\\\"Statement\\\":[{\\\"Action\\\":\\\"sts:AssumeRole\\\",\\\"Effect\\\":\\\"Allow\\\",\\\"Principal\\\":{\\\"Service\\\":[\\\"polardb.aliyuncs.com\\\"]}}],\\\"Version\\\":\\\"1\\\"}",
"CreateDate": "2020-06-30T08:14:16Z",
"Description": "Service Linked Role for PolarDB. PolarDB will use this role to access your resources in other services.",
"IsServiceLinkedRole": true,
"RoleId": "32833240981067****",
"RoleName": "AliyunServiceRoleForPolarDB",
"RolePrincipalName": "AliyunServiceRoleForPolarDB@role.test.onaliyunservice.com"
}
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParameter.CustomSuffix.NotAllowed | Custom suffix is not allowed for this Service Linked Role. | 该服务关联角色不支持自定义后缀。 |
400 | InvalidParameter.CustomSuffix.InvalidChars | The parameter CustomSuffix contains invalid characters. | 参数CustomSuffix包含无效字符。 |
400 | InvalidParameter.CustomSuffix.Length | The maximum length of the parameter CustomSuffix is exceeded. | 参数CustomSuffix长度超限。 |
400 | InvalidParameter.Description.NotAllowed | Custom description is not allowed for default service linked role. | - |
400 | InvalidParameter.Description.Length | The maximum length of the description is exceeded. It must not exceed 1024 characters. | 描述长度超限。最大不得超过1024个字符。 |
404 | EntityNotExist.Service | The service does not exist. | 该服务不存在。 |
409 | EntityAlreadyExists.Role | The role already exists. | 角色已存在。 |
409 | LimitExceeded.Role | The maximum number of roles is exceeded. | 角色数量超出限制。 |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|
暂无变更历史