为一个项目创建一个联合数据库实例和在线归档私有端点
添加指定项目中联合数据库实例和在线存档的所有私有端点。如果端点 ID 已存在且关联注释未更改,则 Atlas Data Federation 不会更改端点 ID 列表。如果端点 ID 已存在且关联注释发生更改,则 Atlas Data Federation 仅更新端点 ID 列表中的注释值。如果端点 ID 不存在,Atlas Data Federation 会将新端点附加到端点 ID 列表中的端点列表中。每个区域都有每个区域中各种端点的关联服务名称。
us-east-1
是 com.amazonaws.vpce.us-east-1.vpce-svc-00e311695874992b4
。
us-west-1
是 com.amazonaws.vpce.us-west-2.vpce-svc-09d86b19e59d1b4bb
。
eu-west-1
是 com.amazonaws.vpce.eu-west-1.vpce-svc-0824460b72e1a420e
。
eu-west-2
是 com.amazonaws.vpce.eu-west-2.vpce-svc-052f1840aa0c4f1f9
。
eu-central-1
是 com.amazonaws.vpce.eu-central-1.vpce-svc-0ac8ce91871138c0d
。
sa-east-1
是 com.amazonaws.vpce.sa-east-1.vpce-svc-0b56e75e8cdf50044
。
ap-southeast-2
是 com.amazonaws.vpce.ap-southeast-2.vpce-svc-036f1de74d761706e
。
ap-south-1
是 com.amazonaws.vpce.ap-south-1.vpce-svc-03eb8a541f96d356d
。
要使用此资源,请求的服务帐户或 API 密钥必须具有“项目所有者”或“项目图表管理员”角色。
路径参数
-
用于标识项目的唯一 24-十六进制数字字符串。 使用 /groups 端点检索身份验证的用户有权访问权限的所有项目。
注意:群组和项目是同义词。您的群组 ID 与项目 ID 相同。对于现有群组,群组/项目 ID 保持不变。资源和相应的端点使用“群组”一词。
格式应符合以下模式:
^([a-f0-9]{24})$
。
查询参数
-
指示应用程序是否将响应包装在
envelope
JSON 对象中的标志。某些 API 客户端无法访问 HTTP 响应标头或状态代码。要修复此问题,请在查询中设置 Envelope=true。返回结果列表的端点将结果对象用作 envelope。应用程序将状态参数添加到响应正文中。默认值为
false
。 -
指示响应正文是否应采用 prettyprint 格式的标记。
默认值为
false
。Prettyprint
body
必需
用于将联合数据库实例和在线存档添加到指定项目的私有端点。
-
标识Azure私有端点连接的链接ID 。
-
与此私有端点关联的人类可读字符串。
-
人类可读标签,用于标识客户 VPC 端点 DNS 名称。如果已定义,则还必须为区域指定一个值。
-
用于连接到Azure私有端点的IP解决。
格式应符合以下模式:
^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$
。 -
唯一的 22 字符构成的字母数字字符串,用于标识私有端点。
格式应符合以下模式:
^vpce-[0-9a-f]{17}$
。Atlas Data Lake使用AWS PrivateLink功能支持Amazon Web Services私有端点 -
描述批准私有端点请求失败的错误消息。
-
用于标识云服务提供商的可读标签。Atlas Data Lake 仅支持 Amazon Web Services。
值为
AWS
。默认值为AWS
。 -
用于标识客户 VPC 端点所在区域的人类可读标签。如果已定义,则还必须为 customerEndpointDNSName 指定一个值。
-
私有端点连接请求的状态。
取值为
PENDING
、OK
、FAILED
或DELETING
。 -
用户可读的标签,用于标识与此私有端点关联的资源类型。
值为
DATA_LAKE
。默认值为DATA_LAKE
。
atlas api dataFederation createGroupPrivateNetworkSettingEndpointId --help
import (
"os"
"context"
"log"
sdk "go.mongodb.org/atlas-sdk/v20231001001/admin"
)
func main() {
ctx := context.Background()
clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")
// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth
client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))
if err != nil {
log.Fatalf("Error: %v", err)
}
params = &sdk.CreateGroupPrivateNetworkSettingEndpointIdApiParams{}
sdkResp, httpResp, err := client.DataFederationApi.
CreateGroupPrivateNetworkSettingEndpointIdWithParams(ctx, params).
Execute()
}
curl --include --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/vnd.atlas.2023-10-01+json" \
--header "Content-Type: application/json" \
-X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds" \
-d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
--digest --include \
--header "Accept: application/vnd.atlas.2023-10-01+json" \
--header "Content-Type: application/json" \
-X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds" \
-d '{ <Payload> }'
{
"azureLinkId": "string",
"comment": "string",
"customerEndpointDNSName": "string",
"customerEndpointIPAddress": "string",
"endpointId": "vpce-3bf78b0ddee411ba1",
"errorMessage": "string",
"provider": "AWS",
"region": "US_EAST_1",
"status": "PENDING",
"type": "DATA_LAKE"
}
{
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"results": [
{
"azureLinkId": "string",
"comment": "string",
"customerEndpointDNSName": "string",
"customerEndpointIPAddress": "string",
"endpointId": "vpce-3bf78b0ddee411ba1",
"errorMessage": "string",
"provider": "AWS",
"region": "US_EAST_1",
"status": "PENDING",
"type": "DATA_LAKE"
}
],
"totalCount": 42
}
{
"error": 400,
"detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
"reason": "Bad Request",
"errorCode": "VALIDATION_ERROR"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"error": 404,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"reason": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}