하나의 Private Link 연결 만들기
지정된 프로젝트에 비공개 링크를 하나 생성합니다. 이 리소스를 사용하려면, 요청하는 서비스 계정 또는 API 키에 프로젝트 소유자 또는 프로젝트 스트림 처리 소유자 역할이 있어야 합니다.
경로 매개변수
-
프로젝트 식별하는 고유한 24-16진수 문자열입니다. 인증된 사용자가 액세스 할 수 있는 모든 프로젝트를 조회 하려면 /groups 엔드포인트를 사용합니다.
참고: 그룹과 프로젝트는 동의어입니다. 그룹 ID는 프로젝트 ID와 동일합니다. 기존 그룹의 경우, 그룹/프로젝트 ID는 동일하게 유지됩니다. 리소스 및 해당 엔드포인트는 그룹이라는 용어를 사용합니다.
형식은
^([a-f0-9]{24})$
패턴 과 일치해야 합니다.
쿼리 매개변수
-
애플리케이션이 응답을
envelope
JSON 객체로 래핑할지 여부를 나타내는 플래그입니다. 일부 API 클라이언트는 HTTP 응답 헤더 또는 상태 코드에 액세스할 수 없습니다. 이 문제를 해결하려면 쿼리에서 envelope=true를 설정합니다. 결과 목록을 반환하는 엔드포인트는 결과 객체를 엔벨로프로 사용합니다. 애플리케이션은 응답 본문에 상태 매개변수를 추가합니다.기본값은
false
입니다. -
응답 본문이 프리티프린트 형식이어야 하는지 여부를 나타내는 플래그입니다.
기본값은
false
입니다.Prettyprint
body
필수 사항
프로젝트에 대한 하나의 Private Link 연결을 생성하는 방법에 대한 세부 정보입니다. 프로젝트.
-
Amazon 리소스 이름(ARN)입니다. AWS 제공자 및 MSK 벤더에 필요합니다.
형식은
^arn:aws:kafka
패턴 과 일치해야 합니다. -
Azure Confluent 클러스터의 각 Azure 가용영역에 대한 Azure 리소스 ID입니다.
-
도메인 호스트 이름입니다. 다음 제공자 및 벤더 조합이 필요합니다.
- CONFLUENT 벤더가 있는 AWS 제공자입니다.
- AZURE 제공자와 EVENTHUB 또는 CONFLUENT 벤더입니다.
-
Confluent 클러스터의 하위 도메인 이름입니다. 일반적으로 이러한 영역이 가용영역입니다. AWS 제공자 및 CONFLUENT 벤더에 필요하며, AWS CONFLUENT 클러스터가 하위 도메인을 사용하지 않는 경우 빈 배열 []로 설정해야 합니다.
-
Kafka 클러스터가 배포된 제공자입니다. 유효한 값은 AWS와 AZURE입니다.
-
AZURE EVENTHUB의 경우 네임스페이스 엔드포인트 ID입니다. AWS CONFLUENT 클러스터의 경우, 이것은 VPC 엔드포인트 서비스 이름입니다.
-
클라우드 서비스를 관리하는 벤더입니다. 다음은 각 제공자별 벤더 값입니다.
Amazon Web Services -- Amazon Web Services MSK Kafka cluster용 MSK -- Amazon Web Services 의 Confluent Kafka cluster용 CONFLUENT -- Amazon Web Services Kinesis Data Streams용 Kinesis (출시 예정)
Azure -- Azure EventHub용 EVENThub. -- Azure 의 Confluent Kafka cluster를 위한 CONFLUENT
참고 벤더 필드 생략하면 기본값 일반 벤더 사용됩니다.
atlas api streams createGroupStreamPrivateLinkConnection --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.CreateGroupStreamPrivateLinkConnectionApiParams{}
sdkResp, httpResp, err := client.StreamsApi.
CreateGroupStreamPrivateLinkConnectionWithParams(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}/streams/privateLinkConnections" \
-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}/streams/privateLinkConnections" \
-d '{ <Payload> }'
{
"arn": "string",
"azureResourceIds": [
"string"
],
"dnsDomain": "string",
"dnsSubDomain": [
"string"
],
"provider": "string",
"region": "string",
"serviceEndpointId": "string",
"vendor": "string"
}
{
"_id": "32b6e34b3d91647abb20e7b8",
"arn": "string",
"azureResourceIds": [
"string"
],
"dnsDomain": "string",
"dnsSubDomain": [
"string"
],
"errorMessage": "string",
"interfaceEndpointId": "string",
"interfaceEndpointName": "string",
"links": [
{
"href": "https://cloud.mongodb.com/api/atlas",
"rel": "self"
}
],
"provider": "string",
"providerAccountId": "string",
"region": "string",
"serviceEndpointId": "string",
"state": "string",
"vendor": "string"
}
{
"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": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}