Obtains the authorized roles that are used by OpenSearch to access other Alibaba Cloud services.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers. For more information, see Common request parameters.

Request syntax

GET /v4/openapi/assist/ram/roles HTTP/1.1

Request parameters

Parameter

Type

Required

Example

Description

type

String

No

"rds"

The type of the data source.

  • ApsaraDB RDS
  • PolarDB
  • MaxCompute
  • PolarDB-X for MySQL

Response parameters

Parameter Type Example Description
requestId String F7D7A0A0-FCF5-B5DF-8F0D-5CB6C1FC7405

The ID of the request.

result Array of result

The information of the authorized roles.

assumed Boolean true
name String AliyunOpenSearchDefaultRole
service String OpenSearch
template_id String DefaultRole

Examples

Sample requests

GET /v4/openapi/assist/ram/roles?type=rds

Sample success responses

XML format

<requestId>F7D7A0A0-FCF5-B5DF-8F0D-5CB6C1FC7405</requestId>
<result>
    <name>AliyunOpenSearchDefaultRole</name>
    <service>OpenSearch</service>
    <template_id>DefaultRole</template_id>
    <assumed>true</assumed>
</result>
<result>
    <name>AliyunDTSDefaultRole</name>
    <service>DTS</service>
    <template_id>DefaultRole</template_id>
    <assumed>true</assumed>
</result>

JSON format

{
    "requestId": "F7D7A0A0-FCF5-B5DF-8F0D-5CB6C1FC7405",
    "result": [
        {
            "name": "AliyunOpenSearchDefaultRole",
            "service": "OpenSearch",
            "template_id": "DefaultRole",
            "assumed": true
        },
        {
            "name": "AliyunDTSDefaultRole",
            "service": "DTS",
            "template_id": "DefaultRole",
            "assumed": true
        }
    ]
}

Error codes

For a list of error codes, visit the API Error Center.