调用 CreateDBEndpoint 接口为目标 MongoDB 实例创建连接地址。
异步请求。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
InstanceId | String | 是 | mongo-shard-011d2479**** | 实例 ID。 说明 您可以调用 DescribeDBInstances 接口查询目标地域下所有 MongoDB 实例的基本信息,包括实例 ID。 |
ObjectId | String | 否 | mongo-shard-011d2479****-s0 | 需要创建的连接地址所属组件(如 Shard 或 ConfigServer 组件)的 ID。 说明
|
NetworkType | String | 否 | Private | 连接地址的网络类型,取值范围如下:
|
MongosNodeIds | String[] | 否 | [
"mongo-shard-9a554522****-0",
"mongo-shard-9a554522****-1"
] | 需要申请公网连接地址的 Mongos 节点 ID。 说明
|
EipIds | String[] | 否 | [
"eip-2d744t595x6o058ozfeht****",
"eip-2byu2l2b27lz42dx0efko****"
] | 申请公网地址时需要绑定的 EIP ID 列表。 说明
|
本接口无特有的返回参数。更多信息请见返回结构。
为副本集实例申请公网地址。
POST https://mongodb.volcengineapi.com/?Action=CreateDBEndpoint&Version=2022-01-01 HTTP/1.1 Host: mongodb.volcengineapi.com Content-Type: application/json; charset=utf-8 X-Date: 20201103T104027Z Authorization: HMAC-SHA256 Credential=AK****/20201103/cn-beijing/mongodb/request,SignedHeaders=content-type;host;x-date,Signature=**** { "NetworkType": "Public", "InstanceId": "mongo-replica-617a883d****", "EipIds": [ "eip-2d744t595x6o058ozfeht****", "eip-2byu2l2b27lz42dx0efko****" ] }
{ "ResponseMetadata": { "RequestId": "20220314172456010212194039160D****", "Action": "CreateDBEndpoint", "Version": "2022-01-01", "Service": "mongodb", "Region": "cn-beijing" }, "Result": null }
为分片集群实例中的某一 Shard 分片申请私网地址。
POST https://mongodb.volcengineapi.com/?Action=CreateDBEndpoint&Version=2022-01-01 HTTP/1.1 Host: mongodb.volcengineapi.com Content-Type: application/json; charset=utf-8 X-Date: 20201103T104027Z Authorization: HMAC-SHA256 Credential=AK****/20201103/cn-beijing/mongodb/request,SignedHeaders=content-type;host;x-date,Signature=**** { "ObjectId": "mongo-shard-9a554522****-s0", "NetworkType": "Private", "InstanceId": "mongo-shard-9a554522****" }
{ "ResponseMetadata": { "RequestId": "20220314172456010212194039160D****", "Action": "CreateDBEndpoint", "Version": "2022-01-01", "Service": "mongodb", "Region": "cn-beijing" }, "Result": null }
为分片集群实例中的 ConfigServer 申请公网地址。
说明
为 ConfigServer(或 Shard)申请公网地址前,需先申请对应组件的私网地址。
POST https://mongodb.volcengineapi.com/?Action=CreateDBEndpoint&Version=2022-01-01 HTTP/1.1 Host: mongodb.volcengineapi.com Content-Type: application/json; charset=utf-8 X-Date: 20201103T104027Z Authorization: HMAC-SHA256 Credential=AK****/20201103/cn-beijing/mongodb/request,SignedHeaders=content-type;host;x-date,Signature=**** { "ObjectId": "mongo-shard-9a554522****-config", "NetworkType": "Public", "InstanceId": "mongo-shard-9a554522****", "EipIds": [ "eip-2d744t595x6o058ozfeht****", "eip-2byu2l2b27lz42dx0efk****" ] }
{ "ResponseMetadata": { "RequestId": "20220314172456010212194039160D****", "Action": "CreateDBEndpoint", "Version": "2022-01-01", "Service": "mongodb", "Region": "cn-beijing" }, "Result": null }
为分片集群实例中的某一 Mongos 节点申请公网地址。
POST https://mongodb.volcengineapi.com/?Action=CreateDBEndpoint&Version=2022-01-01 HTTP/1.1 Host: mongodb.volcengineapi.com Content-Type: application/json; charset=utf-8 X-Date: 20201103T104027Z Authorization: HMAC-SHA256 Credential=AK****/20201103/cn-beijing/mongodb/request,SignedHeaders=content-type;host;x-date,Signature=**** { "ObjectId": "mongo-shard-9a554522****", "NetworkType": "Public", "InstanceId": "mongo-shard-9a554522****", "MongosNodeIds": [ "mongo-shard-9a554522****-0" ], "EipIds": [ "eip-2d744t595x6o058ozfeht****" ] }
{ "ResponseMetadata": { "RequestId": "20220314172456010212194039160D****", "Action": "CreateDBEndpoint", "Version": "2022-01-01", "Service": "mongodb", "Region": "cn-beijing" }, "Result": null }
更多详情,请参见错误码。