You can call the CheckServiceLinkedRole operation to check whether a service-linked role (SLR) is created.

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 parameters

Parameter Type Required Example Description
Action String Yes CheckServiceLinkedRole

The operation that you want to perform. Set the value to CheckServiceLinkedRole.

RegionId String Yes cn-hangzhou

The region ID of the instance.

Note The configuration of the RegionId parameter does not affect your query results. You can configure any region for this parameter. You can call the DescribeRegions operation to query the most recent region list.
ServiceLinkedRole String Yes AliyunServiceRoleForRdsPgsqlOnEcs

The name of the SLR.

Note For more information about the SLRs supported by ApsaraDB RDS, see Service-linked roles.
ResourceGroupId String No rg-bp67acfmxazb4p****

The ID of the resource group to which the instance belongs.

Response parameters

Parameter Type Example Description
HasServiceLinkedRole String true

Indicates whether an SLR is created.

RequestId String AB44DC0A-7E77-442A-97A9-C6418694CB22

The ID of the request.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=CheckServiceLinkedRole
&RegionId=cn-hangzhou
&ServiceLinkedRole=AliyunServiceRoleForRdsPgsqlOnEcs
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CheckServiceLinkedRoleResponse>
    <HasServiceLinkedRole>true</HasServiceLinkedRole>
    <RequestId>AB44DC0A-7E77-442A-97A9-C6418694CB22</RequestId>
</CheckServiceLinkedRoleResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "HasServiceLinkedRole" : true,
  "RequestId" : "AB44DC0A-7E77-442A-97A9-C6418694CB22"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidParameterGroupId.Malformed Specified parameterGroupId is not valid. The error message returned because the value of the parameterGroupId parameter is invalid. You can call the DescribeParameterGroups operation to query IDs of parameter templates.

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