하나의 비용 탐색기 쿼리 프로세스 생성
비용 탐색기 내에서 지정된 매개변수에 대한 쿼리 프로세스를 생성합니다. 쿼리 상태를 폴링하고 최종적으로 결과를 검색하는 데 사용할 수 있는 토큰이 반환됩니다.
경로 매개변수
-
프로젝트가 포함된 조직 식별하는 고유한 24-16진수 문자열입니다. 인증된 사용자가 액세스 할 수 있는 모든 조직을 조회 하려면 /orgs 엔드포인트를 사용합니다.
형식은
^([a-f0-9]{24})$패턴 과 일치해야 합니다.
쿼리 매개변수
-
애플리케이션이 응답을
envelopeJSON 객체로 래핑할지 여부를 나타내는 플래그입니다. 일부 API 클라이언트는 HTTP 응답 헤더 또는 상태 코드에 액세스할 수 없습니다. 이 문제를 해결하려면 쿼리에서 envelope=true를 설정합니다. 결과 목록을 반환하는 엔드포인트는 결과 객체를 엔벨로프로 사용합니다. 애플리케이션은 응답 본문에 상태 매개변수를 추가합니다.기본값은
false입니다.
body
필수 사항
비용 탐색기 쿼리에 대한 필터 매개변수를 설정합니다.
-
Cost Explorer 쿼리에 포함할 클러스터 목록입니다.
각 형식은
^([a-f0-9]{24})$패턴 과 일치해야 합니다. -
비용 탐색기 쿼리의 독점 종료일입니다. 날짜는 한 달의 시작일이어야 합니다.
-
반환된 사용량 결과를 그룹화할 기준이 되는 차원입니다. 측정기준을 사용하려면 하나 이상의 필터 값을 제공해야 합니다.
값은
organizations,projects,clusters또는services입니다. -
필터 조건과 일치하지만 모든 필터 조건에 대한 값이 없는 사용량이 응답에 포함되는지 여부를 제어하는 플래그입니다. 기본값은 거짓으로, 부분적으로 일치하는 데이터를 제외합니다.
-
Cost Explorer 쿼리에 포함할 조직 목록입니다.
각 형식은
^([a-f0-9]{24})$패턴 과 일치해야 합니다. -
Cost Explorer 쿼리에 포함할 프로젝트 목록입니다.
각 형식은
^([a-f0-9]{24})$패턴 과 일치해야 합니다. -
Cost Explorer 쿼리에 포함할 SKU 서비스 목록입니다.
값은
Atlas,Clusters,Storage,Serverless Instances,Backup,Data Transfer,BI Connector,Premium Features,Atlas Data Federation,Atlas Stream Processing,App Services,Charts,Cloud Manager,Cloud Manager Standard/Premium,Legacy Backup,Flex Consulting,Support또는Credits. -
Cost Explorer 쿼리의 포괄적 시작 날짜입니다. 날짜는 한 달의 시작일이어야 합니다.
atlas api invoices createCostExplorerProcess --help
import (
"os"
"context"
"log"
sdk "go.mongodb.org/atlas-sdk/v20250219001/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.CreateOrgBillingCostExplorerUsageProcessApiParams{}
sdkResp, httpResp, err := client.InvoicesApi.
CreateOrgBillingCostExplorerUsageProcessWithParams(ctx, params).
Execute()
}
curl --include --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/vnd.atlas.2025-02-19+json" \
--header "Content-Type: application/json" \
-X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage" \
-d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
--digest --include \
--header "Accept: application/vnd.atlas.2025-02-19+json" \
--header "Content-Type: application/json" \
-X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage" \
-d '{ <Payload> }'
{
"clusters": [
"32b6e34b3d91647abb20e7b8"
],
"endDate": "2025-05-04",
"groupBy": "organizations",
"includePartialMatches": true,
"organizations": [
"32b6e34b3d91647abb20e7b8"
],
"projects": [
"32b6e34b3d91647abb20e7b8"
],
"services": [
"Atlas"
],
"startDate": "2025-05-04"
}
{
"token": "d9ab638a801efe182f98ae3e18ea4bb47b9fda808a28a8c7de205bb0e94f7d71"
}
{
"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"
}