Document Database Service

Query the Role Information of an Instance

2025-07-24 08:40:38
API Introduction

Call the describeInstanceRole API to query MongoDB instance role information.

API Restrictions

None

URI
GET /v1/openApi/describeInstanceRole

Path Parameter

None

Query Parameter

Parameter

Required or Not

Parameter Type

Description

Example

prodInstId

*Required

String

External instance ID of the document database

a649077e15f349cb8b4cde6f7285a568

Request Parameters

Request Header Parameter

None

Response Parameter

Parameter

Required or Not

Parameter Type

Description

Example

Lower-level Object

statusCode

Yes

Integer

Response Code

Value range: 800 indicates success, 900 indicates failure

800


message

Yes

String

Response information

The XXX information is queried successfully


returnObj

Yes

Object[]

Return object array


returnObj

Table returnObj

Parameter

Required or Not

Parameter Type

Description

Example

Lower-level Object

elasticIp

Yes

String

Elastic IP (EIP)

127.0.0.1


node

Yes

String

Node

set_1098350_1


role

Yes

String

Role

master


alive

Yes

Integer

Taken from the ok attribute in mongodb

0


vpcIpv6

Yes

String

ipv6 address in the vpc



port

Yes

String

Host Port

8888


host

Yes

String

Host address

127.0.0.1


prodInstId

Yes

String

Sample id

a649077e15f349cb8b4cde6f7285a568


type

Yes

Integer

Node type (only available for sharded cluster)

0


resId

Yes

Integer

Uniquely mark this mongodb

67


Sample Request

Request Header

None

Request parameter query

/v1/openApi/describeInstanceRole?prodInstId=a649077e15f349cb8b4cde6f7285a568
Response Example
{
    "statusCode": 800,
    "message": "the instance role information of the document database service is queried successfully",
    "returnObj": [
        {
            "elasticIp": "",
            "node": "set_1098350_1",
            "role": "master",
            "alive": 1,
            "vpcIpv6": "",
            "port": "8350",
            "host": "172.27.176.109",
            "prodInstId": "c46d8f547cc648a78a68270092e70f80",
            "type": null,
            "resId": 67
        }
    ]
}
Status Code

Status Code

Description

800

Indicate that the request succeeded

900

Indicates that the request failed

Error Codes

None


QFilS2qBbf2_