You need to enable JavaScript to run this app.
文档中心
文档控制台
注册
访问控制

访问控制

复制全文
下载 pdf
角色
CreateServiceLinkedRole - 创建服务关联角色
复制全文
下载 pdf
CreateServiceLinkedRole - 创建服务关联角色

创建服务关联角色。部分云服务可能会在您首次使用产品时要求授权云服务进行跨服务访问,该接口可用于新建服务关联角色以完成指定服务的跨服务访问授权。

调试

请求参数

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

const columns = [
  {
    width: '20%',
    title: '参数',
    dataIndex: 'Name',
    className: 'openapi-doc-parameter-table-name'
  },
  {
    width: 130,
    title: '类型',
    dataIndex: 'DataType',
    className: 'openapi-doc-parameter-table-type'
  },
  {
    width: 90,
    title: '是否必填',
    dataIndex: 'IsRequired',
    className: 'openapi-doc-parameter-table-required'
  },
  {
    width: '20%',
    title: '示例值',
    dataIndex: 'Example',
    className: 'openapi-doc-parameter-table-example'
  },
  {
    title: '描述',
    dataIndex: 'Description',
    className: 'openapi-doc-parameter-table-description'
  },
];

const data = [
  {
    rowKey: '->Action',
    Name: 'Action',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"CreateServiceLinkedRole"} />,
    Description: <RenderMd content={"要执行的操作,取值:CreateServiceLinkedRole。"} />,
    children: [
    ]
  },
  {
    rowKey: '->Version',
    Name: 'Version',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"2018-01-01"} />,
    Description: <RenderMd content={"API的版本,取值:2018-01-01。"} />,
    children: [
    ]
  },
  {
    rowKey: '->ServiceName',
    Name: 'ServiceName',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"cloud_trail"} />,
    Description: <RenderMd content={"需要创建的服务关联角色对应的Service。"} />,
    children: [
    ]
  },
  {
    rowKey: '->Tags.N.Key',
    Name: 'Tags.N.Key',
    DataType: 'Array of String',
    IsRequired: '否',
    Example: <RenderMd content={"usage"} />,
    Description: <RenderMd content={"给角色附加标签的标签键。使用UTF-8编码的Unicode,长度为1~128字符,允许任何语言文字、数字、空格和_ . : / = + - @符号。每个角色至多附加50对标签。\n\n"} />,
    children: [
    ]
  },
  {
    rowKey: '->Tags.N.Value',
    Name: 'Tags.N.Value',
    DataType: 'Array of String',
    IsRequired: '否',
    Example: <RenderMd content={"servicerole"} />,
    Description: <RenderMd content={"给角色附加标签的标签值。使用UTF-8编码的Unicode,长度为0~256字符(即Value可以为空),允许任何语言文字、数字、空格和_ . : / = + - @符号。每个角色至多附加50对标签。"} />,
    children: [
    ]
  },

];

return (<Table
  rowKey="rowKey"
  className="openapi-doc-parameter-table"
  columns={columns}
  data={data}
  border={ { cell: true, wrapper: true } }
  scroll={ { x: "auto" } }
  pagination={false}
/>);

返回参数

本接口无特有的返回参数。更多信息请见返回结构

请求示例

GET /?Action=CreateServiceLinkedRole&Version=2018-01-01&ServiceName=cloud_trail HTTP/1.1
Host: iam.volcengineapi.com
X-Date: 20240911T101533Z
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240911/cn-beijing/iam/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f


返回示例

{
  "ResponseMetadata": {
    "RequestId": "20240911181538216184251161FC3A2A",
    "Action": "CreateServiceLinkedRole",
    "Version": "2018-01-01",
    "Service": "iam",
    "Region": "cn-beijing"
  }
}

错误码

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

const columns = [
  {
    title: '状态码',
    dataIndex: 'HttpCode',
    width: '12%',
    className: 'openapi-doc-errorcode-table-httpcode'
  },
  {
    title: '错误码',
    dataIndex: 'ErrorCode',
    width: '22%',
    className: 'openapi-doc-errorcode-table-errorcode'
  },
  {
    title: '错误信息',
    dataIndex: 'ErrorMessage',
    width: '33%',
    className: 'openapi-doc-errorcode-table-errormessage'
  },
  {
    title: '说明',
    dataIndex: 'Description',
    width: '33%',
    className: 'openapi-doc-errorcode-table-description'
  },
];

const data = [
  {
    HttpCode: 400,
    ErrorCode: 'RoleAlreadyExists',
    ErrorMessage: "Role '%s' already exists.",
    Description: <RenderMd content={"已经完成角色授权,无需重复授权。"} />,
  },
];

return (<Table
  columns={columns}
  data={data}
  border={ { cell: true, wrapper: true } }
  scroll={ { x: "auto" } }
  pagination={false}
/>);
最近更新时间:2024.09.14 14:50:35
这个页面对您有帮助吗?
有用
有用
无用
无用