- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS, Azure, and Google Cloud. You can query your cost data by using the Metrics endpoint and the cloud_cost
data source. For more information, see the Cloud Cost Management documentation.
GET https://api.ap1.datadoghq.com/api/v2/cost/aws_cur_confighttps://api.ap2.datadoghq.com/api/v2/cost/aws_cur_confighttps://api.datadoghq.eu/api/v2/cost/aws_cur_confighttps://api.ddog-gov.com/api/v2/cost/aws_cur_confighttps://api.datadoghq.com/api/v2/cost/aws_cur_confighttps://api.us3.datadoghq.com/api/v2/cost/aws_cur_confighttps://api.us5.datadoghq.com/api/v2/cost/aws_cur_config
List the AWS CUR configs.
This endpoint requires the cloud_cost_management_read
permission.
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
OK
List of AWS CUR configs.
항목
유형
설명
data [required]
[object]
An AWS CUR config.
attributes [required]
object
Attributes for An AWS CUR config.
account_filters
object
The account filtering configuration.
excluded_accounts
[string]
The AWS account IDs to be excluded from your billing dataset. This field is used when include_new_accounts
is true
.
include_new_accounts
boolean
Whether or not to automatically include new member accounts by default in your billing dataset.
included_accounts
[string]
The AWS account IDs to be included in your billing dataset. This field is used when include_new_accounts
is false
.
account_id [required]
string
The AWS account ID.
bucket_name [required]
string
The AWS bucket name used to store the Cost and Usage Report.
bucket_region [required]
string
The region the bucket is located in.
created_at
string
The timestamp when the AWS CUR config was created.
error_messages
[string]
The error messages for the AWS CUR config.
months
int32
DEPRECATED: The number of months the report has been backfilled.
report_name [required]
string
The name of the Cost and Usage Report.
report_prefix [required]
string
The report prefix used for the Cost and Usage Report.
status [required]
string
The status of the AWS CUR.
status_updated_at
string
The timestamp when the AWS CUR config status was updated.
updated_at
string
The timestamp when the AWS CUR config status was updated.
id
string
The ID of the AWS CUR config.
type [required]
enum
Type of AWS CUR config.
Allowed enum values: aws_cur_config
default: aws_cur_config
{
"data": [
{
"attributes": {
"account_filters": {
"excluded_accounts": [
"123456789123",
"123456789143"
],
"include_new_accounts": true,
"included_accounts": [
"123456789123",
"123456789143"
]
},
"account_id": "123456789123",
"bucket_name": "dd-cost-bucket",
"bucket_region": "us-east-1",
"created_at": "string",
"error_messages": [],
"months": "integer",
"report_name": "dd-report-name",
"report_prefix": "dd-report-prefix",
"status": "active",
"status_updated_at": "string",
"updated_at": "string"
},
"id": "string",
"type": "aws_cur_config"
}
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/aws_cur_config" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
List Cloud Cost Management AWS CUR configs returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.list_cost_awscur_configs()
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# List Cloud Cost Management AWS CUR configs returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
p api_instance.list_cost_awscur_configs()
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// List Cloud Cost Management AWS CUR configs returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.ListCostAWSCURConfigs(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.ListCostAWSCURConfigs`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.ListCostAWSCURConfigs`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// List Cloud Cost Management AWS CUR configs returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.AwsCURConfigsResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
AwsCURConfigsResponse result = apiInstance.listCostAWSCURConfigs();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#listCostAWSCURConfigs");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// List Cloud Cost Management AWS CUR configs returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.list_cost_awscur_configs().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* List Cloud Cost Management AWS CUR configs returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
apiInstance
.listCostAWSCURConfigs()
.then((data: v2.AwsCURConfigsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
POST https://api.ap1.datadoghq.com/api/v2/cost/aws_cur_confighttps://api.ap2.datadoghq.com/api/v2/cost/aws_cur_confighttps://api.datadoghq.eu/api/v2/cost/aws_cur_confighttps://api.ddog-gov.com/api/v2/cost/aws_cur_confighttps://api.datadoghq.com/api/v2/cost/aws_cur_confighttps://api.us3.datadoghq.com/api/v2/cost/aws_cur_confighttps://api.us5.datadoghq.com/api/v2/cost/aws_cur_config
Create a Cloud Cost Management account for an AWS CUR config.
This endpoint requires the cloud_cost_management_write
permission.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
항목
유형
설명
data [required]
object
AWS CUR config Post data.
attributes
object
Attributes for AWS CUR config Post Request.
account_filters
object
The account filtering configuration.
excluded_accounts
[string]
The AWS account IDs to be excluded from your billing dataset. This field is used when include_new_accounts
is true
.
include_new_accounts
boolean
Whether or not to automatically include new member accounts by default in your billing dataset.
included_accounts
[string]
The AWS account IDs to be included in your billing dataset. This field is used when include_new_accounts
is false
.
account_id [required]
string
The AWS account ID.
bucket_name [required]
string
The AWS bucket name used to store the Cost and Usage Report.
bucket_region
string
The region the bucket is located in.
months
int32
The month of the report.
report_name [required]
string
The name of the Cost and Usage Report.
report_prefix [required]
string
The report prefix used for the Cost and Usage Report.
type [required]
enum
Type of AWS CUR config Post Request.
Allowed enum values: aws_cur_config_post_request
default: aws_cur_config_post_request
{
"data": {
"attributes": {
"account_id": "123456789123",
"bucket_name": "dd-cost-bucket",
"bucket_region": "us-east-1",
"report_name": "dd-report-name",
"report_prefix": "dd-report-prefix"
},
"type": "aws_cur_config_post_request"
}
}
OK
The definition of AwsCurConfigResponse
object.
항목
유형
설명
data
object
The definition of AwsCurConfigResponseData
object.
attributes
object
The definition of AwsCurConfigResponseDataAttributes
object.
account_filters
object
The definition of AwsCurConfigResponseDataAttributesAccountFilters
object.
excluded_accounts
[string]
The account_filters
excluded_accounts
.
include_new_accounts
boolean
The account_filters
include_new_accounts
.
included_accounts
[string]
The account_filters
included_accounts
.
account_id
string
The attributes
account_id
.
bucket_name
string
The attributes
bucket_name
.
bucket_region
string
The attributes
bucket_region
.
created_at
string
The attributes
created_at
.
error_messages
[string]
The attributes
error_messages
.
months
int64
The attributes
months
.
report_name
string
The attributes
report_name
.
report_prefix
string
The attributes
report_prefix
.
status
string
The attributes
status
.
status_updated_at
string
The attributes
status_updated_at
.
updated_at
string
The attributes
updated_at
.
id
string
The AwsCurConfigResponseData
id
.
type [required]
enum
AWS CUR config resource type.
Allowed enum values: aws_cur_config
default: aws_cur_config
{
"data": {
"attributes": {
"account_filters": {
"excluded_accounts": [
"123456789124",
"123456789125"
],
"include_new_accounts": true
},
"account_id": "123456789123",
"bucket_name": "dd-cost-bucket",
"bucket_region": "us-east-1",
"created_at": "2023-01-01T12:00:00.000Z",
"error_messages": [],
"months": 36,
"report_name": "dd-report-name",
"report_prefix": "dd-report-prefix",
"status": "active",
"status_updated_at": "2023-01-01T12:00:00.000Z",
"updated_at": "2023-01-01T12:00:00.000Z"
},
"id": "123456789123",
"type": "aws_cur_config"
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/aws_cur_config" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"account_id": "123456789123",
"bucket_name": "dd-cost-bucket",
"bucket_region": "us-east-1",
"report_name": "dd-report-name",
"report_prefix": "dd-report-prefix"
},
"type": "aws_cur_config_post_request"
}
}
EOF
// Create Cloud Cost Management AWS CUR config returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.AwsCURConfigPostRequest{
Data: datadogV2.AwsCURConfigPostData{
Attributes: datadogV2.AwsCURConfigPostRequestAttributes{
AccountId: "123456789123",
BucketName: "dd-cost-bucket",
BucketRegion: datadog.PtrString("us-east-1"),
ReportName: "dd-report-name",
ReportPrefix: "dd-report-prefix",
},
Type: datadogV2.AWSCURCONFIGPOSTREQUESTTYPE_AWS_CUR_CONFIG_POST_REQUEST,
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.CreateCostAWSCURConfig(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.CreateCostAWSCURConfig`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.CreateCostAWSCURConfig`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Create Cloud Cost Management AWS CUR config returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.AwsCURConfigPostData;
import com.datadog.api.client.v2.model.AwsCURConfigPostRequest;
import com.datadog.api.client.v2.model.AwsCURConfigPostRequestAttributes;
import com.datadog.api.client.v2.model.AwsCURConfigPostRequestType;
import com.datadog.api.client.v2.model.AwsCURConfigResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
AwsCURConfigPostRequest body =
new AwsCURConfigPostRequest()
.data(
new AwsCURConfigPostData()
.attributes(
new AwsCURConfigPostRequestAttributes()
.accountId("123456789123")
.bucketName("dd-cost-bucket")
.bucketRegion("us-east-1")
.reportName("dd-report-name")
.reportPrefix("dd-report-prefix"))
.type(AwsCURConfigPostRequestType.AWS_CUR_CONFIG_POST_REQUEST));
try {
AwsCURConfigResponse result = apiInstance.createCostAWSCURConfig(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#createCostAWSCURConfig");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Create Cloud Cost Management AWS CUR config returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
from datadog_api_client.v2.model.aws_cur_config_post_data import AwsCURConfigPostData
from datadog_api_client.v2.model.aws_cur_config_post_request import AwsCURConfigPostRequest
from datadog_api_client.v2.model.aws_cur_config_post_request_attributes import AwsCURConfigPostRequestAttributes
from datadog_api_client.v2.model.aws_cur_config_post_request_type import AwsCURConfigPostRequestType
body = AwsCURConfigPostRequest(
data=AwsCURConfigPostData(
attributes=AwsCURConfigPostRequestAttributes(
account_id="123456789123",
bucket_name="dd-cost-bucket",
bucket_region="us-east-1",
report_name="dd-report-name",
report_prefix="dd-report-prefix",
),
type=AwsCURConfigPostRequestType.AWS_CUR_CONFIG_POST_REQUEST,
),
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.create_cost_awscur_config(body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Create Cloud Cost Management AWS CUR config returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
body = DatadogAPIClient::V2::AwsCURConfigPostRequest.new({
data: DatadogAPIClient::V2::AwsCURConfigPostData.new({
attributes: DatadogAPIClient::V2::AwsCURConfigPostRequestAttributes.new({
account_id: "123456789123",
bucket_name: "dd-cost-bucket",
bucket_region: "us-east-1",
report_name: "dd-report-name",
report_prefix: "dd-report-prefix",
}),
type: DatadogAPIClient::V2::AwsCURConfigPostRequestType::AWS_CUR_CONFIG_POST_REQUEST,
}),
})
p api_instance.create_cost_awscur_config(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Create Cloud Cost Management AWS CUR config returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
use datadog_api_client::datadogV2::model::AwsCURConfigPostData;
use datadog_api_client::datadogV2::model::AwsCURConfigPostRequest;
use datadog_api_client::datadogV2::model::AwsCURConfigPostRequestAttributes;
use datadog_api_client::datadogV2::model::AwsCURConfigPostRequestType;
#[tokio::main]
async fn main() {
let body = AwsCURConfigPostRequest::new(AwsCURConfigPostData::new(
AwsCURConfigPostRequestAttributes::new(
"123456789123".to_string(),
"dd-cost-bucket".to_string(),
"dd-report-name".to_string(),
"dd-report-prefix".to_string(),
)
.bucket_region("us-east-1".to_string()),
AwsCURConfigPostRequestType::AWS_CUR_CONFIG_POST_REQUEST,
));
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.create_cost_awscur_config(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Create Cloud Cost Management AWS CUR config returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiCreateCostAWSCURConfigRequest = {
body: {
data: {
attributes: {
accountId: "123456789123",
bucketName: "dd-cost-bucket",
bucketRegion: "us-east-1",
reportName: "dd-report-name",
reportPrefix: "dd-report-prefix",
},
type: "aws_cur_config_post_request",
},
},
};
apiInstance
.createCostAWSCURConfig(params)
.then((data: v2.AwsCURConfigResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
PATCH https://api.ap1.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.ap2.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.datadoghq.eu/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.ddog-gov.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.us3.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.us5.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}
Update the status (active/archived) and/or account filtering configuration of an AWS CUR config.
This endpoint requires the cloud_cost_management_write
permission.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
cloud_account_id [required]
integer
Cloud Account id.
항목
유형
설명
data [required]
object
AWS CUR config Patch data.
attributes [required]
object
Attributes for AWS CUR config Patch Request.
account_filters
object
The account filtering configuration.
excluded_accounts
[string]
The AWS account IDs to be excluded from your billing dataset. This field is used when include_new_accounts
is true
.
include_new_accounts
boolean
Whether or not to automatically include new member accounts by default in your billing dataset.
included_accounts
[string]
The AWS account IDs to be included in your billing dataset. This field is used when include_new_accounts
is false
.
is_enabled
boolean
Whether or not the Cloud Cost Management account is enabled.
type [required]
enum
Type of AWS CUR config Patch Request.
Allowed enum values: aws_cur_config_patch_request
default: aws_cur_config_patch_request
{
"data": {
"attributes": {
"is_enabled": true
},
"type": "aws_cur_config_patch_request"
}
}
OK
List of AWS CUR configs.
항목
유형
설명
data [required]
[object]
An AWS CUR config.
attributes [required]
object
Attributes for An AWS CUR config.
account_filters
object
The account filtering configuration.
excluded_accounts
[string]
The AWS account IDs to be excluded from your billing dataset. This field is used when include_new_accounts
is true
.
include_new_accounts
boolean
Whether or not to automatically include new member accounts by default in your billing dataset.
included_accounts
[string]
The AWS account IDs to be included in your billing dataset. This field is used when include_new_accounts
is false
.
account_id [required]
string
The AWS account ID.
bucket_name [required]
string
The AWS bucket name used to store the Cost and Usage Report.
bucket_region [required]
string
The region the bucket is located in.
created_at
string
The timestamp when the AWS CUR config was created.
error_messages
[string]
The error messages for the AWS CUR config.
months
int32
DEPRECATED: The number of months the report has been backfilled.
report_name [required]
string
The name of the Cost and Usage Report.
report_prefix [required]
string
The report prefix used for the Cost and Usage Report.
status [required]
string
The status of the AWS CUR.
status_updated_at
string
The timestamp when the AWS CUR config status was updated.
updated_at
string
The timestamp when the AWS CUR config status was updated.
id
string
The ID of the AWS CUR config.
type [required]
enum
Type of AWS CUR config.
Allowed enum values: aws_cur_config
default: aws_cur_config
{
"data": [
{
"attributes": {
"account_filters": {
"excluded_accounts": [
"123456789123",
"123456789143"
],
"include_new_accounts": true,
"included_accounts": [
"123456789123",
"123456789143"
]
},
"account_id": "123456789123",
"bucket_name": "dd-cost-bucket",
"bucket_region": "us-east-1",
"created_at": "string",
"error_messages": [],
"months": "integer",
"report_name": "dd-report-name",
"report_prefix": "dd-report-prefix",
"status": "active",
"status_updated_at": "string",
"updated_at": "string"
},
"id": "string",
"type": "aws_cur_config"
}
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export cloud_account_id="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/aws_cur_config/${cloud_account_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"is_enabled": true
},
"type": "aws_cur_config_patch_request"
}
}
EOF
// Update Cloud Cost Management AWS CUR config returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.AwsCURConfigPatchRequest{
Data: datadogV2.AwsCURConfigPatchData{
Attributes: datadogV2.AwsCURConfigPatchRequestAttributes{
IsEnabled: datadog.PtrBool(true),
},
Type: datadogV2.AWSCURCONFIGPATCHREQUESTTYPE_AWS_CUR_CONFIG_PATCH_REQUEST,
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.UpdateCostAWSCURConfig(ctx, "100", body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.UpdateCostAWSCURConfig`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.UpdateCostAWSCURConfig`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update Cloud Cost Management AWS CUR config returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.AwsCURConfigPatchData;
import com.datadog.api.client.v2.model.AwsCURConfigPatchRequest;
import com.datadog.api.client.v2.model.AwsCURConfigPatchRequestAttributes;
import com.datadog.api.client.v2.model.AwsCURConfigPatchRequestType;
import com.datadog.api.client.v2.model.AwsCURConfigsResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
AwsCURConfigPatchRequest body =
new AwsCURConfigPatchRequest()
.data(
new AwsCURConfigPatchData()
.attributes(new AwsCURConfigPatchRequestAttributes().isEnabled(true))
.type(AwsCURConfigPatchRequestType.AWS_CUR_CONFIG_PATCH_REQUEST));
try {
AwsCURConfigsResponse result = apiInstance.updateCostAWSCURConfig("100", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#updateCostAWSCURConfig");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Update Cloud Cost Management AWS CUR config returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
from datadog_api_client.v2.model.aws_cur_config_patch_data import AwsCURConfigPatchData
from datadog_api_client.v2.model.aws_cur_config_patch_request import AwsCURConfigPatchRequest
from datadog_api_client.v2.model.aws_cur_config_patch_request_attributes import AwsCURConfigPatchRequestAttributes
from datadog_api_client.v2.model.aws_cur_config_patch_request_type import AwsCURConfigPatchRequestType
body = AwsCURConfigPatchRequest(
data=AwsCURConfigPatchData(
attributes=AwsCURConfigPatchRequestAttributes(
is_enabled=True,
),
type=AwsCURConfigPatchRequestType.AWS_CUR_CONFIG_PATCH_REQUEST,
),
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.update_cost_awscur_config(cloud_account_id="100", body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update Cloud Cost Management AWS CUR config returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
body = DatadogAPIClient::V2::AwsCURConfigPatchRequest.new({
data: DatadogAPIClient::V2::AwsCURConfigPatchData.new({
attributes: DatadogAPIClient::V2::AwsCURConfigPatchRequestAttributes.new({
is_enabled: true,
}),
type: DatadogAPIClient::V2::AwsCURConfigPatchRequestType::AWS_CUR_CONFIG_PATCH_REQUEST,
}),
})
p api_instance.update_cost_awscur_config("100", body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update Cloud Cost Management AWS CUR config returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
use datadog_api_client::datadogV2::model::AwsCURConfigPatchData;
use datadog_api_client::datadogV2::model::AwsCURConfigPatchRequest;
use datadog_api_client::datadogV2::model::AwsCURConfigPatchRequestAttributes;
use datadog_api_client::datadogV2::model::AwsCURConfigPatchRequestType;
#[tokio::main]
async fn main() {
let body = AwsCURConfigPatchRequest::new(AwsCURConfigPatchData::new(
AwsCURConfigPatchRequestAttributes::new().is_enabled(true),
AwsCURConfigPatchRequestType::AWS_CUR_CONFIG_PATCH_REQUEST,
));
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.update_cost_awscur_config("100".to_string(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Update Cloud Cost Management AWS CUR config returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiUpdateCostAWSCURConfigRequest = {
body: {
data: {
attributes: {
isEnabled: true,
},
type: "aws_cur_config_patch_request",
},
},
cloudAccountId: "100",
};
apiInstance
.updateCostAWSCURConfig(params)
.then((data: v2.AwsCURConfigsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
DELETE https://api.ap1.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.ap2.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.datadoghq.eu/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.ddog-gov.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.us3.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.us5.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}
Archive a Cloud Cost Management Account.
This endpoint requires the cloud_cost_management_write
permission.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
cloud_account_id [required]
integer
Cloud Account id.
No Content
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export cloud_account_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/aws_cur_config/${cloud_account_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Delete Cloud Cost Management AWS CUR config returns "No Content" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
api_instance.delete_cost_awscur_config(
cloud_account_id="100",
)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Delete Cloud Cost Management AWS CUR config returns "No Content" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
api_instance.delete_cost_awscur_config("100")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Delete Cloud Cost Management AWS CUR config returns "No Content" response
package main
import (
"context"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
r, err := api.DeleteCostAWSCURConfig(ctx, "100")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.DeleteCostAWSCURConfig`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Delete Cloud Cost Management AWS CUR config returns "No Content" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
apiInstance.deleteCostAWSCURConfig("100");
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#deleteCostAWSCURConfig");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Delete Cloud Cost Management AWS CUR config returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.delete_cost_awscur_config("100".to_string()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Delete Cloud Cost Management AWS CUR config returns "No Content" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiDeleteCostAWSCURConfigRequest = {
cloudAccountId: "100",
};
apiInstance
.deleteCostAWSCURConfig(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.ap2.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.datadoghq.eu/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.ddog-gov.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.us3.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}https://api.us5.datadoghq.com/api/v2/cost/aws_cur_config/{cloud_account_id}
Get a specific AWS CUR config.
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
이름
유형
설명
cloud_account_id [required]
integer
The unique identifier of the cloud account
OK
The definition of AwsCurConfigResponse
object.
항목
유형
설명
data
object
The definition of AwsCurConfigResponseData
object.
attributes
object
The definition of AwsCurConfigResponseDataAttributes
object.
account_filters
object
The definition of AwsCurConfigResponseDataAttributesAccountFilters
object.
excluded_accounts
[string]
The account_filters
excluded_accounts
.
include_new_accounts
boolean
The account_filters
include_new_accounts
.
included_accounts
[string]
The account_filters
included_accounts
.
account_id
string
The attributes
account_id
.
bucket_name
string
The attributes
bucket_name
.
bucket_region
string
The attributes
bucket_region
.
created_at
string
The attributes
created_at
.
error_messages
[string]
The attributes
error_messages
.
months
int64
The attributes
months
.
report_name
string
The attributes
report_name
.
report_prefix
string
The attributes
report_prefix
.
status
string
The attributes
status
.
status_updated_at
string
The attributes
status_updated_at
.
updated_at
string
The attributes
updated_at
.
id
string
The AwsCurConfigResponseData
id
.
type [required]
enum
AWS CUR config resource type.
Allowed enum values: aws_cur_config
default: aws_cur_config
{
"data": {
"attributes": {
"account_filters": {
"excluded_accounts": [
"123456789124",
"123456789125"
],
"include_new_accounts": true
},
"account_id": "123456789123",
"bucket_name": "dd-cost-bucket",
"bucket_region": "us-east-1",
"created_at": "2023-01-01T12:00:00.000Z",
"error_messages": [],
"months": 36,
"report_name": "dd-report-name",
"report_prefix": "dd-report-prefix",
"status": "active",
"status_updated_at": "2023-01-01T12:00:00.000Z",
"updated_at": "2023-01-01T12:00:00.000Z"
},
"id": "123456789123",
"type": "aws_cur_config"
}
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export cloud_account_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/aws_cur_config/${cloud_account_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
GET https://api.ap1.datadoghq.com/api/v2/cost/azure_uc_confighttps://api.ap2.datadoghq.com/api/v2/cost/azure_uc_confighttps://api.datadoghq.eu/api/v2/cost/azure_uc_confighttps://api.ddog-gov.com/api/v2/cost/azure_uc_confighttps://api.datadoghq.com/api/v2/cost/azure_uc_confighttps://api.us3.datadoghq.com/api/v2/cost/azure_uc_confighttps://api.us5.datadoghq.com/api/v2/cost/azure_uc_config
List the Azure configs.
This endpoint requires the cloud_cost_management_read
permission.
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
OK
List of Azure accounts with configs.
항목
유형
설명
data [required]
[object]
An Azure config pair.
attributes [required]
object
Attributes for Azure config pair.
configs [required]
[object]
An Azure config.
account_id [required]
string
The tenant ID of the Azure account.
client_id [required]
string
The client ID of the Azure account.
created_at
string
The timestamp when the Azure config was created.
dataset_type [required]
string
The dataset type of the Azure config.
error_messages
[string]
The error messages for the Azure config.
export_name [required]
string
The name of the configured Azure Export.
export_path [required]
string
The path where the Azure Export is saved.
id
string
The ID of the Azure config.
months
int32
DEPRECATED: The number of months the report has been backfilled.
scope [required]
string
The scope of your observed subscription.
status [required]
string
The status of the Azure config.
status_updated_at
string
The timestamp when the Azure config status was last updated.
storage_account [required]
string
The name of the storage account where the Azure Export is saved.
storage_container [required]
string
The name of the storage container where the Azure Export is saved.
updated_at
string
The timestamp when the Azure config was last updated.
id
string
The ID of the Azure config pair.
id
string
The ID of Cloud Cost Management account.
type [required]
enum
Type of Azure config pair.
Allowed enum values: azure_uc_configs
default: azure_uc_configs
{
"data": [
{
"attributes": {
"configs": [
{
"account_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"client_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"created_at": "string",
"dataset_type": "actual",
"error_messages": [],
"export_name": "dd-actual-export",
"export_path": "dd-export-path",
"id": "string",
"months": "integer",
"scope": "/subscriptions/1234abcd-1234-abcd-1234-1234abcd1234",
"status": "active",
"status_updated_at": "string",
"storage_account": "dd-storage-account",
"storage_container": "dd-storage-container",
"updated_at": "string"
}
],
"id": "string"
},
"id": "string",
"type": "azure_uc_configs"
}
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/azure_uc_config" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
List Cloud Cost Management Azure configs returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.list_cost_azure_uc_configs()
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# List Cloud Cost Management Azure configs returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
p api_instance.list_cost_azure_uc_configs()
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// List Cloud Cost Management Azure configs returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.ListCostAzureUCConfigs(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.ListCostAzureUCConfigs`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.ListCostAzureUCConfigs`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// List Cloud Cost Management Azure configs returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.AzureUCConfigsResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
AzureUCConfigsResponse result = apiInstance.listCostAzureUCConfigs();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#listCostAzureUCConfigs");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// List Cloud Cost Management Azure configs returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.list_cost_azure_uc_configs().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* List Cloud Cost Management Azure configs returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
apiInstance
.listCostAzureUCConfigs()
.then((data: v2.AzureUCConfigsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
POST https://api.ap1.datadoghq.com/api/v2/cost/azure_uc_confighttps://api.ap2.datadoghq.com/api/v2/cost/azure_uc_confighttps://api.datadoghq.eu/api/v2/cost/azure_uc_confighttps://api.ddog-gov.com/api/v2/cost/azure_uc_confighttps://api.datadoghq.com/api/v2/cost/azure_uc_confighttps://api.us3.datadoghq.com/api/v2/cost/azure_uc_confighttps://api.us5.datadoghq.com/api/v2/cost/azure_uc_config
Create a Cloud Cost Management account for an Azure config.
This endpoint requires the cloud_cost_management_write
permission.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
항목
유형
설명
data [required]
object
Azure config Post data.
attributes
object
Attributes for Azure config Post Request.
account_id [required]
string
The tenant ID of the Azure account.
actual_bill_config [required]
object
Bill config.
export_name [required]
string
The name of the configured Azure Export.
export_path [required]
string
The path where the Azure Export is saved.
storage_account [required]
string
The name of the storage account where the Azure Export is saved.
storage_container [required]
string
The name of the storage container where the Azure Export is saved.
amortized_bill_config [required]
object
Bill config.
export_name [required]
string
The name of the configured Azure Export.
export_path [required]
string
The path where the Azure Export is saved.
storage_account [required]
string
The name of the storage account where the Azure Export is saved.
storage_container [required]
string
The name of the storage container where the Azure Export is saved.
client_id [required]
string
The client ID of the Azure account.
scope [required]
string
The scope of your observed subscription.
type [required]
enum
Type of Azure config Post Request.
Allowed enum values: azure_uc_config_post_request
default: azure_uc_config_post_request
{
"data": {
"attributes": {
"account_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"actual_bill_config": {
"export_name": "dd-actual-export",
"export_path": "dd-export-path",
"storage_account": "dd-storage-account",
"storage_container": "dd-storage-container"
},
"amortized_bill_config": {
"export_name": "dd-actual-export",
"export_path": "dd-export-path",
"storage_account": "dd-storage-account",
"storage_container": "dd-storage-container"
},
"client_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"scope": "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234"
},
"type": "azure_uc_config_post_request"
}
}
OK
Response of Azure config pair.
항목
유형
설명
data
object
Azure config pair.
attributes [required]
object
Attributes for Azure config pair.
configs [required]
[object]
An Azure config.
account_id [required]
string
The tenant ID of the Azure account.
client_id [required]
string
The client ID of the Azure account.
created_at
string
The timestamp when the Azure config was created.
dataset_type [required]
string
The dataset type of the Azure config.
error_messages
[string]
The error messages for the Azure config.
export_name [required]
string
The name of the configured Azure Export.
export_path [required]
string
The path where the Azure Export is saved.
id
string
The ID of the Azure config.
months
int32
DEPRECATED: The number of months the report has been backfilled.
scope [required]
string
The scope of your observed subscription.
status [required]
string
The status of the Azure config.
status_updated_at
string
The timestamp when the Azure config status was last updated.
storage_account [required]
string
The name of the storage account where the Azure Export is saved.
storage_container [required]
string
The name of the storage container where the Azure Export is saved.
updated_at
string
The timestamp when the Azure config was last updated.
id
string
The ID of the Azure config pair.
id
string
The ID of Cloud Cost Management account.
type [required]
enum
Type of Azure config pair.
Allowed enum values: azure_uc_configs
default: azure_uc_configs
{
"data": {
"attributes": {
"configs": [
{
"account_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"client_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"created_at": "string",
"dataset_type": "actual",
"error_messages": [],
"export_name": "dd-actual-export",
"export_path": "dd-export-path",
"id": "string",
"months": "integer",
"scope": "/subscriptions/1234abcd-1234-abcd-1234-1234abcd1234",
"status": "active",
"status_updated_at": "string",
"storage_account": "dd-storage-account",
"storage_container": "dd-storage-container",
"updated_at": "string"
}
],
"id": "string"
},
"id": "string",
"type": "azure_uc_configs"
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/azure_uc_config" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"account_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"actual_bill_config": {
"export_name": "dd-actual-export",
"export_path": "dd-export-path",
"storage_account": "dd-storage-account",
"storage_container": "dd-storage-container"
},
"amortized_bill_config": {
"export_name": "dd-actual-export",
"export_path": "dd-export-path",
"storage_account": "dd-storage-account",
"storage_container": "dd-storage-container"
},
"client_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"scope": "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234"
},
"type": "azure_uc_config_post_request"
}
}
EOF
// Create Cloud Cost Management Azure configs returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.AzureUCConfigPostRequest{
Data: datadogV2.AzureUCConfigPostData{
Attributes: datadogV2.AzureUCConfigPostRequestAttributes{
AccountId: "1234abcd-1234-abcd-1234-1234abcd1234",
ActualBillConfig: datadogV2.BillConfig{
ExportName: "dd-actual-export",
ExportPath: "dd-export-path",
StorageAccount: "dd-storage-account",
StorageContainer: "dd-storage-container",
},
AmortizedBillConfig: datadogV2.BillConfig{
ExportName: "dd-actual-export",
ExportPath: "dd-export-path",
StorageAccount: "dd-storage-account",
StorageContainer: "dd-storage-container",
},
ClientId: "1234abcd-1234-abcd-1234-1234abcd1234",
IsEnabled: datadog.PtrBool(true),
Scope: "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234",
},
Type: datadogV2.AZUREUCCONFIGPOSTREQUESTTYPE_AZURE_UC_CONFIG_POST_REQUEST,
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.CreateCostAzureUCConfigs(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.CreateCostAzureUCConfigs`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.CreateCostAzureUCConfigs`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Create Cloud Cost Management Azure configs returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.AzureUCConfigPairsResponse;
import com.datadog.api.client.v2.model.AzureUCConfigPostData;
import com.datadog.api.client.v2.model.AzureUCConfigPostRequest;
import com.datadog.api.client.v2.model.AzureUCConfigPostRequestAttributes;
import com.datadog.api.client.v2.model.AzureUCConfigPostRequestType;
import com.datadog.api.client.v2.model.BillConfig;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
AzureUCConfigPostRequest body =
new AzureUCConfigPostRequest()
.data(
new AzureUCConfigPostData()
.attributes(
new AzureUCConfigPostRequestAttributes()
.accountId("1234abcd-1234-abcd-1234-1234abcd1234")
.actualBillConfig(
new BillConfig()
.exportName("dd-actual-export")
.exportPath("dd-export-path")
.storageAccount("dd-storage-account")
.storageContainer("dd-storage-container"))
.amortizedBillConfig(
new BillConfig()
.exportName("dd-actual-export")
.exportPath("dd-export-path")
.storageAccount("dd-storage-account")
.storageContainer("dd-storage-container"))
.clientId("1234abcd-1234-abcd-1234-1234abcd1234")
.isEnabled(true)
.scope("subscriptions/1234abcd-1234-abcd-1234-1234abcd1234"))
.type(AzureUCConfigPostRequestType.AZURE_UC_CONFIG_POST_REQUEST));
try {
AzureUCConfigPairsResponse result = apiInstance.createCostAzureUCConfigs(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#createCostAzureUCConfigs");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Create Cloud Cost Management Azure configs returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
from datadog_api_client.v2.model.azure_uc_config_post_data import AzureUCConfigPostData
from datadog_api_client.v2.model.azure_uc_config_post_request import AzureUCConfigPostRequest
from datadog_api_client.v2.model.azure_uc_config_post_request_attributes import AzureUCConfigPostRequestAttributes
from datadog_api_client.v2.model.azure_uc_config_post_request_type import AzureUCConfigPostRequestType
from datadog_api_client.v2.model.bill_config import BillConfig
body = AzureUCConfigPostRequest(
data=AzureUCConfigPostData(
attributes=AzureUCConfigPostRequestAttributes(
account_id="1234abcd-1234-abcd-1234-1234abcd1234",
actual_bill_config=BillConfig(
export_name="dd-actual-export",
export_path="dd-export-path",
storage_account="dd-storage-account",
storage_container="dd-storage-container",
),
amortized_bill_config=BillConfig(
export_name="dd-actual-export",
export_path="dd-export-path",
storage_account="dd-storage-account",
storage_container="dd-storage-container",
),
client_id="1234abcd-1234-abcd-1234-1234abcd1234",
is_enabled=True,
scope="subscriptions/1234abcd-1234-abcd-1234-1234abcd1234",
),
type=AzureUCConfigPostRequestType.AZURE_UC_CONFIG_POST_REQUEST,
),
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.create_cost_azure_uc_configs(body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Create Cloud Cost Management Azure configs returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
body = DatadogAPIClient::V2::AzureUCConfigPostRequest.new({
data: DatadogAPIClient::V2::AzureUCConfigPostData.new({
attributes: DatadogAPIClient::V2::AzureUCConfigPostRequestAttributes.new({
account_id: "1234abcd-1234-abcd-1234-1234abcd1234",
actual_bill_config: DatadogAPIClient::V2::BillConfig.new({
export_name: "dd-actual-export",
export_path: "dd-export-path",
storage_account: "dd-storage-account",
storage_container: "dd-storage-container",
}),
amortized_bill_config: DatadogAPIClient::V2::BillConfig.new({
export_name: "dd-actual-export",
export_path: "dd-export-path",
storage_account: "dd-storage-account",
storage_container: "dd-storage-container",
}),
client_id: "1234abcd-1234-abcd-1234-1234abcd1234",
is_enabled: true,
scope: "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234",
}),
type: DatadogAPIClient::V2::AzureUCConfigPostRequestType::AZURE_UC_CONFIG_POST_REQUEST,
}),
})
p api_instance.create_cost_azure_uc_configs(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Create Cloud Cost Management Azure configs returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
use datadog_api_client::datadogV2::model::AzureUCConfigPostData;
use datadog_api_client::datadogV2::model::AzureUCConfigPostRequest;
use datadog_api_client::datadogV2::model::AzureUCConfigPostRequestAttributes;
use datadog_api_client::datadogV2::model::AzureUCConfigPostRequestType;
use datadog_api_client::datadogV2::model::BillConfig;
#[tokio::main]
async fn main() {
let body = AzureUCConfigPostRequest::new(AzureUCConfigPostData::new(
AzureUCConfigPostRequestAttributes::new(
"1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
BillConfig::new(
"dd-actual-export".to_string(),
"dd-export-path".to_string(),
"dd-storage-account".to_string(),
"dd-storage-container".to_string(),
),
BillConfig::new(
"dd-actual-export".to_string(),
"dd-export-path".to_string(),
"dd-storage-account".to_string(),
"dd-storage-container".to_string(),
),
"1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
"subscriptions/1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
)
.is_enabled(true),
AzureUCConfigPostRequestType::AZURE_UC_CONFIG_POST_REQUEST,
));
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.create_cost_azure_uc_configs(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Create Cloud Cost Management Azure configs returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiCreateCostAzureUCConfigsRequest = {
body: {
data: {
attributes: {
accountId: "1234abcd-1234-abcd-1234-1234abcd1234",
actualBillConfig: {
exportName: "dd-actual-export",
exportPath: "dd-export-path",
storageAccount: "dd-storage-account",
storageContainer: "dd-storage-container",
},
amortizedBillConfig: {
exportName: "dd-actual-export",
exportPath: "dd-export-path",
storageAccount: "dd-storage-account",
storageContainer: "dd-storage-container",
},
clientId: "1234abcd-1234-abcd-1234-1234abcd1234",
isEnabled: true,
scope: "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234",
},
type: "azure_uc_config_post_request",
},
},
};
apiInstance
.createCostAzureUCConfigs(params)
.then((data: v2.AzureUCConfigPairsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
PATCH https://api.ap1.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.ap2.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.datadoghq.eu/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.ddog-gov.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.us3.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.us5.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}
Update the status of an Azure config (active/archived).
This endpoint requires the cloud_cost_management_write
permission.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
cloud_account_id [required]
integer
Cloud Account id.
항목
유형
설명
data [required]
object
Azure config Patch data.
attributes
object
Attributes for Azure config Patch Request.
is_enabled [required]
boolean
Whether or not the Cloud Cost Management account is enabled.
type [required]
enum
Type of Azure config Patch Request.
Allowed enum values: azure_uc_config_patch_request
default: azure_uc_config_patch_request
{
"data": {
"attributes": {
"is_enabled": true
},
"type": "azure_uc_config_patch_request"
}
}
OK
Response of Azure config pair.
항목
유형
설명
data
object
Azure config pair.
attributes [required]
object
Attributes for Azure config pair.
configs [required]
[object]
An Azure config.
account_id [required]
string
The tenant ID of the Azure account.
client_id [required]
string
The client ID of the Azure account.
created_at
string
The timestamp when the Azure config was created.
dataset_type [required]
string
The dataset type of the Azure config.
error_messages
[string]
The error messages for the Azure config.
export_name [required]
string
The name of the configured Azure Export.
export_path [required]
string
The path where the Azure Export is saved.
id
string
The ID of the Azure config.
months
int32
DEPRECATED: The number of months the report has been backfilled.
scope [required]
string
The scope of your observed subscription.
status [required]
string
The status of the Azure config.
status_updated_at
string
The timestamp when the Azure config status was last updated.
storage_account [required]
string
The name of the storage account where the Azure Export is saved.
storage_container [required]
string
The name of the storage container where the Azure Export is saved.
updated_at
string
The timestamp when the Azure config was last updated.
id
string
The ID of the Azure config pair.
id
string
The ID of Cloud Cost Management account.
type [required]
enum
Type of Azure config pair.
Allowed enum values: azure_uc_configs
default: azure_uc_configs
{
"data": {
"attributes": {
"configs": [
{
"account_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"client_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"created_at": "string",
"dataset_type": "actual",
"error_messages": [],
"export_name": "dd-actual-export",
"export_path": "dd-export-path",
"id": "string",
"months": "integer",
"scope": "/subscriptions/1234abcd-1234-abcd-1234-1234abcd1234",
"status": "active",
"status_updated_at": "string",
"storage_account": "dd-storage-account",
"storage_container": "dd-storage-container",
"updated_at": "string"
}
],
"id": "string"
},
"id": "string",
"type": "azure_uc_configs"
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export cloud_account_id="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/azure_uc_config/${cloud_account_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"is_enabled": true
},
"type": "azure_uc_config_patch_request"
}
}
EOF
// Update Cloud Cost Management Azure config returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.AzureUCConfigPatchRequest{
Data: datadogV2.AzureUCConfigPatchData{
Attributes: datadogV2.AzureUCConfigPatchRequestAttributes{
IsEnabled: true,
},
Type: datadogV2.AZUREUCCONFIGPATCHREQUESTTYPE_AZURE_UC_CONFIG_PATCH_REQUEST,
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.UpdateCostAzureUCConfigs(ctx, "100", body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.UpdateCostAzureUCConfigs`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.UpdateCostAzureUCConfigs`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update Cloud Cost Management Azure config returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.AzureUCConfigPairsResponse;
import com.datadog.api.client.v2.model.AzureUCConfigPatchData;
import com.datadog.api.client.v2.model.AzureUCConfigPatchRequest;
import com.datadog.api.client.v2.model.AzureUCConfigPatchRequestAttributes;
import com.datadog.api.client.v2.model.AzureUCConfigPatchRequestType;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
AzureUCConfigPatchRequest body =
new AzureUCConfigPatchRequest()
.data(
new AzureUCConfigPatchData()
.attributes(new AzureUCConfigPatchRequestAttributes().isEnabled(true))
.type(AzureUCConfigPatchRequestType.AZURE_UC_CONFIG_PATCH_REQUEST));
try {
AzureUCConfigPairsResponse result = apiInstance.updateCostAzureUCConfigs("100", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#updateCostAzureUCConfigs");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Update Cloud Cost Management Azure config returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
from datadog_api_client.v2.model.azure_uc_config_patch_data import AzureUCConfigPatchData
from datadog_api_client.v2.model.azure_uc_config_patch_request import AzureUCConfigPatchRequest
from datadog_api_client.v2.model.azure_uc_config_patch_request_attributes import AzureUCConfigPatchRequestAttributes
from datadog_api_client.v2.model.azure_uc_config_patch_request_type import AzureUCConfigPatchRequestType
body = AzureUCConfigPatchRequest(
data=AzureUCConfigPatchData(
attributes=AzureUCConfigPatchRequestAttributes(
is_enabled=True,
),
type=AzureUCConfigPatchRequestType.AZURE_UC_CONFIG_PATCH_REQUEST,
),
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.update_cost_azure_uc_configs(cloud_account_id="100", body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update Cloud Cost Management Azure config returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
body = DatadogAPIClient::V2::AzureUCConfigPatchRequest.new({
data: DatadogAPIClient::V2::AzureUCConfigPatchData.new({
attributes: DatadogAPIClient::V2::AzureUCConfigPatchRequestAttributes.new({
is_enabled: true,
}),
type: DatadogAPIClient::V2::AzureUCConfigPatchRequestType::AZURE_UC_CONFIG_PATCH_REQUEST,
}),
})
p api_instance.update_cost_azure_uc_configs("100", body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update Cloud Cost Management Azure config returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
use datadog_api_client::datadogV2::model::AzureUCConfigPatchData;
use datadog_api_client::datadogV2::model::AzureUCConfigPatchRequest;
use datadog_api_client::datadogV2::model::AzureUCConfigPatchRequestAttributes;
use datadog_api_client::datadogV2::model::AzureUCConfigPatchRequestType;
#[tokio::main]
async fn main() {
let body = AzureUCConfigPatchRequest::new(AzureUCConfigPatchData::new(
AzureUCConfigPatchRequestAttributes::new(true),
AzureUCConfigPatchRequestType::AZURE_UC_CONFIG_PATCH_REQUEST,
));
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api
.update_cost_azure_uc_configs("100".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Update Cloud Cost Management Azure config returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiUpdateCostAzureUCConfigsRequest = {
body: {
data: {
attributes: {
isEnabled: true,
},
type: "azure_uc_config_patch_request",
},
},
cloudAccountId: "100",
};
apiInstance
.updateCostAzureUCConfigs(params)
.then((data: v2.AzureUCConfigPairsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
DELETE https://api.ap1.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.ap2.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.datadoghq.eu/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.ddog-gov.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.us3.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.us5.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}
Archive a Cloud Cost Management Account.
This endpoint requires the cloud_cost_management_write
permission.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
cloud_account_id [required]
integer
Cloud Account id.
No Content
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export cloud_account_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/azure_uc_config/${cloud_account_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Delete Cloud Cost Management Azure config returns "No Content" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
api_instance.delete_cost_azure_uc_config(
cloud_account_id="100",
)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Delete Cloud Cost Management Azure config returns "No Content" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
api_instance.delete_cost_azure_uc_config("100")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Delete Cloud Cost Management Azure config returns "No Content" response
package main
import (
"context"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
r, err := api.DeleteCostAzureUCConfig(ctx, "100")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.DeleteCostAzureUCConfig`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Delete Cloud Cost Management Azure config returns "No Content" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
apiInstance.deleteCostAzureUCConfig("100");
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#deleteCostAzureUCConfig");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Delete Cloud Cost Management Azure config returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.delete_cost_azure_uc_config("100".to_string()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Delete Cloud Cost Management Azure config returns "No Content" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiDeleteCostAzureUCConfigRequest = {
cloudAccountId: "100",
};
apiInstance
.deleteCostAzureUCConfig(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.ap2.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.datadoghq.eu/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.ddog-gov.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.us3.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}https://api.us5.datadoghq.com/api/v2/cost/azure_uc_config/{cloud_account_id}
Get a specific Azure config.
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
이름
유형
설명
cloud_account_id [required]
integer
The unique identifier of the cloud account
OK
The definition of UCConfigPair
object.
항목
유형
설명
data
object
The definition of UCConfigPairData
object.
attributes
object
The definition of UCConfigPairDataAttributes
object.
configs
[object]
The attributes
configs
.
account_id
string
The items
account_id
.
client_id
string
The items
client_id
.
created_at
string
The items
created_at
.
dataset_type
string
The items
dataset_type
.
error_messages
[string]
The items
error_messages
.
export_name
string
The items
export_name
.
export_path
string
The items
export_path
.
id
string
The items
id
.
months
int64
The items
months
.
scope
string
The items
scope
.
status
string
The items
status
.
status_updated_at
string
The items
status_updated_at
.
storage_account
string
The items
storage_account
.
storage_container
string
The items
storage_container
.
updated_at
string
The items
updated_at
.
id
string
The UCConfigPairData
id
.
type [required]
enum
Azure UC configs resource type.
Allowed enum values: azure_uc_configs
default: azure_uc_configs
{
"data": {
"attributes": {
"configs": [
{
"account_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"client_id": "1234abcd-1234-abcd-1234-1234abcd1234",
"created_at": "2023-01-01T12:00:00.000Z",
"dataset_type": "actual",
"error_messages": [],
"export_name": "dd-actual-export",
"export_path": "dd-export-path",
"id": "123456789123",
"months": 36,
"scope": "/subscriptions/1234abcd-1234-abcd-1234-1234abcd1234",
"status": "active",
"status_updated_at": "2023-01-01T12:00:00.000Z",
"storage_account": "dd-storage-account",
"storage_container": "dd-storage-container",
"updated_at": "2023-01-01T12:00:00.000Z"
}
]
},
"id": "123456789123",
"type": "azure_uc_configs"
}
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export cloud_account_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/azure_uc_config/${cloud_account_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
GET https://api.ap1.datadoghq.com/api/v2/cost/gcp_uc_confighttps://api.ap2.datadoghq.com/api/v2/cost/gcp_uc_confighttps://api.datadoghq.eu/api/v2/cost/gcp_uc_confighttps://api.ddog-gov.com/api/v2/cost/gcp_uc_confighttps://api.datadoghq.com/api/v2/cost/gcp_uc_confighttps://api.us3.datadoghq.com/api/v2/cost/gcp_uc_confighttps://api.us5.datadoghq.com/api/v2/cost/gcp_uc_config
List the Google Cloud Usage Cost configs.
This endpoint requires the cloud_cost_management_read
permission.
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
OK
List of Google Cloud Usage Cost configs.
항목
유형
설명
data [required]
[object]
A Google Cloud Usage Cost config.
attributes [required]
object
Attributes for a Google Cloud Usage Cost config.
account_id [required]
string
The Google Cloud account ID.
bucket_name [required]
string
The Google Cloud bucket name used to store the Usage Cost export.
created_at
string
The timestamp when the Google Cloud Usage Cost config was created.
dataset [required]
string
The export dataset name used for the Google Cloud Usage Cost Report.
error_messages
[string]
The error messages for the Google Cloud Usage Cost config.
export_prefix [required]
string
The export prefix used for the Google Cloud Usage Cost Report.
export_project_name [required]
string
The name of the Google Cloud Usage Cost Report.
months
int32
DEPRECATED: The number of months the report has been backfilled.
project_id
string
The project_id
of the Google Cloud Usage Cost report.
service_account [required]
string
The unique Google Cloud service account email.
status [required]
string
The status of the Google Cloud Usage Cost config.
status_updated_at
string
The timestamp when the Google Cloud Usage Cost config status was updated.
updated_at
string
The timestamp when the Google Cloud Usage Cost config status was updated.
id
string
The ID of the Google Cloud Usage Cost config.
type [required]
enum
Type of Google Cloud Usage Cost config.
Allowed enum values: gcp_uc_config
default: gcp_uc_config
{
"data": [
{
"attributes": {
"account_id": "123456_A123BC_12AB34",
"bucket_name": "dd-cost-bucket",
"created_at": "string",
"dataset": "billing",
"error_messages": [],
"export_prefix": "datadog_cloud_cost_usage_export",
"export_project_name": "dd-cloud-cost-report",
"months": "integer",
"project_id": "my-project-123",
"service_account": "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com",
"status": "active",
"status_updated_at": "string",
"updated_at": "string"
},
"id": "string",
"type": "gcp_uc_config"
}
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/gcp_uc_config" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
List Cloud Cost Management GCP Usage Cost configs returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.list_cost_gcp_usage_cost_configs()
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# List Cloud Cost Management GCP Usage Cost configs returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
p api_instance.list_cost_gcp_usage_cost_configs()
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// List Cloud Cost Management GCP Usage Cost configs returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.ListCostGCPUsageCostConfigs(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.ListCostGCPUsageCostConfigs`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.ListCostGCPUsageCostConfigs`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// List Cloud Cost Management GCP Usage Cost configs returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.GCPUsageCostConfigsResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
GCPUsageCostConfigsResponse result = apiInstance.listCostGCPUsageCostConfigs();
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling CloudCostManagementApi#listCostGCPUsageCostConfigs");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// List Cloud Cost Management GCP Usage Cost configs returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.list_cost_gcp_usage_cost_configs().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* List Cloud Cost Management GCP Usage Cost configs returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
apiInstance
.listCostGCPUsageCostConfigs()
.then((data: v2.GCPUsageCostConfigsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
POST https://api.ap1.datadoghq.com/api/v2/cost/gcp_uc_confighttps://api.ap2.datadoghq.com/api/v2/cost/gcp_uc_confighttps://api.datadoghq.eu/api/v2/cost/gcp_uc_confighttps://api.ddog-gov.com/api/v2/cost/gcp_uc_confighttps://api.datadoghq.com/api/v2/cost/gcp_uc_confighttps://api.us3.datadoghq.com/api/v2/cost/gcp_uc_confighttps://api.us5.datadoghq.com/api/v2/cost/gcp_uc_config
Create a Cloud Cost Management account for an Google Cloud Usage Cost config.
This endpoint requires the cloud_cost_management_write
permission.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
항목
유형
설명
data [required]
object
Google Cloud Usage Cost config post data.
attributes
object
Attributes for Google Cloud Usage Cost config post request.
billing_account_id [required]
string
The Google Cloud account ID.
bucket_name [required]
string
The Google Cloud bucket name used to store the Usage Cost export.
export_dataset_name [required]
string
The export dataset name used for the Google Cloud Usage Cost report.
export_prefix
string
The export prefix used for the Google Cloud Usage Cost report.
export_project_name [required]
string
The name of the Google Cloud Usage Cost report.
service_account [required]
string
The unique Google Cloud service account email.
type [required]
enum
Type of Google Cloud Usage Cost config post request.
Allowed enum values: gcp_uc_config_post_request
default: gcp_uc_config_post_request
{
"data": {
"attributes": {
"billing_account_id": "123456_A123BC_12AB34",
"bucket_name": "dd-cost-bucket",
"export_dataset_name": "billing",
"export_prefix": "datadog_cloud_cost_usage_export",
"export_project_name": "dd-cloud-cost-report",
"service_account": "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com"
},
"type": "gcp_uc_config_post_request"
}
}
OK
Response of Google Cloud Usage Cost config.
항목
유형
설명
data
object
Google Cloud Usage Cost config.
attributes [required]
object
Attributes for a Google Cloud Usage Cost config.
account_id [required]
string
The Google Cloud account ID.
bucket_name [required]
string
The Google Cloud bucket name used to store the Usage Cost export.
created_at
string
The timestamp when the Google Cloud Usage Cost config was created.
dataset [required]
string
The export dataset name used for the Google Cloud Usage Cost Report.
error_messages
[string]
The error messages for the Google Cloud Usage Cost config.
export_prefix [required]
string
The export prefix used for the Google Cloud Usage Cost Report.
export_project_name [required]
string
The name of the Google Cloud Usage Cost Report.
months
int32
DEPRECATED: The number of months the report has been backfilled.
project_id
string
The project_id
of the Google Cloud Usage Cost report.
service_account [required]
string
The unique Google Cloud service account email.
status [required]
string
The status of the Google Cloud Usage Cost config.
status_updated_at
string
The timestamp when the Google Cloud Usage Cost config status was updated.
updated_at
string
The timestamp when the Google Cloud Usage Cost config status was updated.
id
string
The ID of the Google Cloud Usage Cost config.
type [required]
enum
Type of Google Cloud Usage Cost config.
Allowed enum values: gcp_uc_config
default: gcp_uc_config
{
"data": {
"attributes": {
"account_id": "123456_A123BC_12AB34",
"bucket_name": "dd-cost-bucket",
"created_at": "string",
"dataset": "billing",
"error_messages": [],
"export_prefix": "datadog_cloud_cost_usage_export",
"export_project_name": "dd-cloud-cost-report",
"months": "integer",
"project_id": "my-project-123",
"service_account": "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com",
"status": "active",
"status_updated_at": "string",
"updated_at": "string"
},
"id": "string",
"type": "gcp_uc_config"
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/gcp_uc_config" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"billing_account_id": "123456_A123BC_12AB34",
"bucket_name": "dd-cost-bucket",
"export_dataset_name": "billing",
"export_prefix": "datadog_cloud_cost_usage_export",
"export_project_name": "dd-cloud-cost-report",
"service_account": "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com"
},
"type": "gcp_uc_config_post_request"
}
}
EOF
// Create Cloud Cost Management GCP Usage Cost config returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.GCPUsageCostConfigPostRequest{
Data: datadogV2.GCPUsageCostConfigPostData{
Attributes: datadogV2.GCPUsageCostConfigPostRequestAttributes{
BillingAccountId: "123456_A123BC_12AB34",
BucketName: "dd-cost-bucket",
ExportDatasetName: "billing",
ExportPrefix: datadog.PtrString("datadog_cloud_cost_usage_export"),
ExportProjectName: "dd-cloud-cost-report",
ServiceAccount: "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com",
},
Type: datadogV2.GCPUSAGECOSTCONFIGPOSTREQUESTTYPE_GCP_USAGE_COST_CONFIG_POST_REQUEST,
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.CreateCostGCPUsageCostConfig(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.CreateCostGCPUsageCostConfig`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.CreateCostGCPUsageCostConfig`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Create Cloud Cost Management GCP Usage Cost config returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.GCPUsageCostConfigPostData;
import com.datadog.api.client.v2.model.GCPUsageCostConfigPostRequest;
import com.datadog.api.client.v2.model.GCPUsageCostConfigPostRequestAttributes;
import com.datadog.api.client.v2.model.GCPUsageCostConfigPostRequestType;
import com.datadog.api.client.v2.model.GCPUsageCostConfigResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
GCPUsageCostConfigPostRequest body =
new GCPUsageCostConfigPostRequest()
.data(
new GCPUsageCostConfigPostData()
.attributes(
new GCPUsageCostConfigPostRequestAttributes()
.billingAccountId("123456_A123BC_12AB34")
.bucketName("dd-cost-bucket")
.exportDatasetName("billing")
.exportPrefix("datadog_cloud_cost_usage_export")
.exportProjectName("dd-cloud-cost-report")
.serviceAccount(
"dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com"))
.type(GCPUsageCostConfigPostRequestType.GCP_USAGE_COST_CONFIG_POST_REQUEST));
try {
GCPUsageCostConfigResponse result = apiInstance.createCostGCPUsageCostConfig(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling CloudCostManagementApi#createCostGCPUsageCostConfig");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Create Cloud Cost Management GCP Usage Cost config returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
from datadog_api_client.v2.model.gcp_usage_cost_config_post_data import GCPUsageCostConfigPostData
from datadog_api_client.v2.model.gcp_usage_cost_config_post_request import GCPUsageCostConfigPostRequest
from datadog_api_client.v2.model.gcp_usage_cost_config_post_request_attributes import (
GCPUsageCostConfigPostRequestAttributes,
)
from datadog_api_client.v2.model.gcp_usage_cost_config_post_request_type import GCPUsageCostConfigPostRequestType
body = GCPUsageCostConfigPostRequest(
data=GCPUsageCostConfigPostData(
attributes=GCPUsageCostConfigPostRequestAttributes(
billing_account_id="123456_A123BC_12AB34",
bucket_name="dd-cost-bucket",
export_dataset_name="billing",
export_prefix="datadog_cloud_cost_usage_export",
export_project_name="dd-cloud-cost-report",
service_account="dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com",
),
type=GCPUsageCostConfigPostRequestType.GCP_USAGE_COST_CONFIG_POST_REQUEST,
),
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.create_cost_gcp_usage_cost_config(body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Create Cloud Cost Management GCP Usage Cost config returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
body = DatadogAPIClient::V2::GCPUsageCostConfigPostRequest.new({
data: DatadogAPIClient::V2::GCPUsageCostConfigPostData.new({
attributes: DatadogAPIClient::V2::GCPUsageCostConfigPostRequestAttributes.new({
billing_account_id: "123456_A123BC_12AB34",
bucket_name: "dd-cost-bucket",
export_dataset_name: "billing",
export_prefix: "datadog_cloud_cost_usage_export",
export_project_name: "dd-cloud-cost-report",
service_account: "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com",
}),
type: DatadogAPIClient::V2::GCPUsageCostConfigPostRequestType::GCP_USAGE_COST_CONFIG_POST_REQUEST,
}),
})
p api_instance.create_cost_gcp_usage_cost_config(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Create Cloud Cost Management GCP Usage Cost config returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
use datadog_api_client::datadogV2::model::GCPUsageCostConfigPostData;
use datadog_api_client::datadogV2::model::GCPUsageCostConfigPostRequest;
use datadog_api_client::datadogV2::model::GCPUsageCostConfigPostRequestAttributes;
use datadog_api_client::datadogV2::model::GCPUsageCostConfigPostRequestType;
#[tokio::main]
async fn main() {
let body = GCPUsageCostConfigPostRequest::new(GCPUsageCostConfigPostData::new(
GCPUsageCostConfigPostRequestAttributes::new(
"123456_A123BC_12AB34".to_string(),
"dd-cost-bucket".to_string(),
"billing".to_string(),
"dd-cloud-cost-report".to_string(),
"dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com".to_string(),
)
.export_prefix("datadog_cloud_cost_usage_export".to_string()),
GCPUsageCostConfigPostRequestType::GCP_USAGE_COST_CONFIG_POST_REQUEST,
));
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.create_cost_gcp_usage_cost_config(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Create Cloud Cost Management GCP Usage Cost config returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiCreateCostGCPUsageCostConfigRequest = {
body: {
data: {
attributes: {
billingAccountId: "123456_A123BC_12AB34",
bucketName: "dd-cost-bucket",
exportDatasetName: "billing",
exportPrefix: "datadog_cloud_cost_usage_export",
exportProjectName: "dd-cloud-cost-report",
serviceAccount:
"dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com",
},
type: "gcp_uc_config_post_request",
},
},
};
apiInstance
.createCostGCPUsageCostConfig(params)
.then((data: v2.GCPUsageCostConfigResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
PATCH https://api.ap1.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.ap2.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.datadoghq.eu/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.ddog-gov.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.us3.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.us5.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}
Update the status of an Google Cloud Usage Cost config (active/archived).
This endpoint requires the cloud_cost_management_write
permission.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
cloud_account_id [required]
integer
Cloud Account id.
항목
유형
설명
data [required]
object
Google Cloud Usage Cost config patch data.
attributes [required]
object
Attributes for Google Cloud Usage Cost config patch request.
is_enabled [required]
boolean
Whether or not the Cloud Cost Management account is enabled.
type [required]
enum
Type of Google Cloud Usage Cost config patch request.
Allowed enum values: gcp_uc_config_patch_request
default: gcp_uc_config_patch_request
{
"data": {
"attributes": {
"is_enabled": true
},
"type": "gcp_uc_config_patch_request"
}
}
OK
Response of Google Cloud Usage Cost config.
항목
유형
설명
data
object
Google Cloud Usage Cost config.
attributes [required]
object
Attributes for a Google Cloud Usage Cost config.
account_id [required]
string
The Google Cloud account ID.
bucket_name [required]
string
The Google Cloud bucket name used to store the Usage Cost export.
created_at
string
The timestamp when the Google Cloud Usage Cost config was created.
dataset [required]
string
The export dataset name used for the Google Cloud Usage Cost Report.
error_messages
[string]
The error messages for the Google Cloud Usage Cost config.
export_prefix [required]
string
The export prefix used for the Google Cloud Usage Cost Report.
export_project_name [required]
string
The name of the Google Cloud Usage Cost Report.
months
int32
DEPRECATED: The number of months the report has been backfilled.
project_id
string
The project_id
of the Google Cloud Usage Cost report.
service_account [required]
string
The unique Google Cloud service account email.
status [required]
string
The status of the Google Cloud Usage Cost config.
status_updated_at
string
The timestamp when the Google Cloud Usage Cost config status was updated.
updated_at
string
The timestamp when the Google Cloud Usage Cost config status was updated.
id
string
The ID of the Google Cloud Usage Cost config.
type [required]
enum
Type of Google Cloud Usage Cost config.
Allowed enum values: gcp_uc_config
default: gcp_uc_config
{
"data": {
"attributes": {
"account_id": "123456_A123BC_12AB34",
"bucket_name": "dd-cost-bucket",
"created_at": "string",
"dataset": "billing",
"error_messages": [],
"export_prefix": "datadog_cloud_cost_usage_export",
"export_project_name": "dd-cloud-cost-report",
"months": "integer",
"project_id": "my-project-123",
"service_account": "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com",
"status": "active",
"status_updated_at": "string",
"updated_at": "string"
},
"id": "string",
"type": "gcp_uc_config"
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export cloud_account_id="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/gcp_uc_config/${cloud_account_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"is_enabled": true
},
"type": "gcp_uc_config_patch_request"
}
}
EOF
// Update Cloud Cost Management GCP Usage Cost config returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.GCPUsageCostConfigPatchRequest{
Data: datadogV2.GCPUsageCostConfigPatchData{
Attributes: datadogV2.GCPUsageCostConfigPatchRequestAttributes{
IsEnabled: true,
},
Type: datadogV2.GCPUSAGECOSTCONFIGPATCHREQUESTTYPE_GCP_USAGE_COST_CONFIG_PATCH_REQUEST,
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.UpdateCostGCPUsageCostConfig(ctx, "100", body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.UpdateCostGCPUsageCostConfig`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.UpdateCostGCPUsageCostConfig`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Update Cloud Cost Management GCP Usage Cost config returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.GCPUsageCostConfigPatchData;
import com.datadog.api.client.v2.model.GCPUsageCostConfigPatchRequest;
import com.datadog.api.client.v2.model.GCPUsageCostConfigPatchRequestAttributes;
import com.datadog.api.client.v2.model.GCPUsageCostConfigPatchRequestType;
import com.datadog.api.client.v2.model.GCPUsageCostConfigResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
GCPUsageCostConfigPatchRequest body =
new GCPUsageCostConfigPatchRequest()
.data(
new GCPUsageCostConfigPatchData()
.attributes(new GCPUsageCostConfigPatchRequestAttributes().isEnabled(true))
.type(GCPUsageCostConfigPatchRequestType.GCP_USAGE_COST_CONFIG_PATCH_REQUEST));
try {
GCPUsageCostConfigResponse result = apiInstance.updateCostGCPUsageCostConfig("100", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling CloudCostManagementApi#updateCostGCPUsageCostConfig");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Update Cloud Cost Management GCP Usage Cost config returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
from datadog_api_client.v2.model.gcp_usage_cost_config_patch_data import GCPUsageCostConfigPatchData
from datadog_api_client.v2.model.gcp_usage_cost_config_patch_request import GCPUsageCostConfigPatchRequest
from datadog_api_client.v2.model.gcp_usage_cost_config_patch_request_attributes import (
GCPUsageCostConfigPatchRequestAttributes,
)
from datadog_api_client.v2.model.gcp_usage_cost_config_patch_request_type import GCPUsageCostConfigPatchRequestType
body = GCPUsageCostConfigPatchRequest(
data=GCPUsageCostConfigPatchData(
attributes=GCPUsageCostConfigPatchRequestAttributes(
is_enabled=True,
),
type=GCPUsageCostConfigPatchRequestType.GCP_USAGE_COST_CONFIG_PATCH_REQUEST,
),
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.update_cost_gcp_usage_cost_config(cloud_account_id="100", body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Update Cloud Cost Management GCP Usage Cost config returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
body = DatadogAPIClient::V2::GCPUsageCostConfigPatchRequest.new({
data: DatadogAPIClient::V2::GCPUsageCostConfigPatchData.new({
attributes: DatadogAPIClient::V2::GCPUsageCostConfigPatchRequestAttributes.new({
is_enabled: true,
}),
type: DatadogAPIClient::V2::GCPUsageCostConfigPatchRequestType::GCP_USAGE_COST_CONFIG_PATCH_REQUEST,
}),
})
p api_instance.update_cost_gcp_usage_cost_config("100", body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Update Cloud Cost Management GCP Usage Cost config returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
use datadog_api_client::datadogV2::model::GCPUsageCostConfigPatchData;
use datadog_api_client::datadogV2::model::GCPUsageCostConfigPatchRequest;
use datadog_api_client::datadogV2::model::GCPUsageCostConfigPatchRequestAttributes;
use datadog_api_client::datadogV2::model::GCPUsageCostConfigPatchRequestType;
#[tokio::main]
async fn main() {
let body = GCPUsageCostConfigPatchRequest::new(GCPUsageCostConfigPatchData::new(
GCPUsageCostConfigPatchRequestAttributes::new(true),
GCPUsageCostConfigPatchRequestType::GCP_USAGE_COST_CONFIG_PATCH_REQUEST,
));
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api
.update_cost_gcp_usage_cost_config("100".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Update Cloud Cost Management GCP Usage Cost config returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiUpdateCostGCPUsageCostConfigRequest = {
body: {
data: {
attributes: {
isEnabled: true,
},
type: "gcp_uc_config_patch_request",
},
},
cloudAccountId: "100",
};
apiInstance
.updateCostGCPUsageCostConfig(params)
.then((data: v2.GCPUsageCostConfigResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
DELETE https://api.ap1.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.ap2.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.datadoghq.eu/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.ddog-gov.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.us3.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.us5.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}
Archive a Cloud Cost Management account.
This endpoint requires the cloud_cost_management_write
permission.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
cloud_account_id [required]
integer
Cloud Account id.
No Content
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export cloud_account_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/gcp_uc_config/${cloud_account_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Delete Cloud Cost Management GCP Usage Cost config returns "No Content" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
api_instance.delete_cost_gcp_usage_cost_config(
cloud_account_id="100",
)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Delete Cloud Cost Management GCP Usage Cost config returns "No Content" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
api_instance.delete_cost_gcp_usage_cost_config("100")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Delete Cloud Cost Management GCP Usage Cost config returns "No Content" response
package main
import (
"context"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
r, err := api.DeleteCostGCPUsageCostConfig(ctx, "100")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.DeleteCostGCPUsageCostConfig`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Delete Cloud Cost Management GCP Usage Cost config returns "No Content" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
apiInstance.deleteCostGCPUsageCostConfig("100");
} catch (ApiException e) {
System.err.println(
"Exception when calling CloudCostManagementApi#deleteCostGCPUsageCostConfig");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Delete Cloud Cost Management GCP Usage Cost config returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api
.delete_cost_gcp_usage_cost_config("100".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Delete Cloud Cost Management GCP Usage Cost config returns "No Content" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiDeleteCostGCPUsageCostConfigRequest = {
cloudAccountId: "100",
};
apiInstance
.deleteCostGCPUsageCostConfig(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.ap2.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.datadoghq.eu/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.ddog-gov.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.us3.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}https://api.us5.datadoghq.com/api/v2/cost/gcp_uc_config/{cloud_account_id}
Get a specific Google Cloud Usage Cost config.
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
이름
유형
설명
cloud_account_id [required]
integer
The unique identifier of the cloud account
OK
The definition of GcpUcConfigResponse
object.
항목
유형
설명
data
object
The definition of GcpUcConfigResponseData
object.
attributes
object
The definition of GcpUcConfigResponseDataAttributes
object.
account_id
string
The attributes
account_id
.
bucket_name
string
The attributes
bucket_name
.
created_at
string
The attributes
created_at
.
dataset
string
The attributes
dataset
.
error_messages
[string]
The attributes
error_messages
.
export_prefix
string
The attributes
export_prefix
.
export_project_name
string
The attributes
export_project_name
.
months
int64
The attributes
months
.
project_id
string
The attributes
project_id
.
service_account
string
The attributes
service_account
.
status
string
The attributes
status
.
status_updated_at
string
The attributes
status_updated_at
.
updated_at
string
The attributes
updated_at
.
id
string
The GcpUcConfigResponseData
id
.
type [required]
enum
Google Cloud Usage Cost config resource type.
Allowed enum values: gcp_uc_config
default: gcp_uc_config
{
"data": {
"attributes": {
"account_id": "123456_A123BC_12AB34",
"bucket_name": "dd-cost-bucket",
"created_at": "2023-01-01T12:00:00.000Z",
"dataset": "billing",
"error_messages": [],
"export_prefix": "datadog_cloud_cost_usage_export",
"export_project_name": "dd-cloud-cost-report",
"months": 36,
"project_id": "my-project-123",
"service_account": "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com",
"status": "active",
"status_updated_at": "2023-01-01T12:00:00.000Z",
"updated_at": "2023-01-01T12:00:00.000Z"
},
"id": "123456789123",
"type": "gcp_uc_config"
}
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export cloud_account_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/gcp_uc_config/${cloud_account_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
GET https://api.ap1.datadoghq.com/api/v2/tags/enrichmenthttps://api.ap2.datadoghq.com/api/v2/tags/enrichmenthttps://api.datadoghq.eu/api/v2/tags/enrichmenthttps://api.ddog-gov.com/api/v2/tags/enrichmenthttps://api.datadoghq.com/api/v2/tags/enrichmenthttps://api.us3.datadoghq.com/api/v2/tags/enrichmenthttps://api.us5.datadoghq.com/api/v2/tags/enrichment
List all tag pipeline rulesets - Retrieve a list of all tag pipeline rulesets for the organization
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
OK
The definition of RulesetRespArray
object.
항목
유형
설명
data [required]
[object]
The RulesetRespArray
data
.
attributes
object
The definition of RulesetRespDataAttributes
object.
created [required]
object
The definition of RulesetRespDataAttributesCreated
object.
nanos
int32
The created
nanos
.
seconds
int64
The created
seconds
.
enabled [required]
boolean
The attributes
enabled
.
last_modified_user_uuid [required]
string
The attributes
last_modified_user_uuid
.
modified [required]
object
The definition of RulesetRespDataAttributesModified
object.
nanos
int32
The modified
nanos
.
seconds
int64
The modified
seconds
.
name [required]
string
The attributes
name
.
position [required]
int32
The attributes
position
.
rules [required]
[object]
The attributes
rules
.
enabled [required]
boolean
The items
enabled
.
mapping
object
The definition of RulesetRespDataAttributesRulesItemsMapping
object.
destination_key [required]
string
The mapping
destination_key
.
if_not_exists [required]
boolean
The mapping
if_not_exists
.
source_keys [required]
[string]
The mapping
source_keys
.
metadata
object
The items
metadata
.
<any-key>
string
name [required]
string
The items
name
.
query
object
The definition of RulesetRespDataAttributesRulesItemsQuery
object.
addition [required]
object
The definition of RulesetRespDataAttributesRulesItemsQueryAddition
object.
key [required]
string
The addition
key
.
value [required]
string
The addition
value
.
case_insensitivity
boolean
The query
case_insensitivity
.
if_not_exists [required]
boolean
The query
if_not_exists
.
query [required]
string
The query
query
.
reference_table
object
The definition of RulesetRespDataAttributesRulesItemsReferenceTable
object.
case_insensitivity
boolean
The reference_table
case_insensitivity
.
field_pairs [required]
[object]
The reference_table
field_pairs
.
input_column [required]
string
The items
input_column
.
output_key [required]
string
The items
output_key
.
if_not_exists
boolean
The reference_table
if_not_exists
.
source_keys [required]
[string]
The reference_table
source_keys
.
table_name [required]
string
The reference_table
table_name
.
version [required]
int64
The attributes
version
.
id
string
The RulesetRespData
id
.
type [required]
enum
Ruleset resource type.
Allowed enum values: ruleset
default: ruleset
{
"data": [
{
"attributes": {
"created": {
"nanos": "integer",
"seconds": "integer"
},
"enabled": false,
"last_modified_user_uuid": "",
"modified": {
"nanos": "integer",
"seconds": "integer"
},
"name": "",
"position": 0,
"rules": [
{
"enabled": false,
"mapping": {
"destination_key": "",
"if_not_exists": false,
"source_keys": [
""
]
},
"metadata": {
"<any-key>": "string"
},
"name": "",
"query": {
"addition": {
"key": "",
"value": ""
},
"case_insensitivity": false,
"if_not_exists": false,
"query": ""
},
"reference_table": {
"case_insensitivity": false,
"field_pairs": [
{
"input_column": "",
"output_key": ""
}
],
"if_not_exists": false,
"source_keys": [
""
],
"table_name": ""
}
}
],
"version": 0
},
"id": "string",
"type": "ruleset"
}
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/tags/enrichment" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
POST https://api.ap1.datadoghq.com/api/v2/tags/enrichmenthttps://api.ap2.datadoghq.com/api/v2/tags/enrichmenthttps://api.datadoghq.eu/api/v2/tags/enrichmenthttps://api.ddog-gov.com/api/v2/tags/enrichmenthttps://api.datadoghq.com/api/v2/tags/enrichmenthttps://api.us3.datadoghq.com/api/v2/tags/enrichmenthttps://api.us5.datadoghq.com/api/v2/tags/enrichment
Create a new tag pipeline ruleset with the specified rules and configuration
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
항목
유형
설명
data
object
The definition of CreateRulesetRequestData
object.
attributes
object
The definition of CreateRulesetRequestDataAttributes
object.
enabled
boolean
The attributes
enabled
.
rules [required]
[object]
The attributes
rules
.
enabled [required]
boolean
The items
enabled
.
mapping
object
The definition of CreateRulesetRequestDataAttributesRulesItemsMapping
object.
destination_key [required]
string
The mapping
destination_key
.
if_not_exists [required]
boolean
The mapping
if_not_exists
.
source_keys [required]
[string]
The mapping
source_keys
.
metadata
object
The items
metadata
.
<any-key>
string
name [required]
string
The items
name
.
query
object
The definition of CreateRulesetRequestDataAttributesRulesItemsQuery
object.
addition [required]
object
The definition of CreateRulesetRequestDataAttributesRulesItemsQueryAddition
object.
key [required]
string
The addition
key
.
value [required]
string
The addition
value
.
case_insensitivity
boolean
The query
case_insensitivity
.
if_not_exists [required]
boolean
The query
if_not_exists
.
query [required]
string
The query
query
.
reference_table
object
The definition of CreateRulesetRequestDataAttributesRulesItemsReferenceTable
object.
case_insensitivity
boolean
The reference_table
case_insensitivity
.
field_pairs [required]
[object]
The reference_table
field_pairs
.
input_column [required]
string
The items
input_column
.
output_key [required]
string
The items
output_key
.
if_not_exists
boolean
The reference_table
if_not_exists
.
source_keys [required]
[string]
The reference_table
source_keys
.
table_name [required]
string
The reference_table
table_name
.
id
string
The CreateRulesetRequestData
id
.
type [required]
enum
Create ruleset resource type.
Allowed enum values: create_ruleset
default: create_ruleset
{
"data": {
"attributes": {
"enabled": true,
"rules": [
{
"enabled": true,
"mapping": null,
"name": "Add Cost Center Tag",
"query": {
"addition": {
"key": "cost_center",
"value": "engineering"
},
"case_insensitivity": false,
"if_not_exists": true,
"query": "account_id:\"123456789\" AND service:\"web-api\""
},
"reference_table": null
}
]
},
"id": "New Ruleset",
"type": "create_ruleset"
}
}
OK
The definition of RulesetResp
object.
항목
유형
설명
data
object
The definition of RulesetRespData
object.
attributes
object
The definition of RulesetRespDataAttributes
object.
created [required]
object
The definition of RulesetRespDataAttributesCreated
object.
nanos
int32
The created
nanos
.
seconds
int64
The created
seconds
.
enabled [required]
boolean
The attributes
enabled
.
last_modified_user_uuid [required]
string
The attributes
last_modified_user_uuid
.
modified [required]
object
The definition of RulesetRespDataAttributesModified
object.
nanos
int32
The modified
nanos
.
seconds
int64
The modified
seconds
.
name [required]
string
The attributes
name
.
position [required]
int32
The attributes
position
.
rules [required]
[object]
The attributes
rules
.
enabled [required]
boolean
The items
enabled
.
mapping
object
The definition of RulesetRespDataAttributesRulesItemsMapping
object.
destination_key [required]
string
The mapping
destination_key
.
if_not_exists [required]
boolean
The mapping
if_not_exists
.
source_keys [required]
[string]
The mapping
source_keys
.
metadata
object
The items
metadata
.
<any-key>
string
name [required]
string
The items
name
.
query
object
The definition of RulesetRespDataAttributesRulesItemsQuery
object.
addition [required]
object
The definition of RulesetRespDataAttributesRulesItemsQueryAddition
object.
key [required]
string
The addition
key
.
value [required]
string
The addition
value
.
case_insensitivity
boolean
The query
case_insensitivity
.
if_not_exists [required]
boolean
The query
if_not_exists
.
query [required]
string
The query
query
.
reference_table
object
The definition of RulesetRespDataAttributesRulesItemsReferenceTable
object.
case_insensitivity
boolean
The reference_table
case_insensitivity
.
field_pairs [required]
[object]
The reference_table
field_pairs
.
input_column [required]
string
The items
input_column
.
output_key [required]
string
The items
output_key
.
if_not_exists
boolean
The reference_table
if_not_exists
.
source_keys [required]
[string]
The reference_table
source_keys
.
table_name [required]
string
The reference_table
table_name
.
version [required]
int64
The attributes
version
.
id
string
The RulesetRespData
id
.
type [required]
enum
Ruleset resource type.
Allowed enum values: ruleset
default: ruleset
{
"data": {
"attributes": {
"created": null,
"enabled": true,
"last_modified_user_uuid": "",
"modified": null,
"name": "Example Ruleset",
"position": 0,
"rules": [
{
"enabled": false,
"mapping": null,
"metadata": null,
"name": "RC test rule edited1",
"query": {
"addition": {
"key": "abc",
"value": "ww"
},
"case_insensitivity": false,
"if_not_exists": true,
"query": "billingcurrency:\"USD\" AND account_name:\"SZA96462\" AND billingcurrency:\"USD\""
},
"reference_table": null
},
{
"enabled": true,
"mapping": {
"destination_key": "h",
"if_not_exists": true,
"source_keys": [
"accountname",
"accountownerid"
]
},
"metadata": null,
"name": "rule with empty source key",
"query": null,
"reference_table": null
},
{
"enabled": true,
"mapping": null,
"metadata": null,
"name": "New table rule with new UI",
"query": null,
"reference_table": {
"case_insensitivity": true,
"field_pairs": [
{
"input_column": "status_type",
"output_key": "status"
},
{
"input_column": "status_description",
"output_key": "dess"
}
],
"if_not_exists": false,
"source_keys": [
"http_status",
"status_description"
],
"table_name": "http_status_codes"
}
}
],
"version": 1
},
"id": "12345",
"type": "ruleset"
}
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/tags/enrichment" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": true,
"rules": [
{
"enabled": true,
"mapping": null,
"name": "Add Cost Center Tag",
"query": {
"addition": {
"key": "cost_center",
"value": "engineering"
},
"case_insensitivity": false,
"if_not_exists": true,
"query": "account_id:\"123456789\" AND service:\"web-api\""
},
"reference_table": null
}
]
},
"id": "New Ruleset",
"type": "create_ruleset"
}
}
EOF
PATCH https://api.ap1.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.ap2.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.datadoghq.eu/api/v2/tags/enrichment/{ruleset_id}https://api.ddog-gov.com/api/v2/tags/enrichment/{ruleset_id}https://api.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.us3.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.us5.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}
Update a tag pipeline ruleset - Update an existing tag pipeline ruleset with new rules and configuration
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
ruleset_id [required]
string
The unique identifier of the ruleset
항목
유형
설명
data
object
The definition of UpdateRulesetRequestData
object.
attributes
object
The definition of UpdateRulesetRequestDataAttributes
object.
enabled [required]
boolean
The attributes
enabled
.
last_version
int64
The attributes
last_version
.
rules [required]
[object]
The attributes
rules
.
enabled [required]
boolean
The items
enabled
.
mapping
object
The definition of UpdateRulesetRequestDataAttributesRulesItemsMapping
object.
destination_key [required]
string
The mapping
destination_key
.
if_not_exists [required]
boolean
The mapping
if_not_exists
.
source_keys [required]
[string]
The mapping
source_keys
.
metadata
object
The items
metadata
.
<any-key>
string
name [required]
string
The items
name
.
query
object
The definition of UpdateRulesetRequestDataAttributesRulesItemsQuery
object.
addition [required]
object
The definition of UpdateRulesetRequestDataAttributesRulesItemsQueryAddition
object.
key [required]
string
The addition
key
.
value [required]
string
The addition
value
.
case_insensitivity
boolean
The query
case_insensitivity
.
if_not_exists [required]
boolean
The query
if_not_exists
.
query [required]
string
The query
query
.
reference_table
object
The definition of UpdateRulesetRequestDataAttributesRulesItemsReferenceTable
object.
case_insensitivity
boolean
The reference_table
case_insensitivity
.
field_pairs [required]
[object]
The reference_table
field_pairs
.
input_column [required]
string
The items
input_column
.
output_key [required]
string
The items
output_key
.
if_not_exists
boolean
The reference_table
if_not_exists
.
source_keys [required]
[string]
The reference_table
source_keys
.
table_name [required]
string
The reference_table
table_name
.
id
string
The UpdateRulesetRequestData
id
.
type [required]
enum
Update ruleset resource type.
Allowed enum values: update_ruleset
default: update_ruleset
{
"data": {
"attributes": {
"enabled": true,
"last_version": 3601919,
"rules": [
{
"enabled": true,
"mapping": {
"destination_key": "team_owner",
"if_not_exists": true,
"source_keys": [
"account_name",
"account_id"
]
},
"name": "Account Name Mapping",
"query": null,
"reference_table": null
}
]
},
"type": "update_ruleset"
}
}
OK
The definition of RulesetResp
object.
항목
유형
설명
data
object
The definition of RulesetRespData
object.
attributes
object
The definition of RulesetRespDataAttributes
object.
created [required]
object
The definition of RulesetRespDataAttributesCreated
object.
nanos
int32
The created
nanos
.
seconds
int64
The created
seconds
.
enabled [required]
boolean
The attributes
enabled
.
last_modified_user_uuid [required]
string
The attributes
last_modified_user_uuid
.
modified [required]
object
The definition of RulesetRespDataAttributesModified
object.
nanos
int32
The modified
nanos
.
seconds
int64
The modified
seconds
.
name [required]
string
The attributes
name
.
position [required]
int32
The attributes
position
.
rules [required]
[object]
The attributes
rules
.
enabled [required]
boolean
The items
enabled
.
mapping
object
The definition of RulesetRespDataAttributesRulesItemsMapping
object.
destination_key [required]
string
The mapping
destination_key
.
if_not_exists [required]
boolean
The mapping
if_not_exists
.
source_keys [required]
[string]
The mapping
source_keys
.
metadata
object
The items
metadata
.
<any-key>
string
name [required]
string
The items
name
.
query
object
The definition of RulesetRespDataAttributesRulesItemsQuery
object.
addition [required]
object
The definition of RulesetRespDataAttributesRulesItemsQueryAddition
object.
key [required]
string
The addition
key
.
value [required]
string
The addition
value
.
case_insensitivity
boolean
The query
case_insensitivity
.
if_not_exists [required]
boolean
The query
if_not_exists
.
query [required]
string
The query
query
.
reference_table
object
The definition of RulesetRespDataAttributesRulesItemsReferenceTable
object.
case_insensitivity
boolean
The reference_table
case_insensitivity
.
field_pairs [required]
[object]
The reference_table
field_pairs
.
input_column [required]
string
The items
input_column
.
output_key [required]
string
The items
output_key
.
if_not_exists
boolean
The reference_table
if_not_exists
.
source_keys [required]
[string]
The reference_table
source_keys
.
table_name [required]
string
The reference_table
table_name
.
version [required]
int64
The attributes
version
.
id
string
The RulesetRespData
id
.
type [required]
enum
Ruleset resource type.
Allowed enum values: ruleset
default: ruleset
{
"data": {
"attributes": {
"created": null,
"enabled": true,
"last_modified_user_uuid": "",
"modified": null,
"name": "Example Ruleset",
"position": 0,
"rules": [
{
"enabled": false,
"mapping": null,
"metadata": null,
"name": "RC test rule edited1",
"query": {
"addition": {
"key": "abc",
"value": "ww"
},
"case_insensitivity": false,
"if_not_exists": true,
"query": "billingcurrency:\"USD\" AND account_name:\"SZA96462\" AND billingcurrency:\"USD\""
},
"reference_table": null
},
{
"enabled": true,
"mapping": {
"destination_key": "h",
"if_not_exists": true,
"source_keys": [
"accountname",
"accountownerid"
]
},
"metadata": null,
"name": "rule with empty source key",
"query": null,
"reference_table": null
},
{
"enabled": true,
"mapping": null,
"metadata": null,
"name": "New table rule with new UI",
"query": null,
"reference_table": {
"case_insensitivity": true,
"field_pairs": [
{
"input_column": "status_type",
"output_key": "status"
},
{
"input_column": "status_description",
"output_key": "dess"
}
],
"if_not_exists": false,
"source_keys": [
"http_status",
"status_description"
],
"table_name": "http_status_codes"
}
}
],
"version": 1
},
"id": "12345",
"type": "ruleset"
}
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export ruleset_id="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/tags/enrichment/${ruleset_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": true,
"last_version": 3601919,
"rules": [
{
"enabled": true,
"mapping": {
"destination_key": "team_owner",
"if_not_exists": true,
"source_keys": [
"account_name",
"account_id"
]
},
"name": "Account Name Mapping",
"query": null,
"reference_table": null
}
]
},
"type": "update_ruleset"
}
}
EOF
DELETE https://api.ap1.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.ap2.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.datadoghq.eu/api/v2/tags/enrichment/{ruleset_id}https://api.ddog-gov.com/api/v2/tags/enrichment/{ruleset_id}https://api.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.us3.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.us5.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}
Delete a tag pipeline ruleset - Delete an existing tag pipeline ruleset by its ID
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
ruleset_id [required]
string
The unique identifier of the ruleset
No Content
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export ruleset_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/tags/enrichment/${ruleset_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
GET https://api.ap1.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.ap2.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.datadoghq.eu/api/v2/tags/enrichment/{ruleset_id}https://api.ddog-gov.com/api/v2/tags/enrichment/{ruleset_id}https://api.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.us3.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.us5.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}
Get a specific tag pipeline ruleset - Retrieve a specific tag pipeline ruleset by its ID
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
이름
유형
설명
ruleset_id [required]
string
The unique identifier of the ruleset
OK
The definition of RulesetResp
object.
항목
유형
설명
data
object
The definition of RulesetRespData
object.
attributes
object
The definition of RulesetRespDataAttributes
object.
created [required]
object
The definition of RulesetRespDataAttributesCreated
object.
nanos
int32
The created
nanos
.
seconds
int64
The created
seconds
.
enabled [required]
boolean
The attributes
enabled
.
last_modified_user_uuid [required]
string
The attributes
last_modified_user_uuid
.
modified [required]
object
The definition of RulesetRespDataAttributesModified
object.
nanos
int32
The modified
nanos
.
seconds
int64
The modified
seconds
.
name [required]
string
The attributes
name
.
position [required]
int32
The attributes
position
.
rules [required]
[object]
The attributes
rules
.
enabled [required]
boolean
The items
enabled
.
mapping
object
The definition of RulesetRespDataAttributesRulesItemsMapping
object.
destination_key [required]
string
The mapping
destination_key
.
if_not_exists [required]
boolean
The mapping
if_not_exists
.
source_keys [required]
[string]
The mapping
source_keys
.
metadata
object
The items
metadata
.
<any-key>
string
name [required]
string
The items
name
.
query
object
The definition of RulesetRespDataAttributesRulesItemsQuery
object.
addition [required]
object
The definition of RulesetRespDataAttributesRulesItemsQueryAddition
object.
key [required]
string
The addition
key
.
value [required]
string
The addition
value
.
case_insensitivity
boolean
The query
case_insensitivity
.
if_not_exists [required]
boolean
The query
if_not_exists
.
query [required]
string
The query
query
.
reference_table
object
The definition of RulesetRespDataAttributesRulesItemsReferenceTable
object.
case_insensitivity
boolean
The reference_table
case_insensitivity
.
field_pairs [required]
[object]
The reference_table
field_pairs
.
input_column [required]
string
The items
input_column
.
output_key [required]
string
The items
output_key
.
if_not_exists
boolean
The reference_table
if_not_exists
.
source_keys [required]
[string]
The reference_table
source_keys
.
table_name [required]
string
The reference_table
table_name
.
version [required]
int64
The attributes
version
.
id
string
The RulesetRespData
id
.
type [required]
enum
Ruleset resource type.
Allowed enum values: ruleset
default: ruleset
{
"data": {
"attributes": {
"created": null,
"enabled": true,
"last_modified_user_uuid": "",
"modified": null,
"name": "Example Ruleset",
"position": 0,
"rules": [
{
"enabled": false,
"mapping": null,
"metadata": null,
"name": "RC test rule edited1",
"query": {
"addition": {
"key": "abc",
"value": "ww"
},
"case_insensitivity": false,
"if_not_exists": true,
"query": "billingcurrency:\"USD\" AND account_name:\"SZA96462\" AND billingcurrency:\"USD\""
},
"reference_table": null
},
{
"enabled": true,
"mapping": {
"destination_key": "h",
"if_not_exists": true,
"source_keys": [
"accountname",
"accountownerid"
]
},
"metadata": null,
"name": "rule with empty source key",
"query": null,
"reference_table": null
},
{
"enabled": true,
"mapping": null,
"metadata": null,
"name": "New table rule with new UI",
"query": null,
"reference_table": {
"case_insensitivity": true,
"field_pairs": [
{
"input_column": "status_type",
"output_key": "status"
},
{
"input_column": "status_description",
"output_key": "dess"
}
],
"if_not_exists": false,
"source_keys": [
"http_status",
"status_description"
],
"table_name": "http_status_codes"
}
}
],
"version": 1
},
"id": "12345",
"type": "ruleset"
}
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export ruleset_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/tags/enrichment/${ruleset_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
POST https://api.ap1.datadoghq.com/api/v2/tags/enrichment/reorderhttps://api.ap2.datadoghq.com/api/v2/tags/enrichment/reorderhttps://api.datadoghq.eu/api/v2/tags/enrichment/reorderhttps://api.ddog-gov.com/api/v2/tags/enrichment/reorderhttps://api.datadoghq.com/api/v2/tags/enrichment/reorderhttps://api.us3.datadoghq.com/api/v2/tags/enrichment/reorderhttps://api.us5.datadoghq.com/api/v2/tags/enrichment/reorder
Reorder tag pipeline rulesets - Change the execution order of tag pipeline rulesets
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
항목
유형
설명
data [required]
[object]
The ReorderRulesetResourceArray
data
.
id
string
The ReorderRulesetResourceData
id
.
type [required]
enum
Ruleset resource type.
Allowed enum values: ruleset
default: ruleset
{
"data": [
{
"id": "string",
"type": "ruleset"
}
]
}
Successfully reordered rulesets
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/tags/enrichment/reorder" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": [
{
"type": "ruleset"
}
]
}
EOF
POST https://api.ap1.datadoghq.com/api/v2/tags/enrichment/validate-queryhttps://api.ap2.datadoghq.com/api/v2/tags/enrichment/validate-queryhttps://api.datadoghq.eu/api/v2/tags/enrichment/validate-queryhttps://api.ddog-gov.com/api/v2/tags/enrichment/validate-queryhttps://api.datadoghq.com/api/v2/tags/enrichment/validate-queryhttps://api.us3.datadoghq.com/api/v2/tags/enrichment/validate-queryhttps://api.us5.datadoghq.com/api/v2/tags/enrichment/validate-query
Validate a tag pipeline query - Validate the syntax and structure of a tag pipeline query
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
항목
유형
설명
data
object
The definition of RulesValidateQueryRequestData
object.
attributes
object
The definition of RulesValidateQueryRequestDataAttributes
object.
Query [required]
string
The attributes
Query
.
id
string
The RulesValidateQueryRequestData
id
.
type [required]
enum
Validate query resource type.
Allowed enum values: validate_query
default: validate_query
{
"data": {
"attributes": {
"Query": "example:query AND test:true"
},
"type": "validate_query"
}
}
OK
The definition of RulesValidateQueryResponse
object.
항목
유형
설명
data
object
The definition of RulesValidateQueryResponseData
object.
attributes
object
The definition of RulesValidateQueryResponseDataAttributes
object.
Canonical [required]
string
The attributes
Canonical
.
id
string
The RulesValidateQueryResponseData
id
.
type [required]
enum
Validate response resource type.
Allowed enum values: validate_response
default: validate_response
{
"data": {
"attributes": {
"Canonical": "canonical query representation"
},
"type": "validate_response"
}
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/tags/enrichment/validate-query" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"Query": "example:query AND test:true"
},
"type": "validate_query"
}
}
EOF
GET https://api.ap1.datadoghq.com/api/v2/cost/arbitrary_rulehttps://api.ap2.datadoghq.com/api/v2/cost/arbitrary_rulehttps://api.datadoghq.eu/api/v2/cost/arbitrary_rulehttps://api.ddog-gov.com/api/v2/cost/arbitrary_rulehttps://api.datadoghq.com/api/v2/cost/arbitrary_rulehttps://api.us3.datadoghq.com/api/v2/cost/arbitrary_rulehttps://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule
List all arbitrary cost rules - Retrieve a list of all arbitrary cost rules for the organization
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
OK
The definition of ArbitraryRuleResponseArray
object.
항목
유형
설명
data [required]
[object]
The ArbitraryRuleResponseArray
data
.
attributes
object
The definition of ArbitraryRuleResponseDataAttributes
object.
costs_to_allocate [required]
[object]
The attributes
costs_to_allocate
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
created [required]
date-time
The attributes
created
.
enabled [required]
boolean
The attributes
enabled
.
last_modified_user_uuid [required]
string
The attributes
last_modified_user_uuid
.
order_id [required]
int64
The attributes
order_id
.
provider [required]
[string]
The attributes
provider
.
rejected
boolean
The attributes
rejected
.
rule_name [required]
string
The attributes
rule_name
.
strategy [required]
object
The definition of ArbitraryRuleResponseDataAttributesStrategy
object.
allocated_by
[object]
The strategy
allocated_by
.
allocated_tags [required]
[object]
The items
allocated_tags
.
key [required]
string
The items
key
.
value [required]
string
The items
value
.
percentage [required]
double
The items
percentage
. The numeric value format should be a 32bit float value.
allocated_by_filters
[object]
The strategy
allocated_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
allocated_by_tag_keys
[string]
The strategy
allocated_by_tag_keys
.
based_on_costs
[object]
The strategy
based_on_costs
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
based_on_timeseries
object
The rule strategy
based_on_timeseries
.
evaluate_grouped_by_filters
[object]
The strategy
evaluate_grouped_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
evaluate_grouped_by_tag_keys
[string]
The strategy
evaluate_grouped_by_tag_keys
.
granularity
string
The strategy
granularity
.
method [required]
string
The strategy
method
.
type [required]
string
The attributes
type
.
updated [required]
date-time
The attributes
updated
.
version [required]
int32
The attributes
version
.
id
string
The ArbitraryRuleResponseData
id
.
type [required]
enum
Arbitrary rule resource type.
Allowed enum values: arbitrary_rule
default: arbitrary_rule
{
"data": [
{
"attributes": {
"costs_to_allocate": [
{
"condition": "",
"tag": "",
"value": "string",
"values": []
}
],
"created": "",
"enabled": false,
"last_modified_user_uuid": "",
"order_id": 0,
"provider": [
""
],
"rejected": false,
"rule_name": "",
"strategy": {
"allocated_by": [
{
"allocated_tags": [
{
"key": "",
"value": ""
}
],
"percentage": 0
}
],
"allocated_by_filters": [
{
"condition": "",
"tag": "",
"value": "string",
"values": []
}
],
"allocated_by_tag_keys": [],
"based_on_costs": [
{
"condition": "",
"tag": "",
"value": "string",
"values": []
}
],
"based_on_timeseries": {},
"evaluate_grouped_by_filters": [
{
"condition": "",
"tag": "",
"value": "string",
"values": []
}
],
"evaluate_grouped_by_tag_keys": [],
"granularity": "string",
"method": ""
},
"type": "",
"updated": "",
"version": 0
},
"id": "string",
"type": "arbitrary_rule"
}
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
POST https://api.ap1.datadoghq.com/api/v2/cost/arbitrary_rulehttps://api.ap2.datadoghq.com/api/v2/cost/arbitrary_rulehttps://api.datadoghq.eu/api/v2/cost/arbitrary_rulehttps://api.ddog-gov.com/api/v2/cost/arbitrary_rulehttps://api.datadoghq.com/api/v2/cost/arbitrary_rulehttps://api.us3.datadoghq.com/api/v2/cost/arbitrary_rulehttps://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule
Create a new arbitrary cost rule with the specified filters and allocation strategy.
Strategy Methods:
Filter Conditions:
Supported operators: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
항목
유형
설명
data
object
The definition of ArbitraryCostUpsertRequestData
object.
attributes
object
The definition of ArbitraryCostUpsertRequestDataAttributes
object.
costs_to_allocate [required]
[object]
The attributes
costs_to_allocate
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
enabled
boolean
The attributes
enabled
.
order_id
int64
The attributes
order_id
.
provider [required]
[string]
The attributes
provider
.
rejected
boolean
The attributes
rejected
.
rule_name [required]
string
The attributes
rule_name
.
strategy [required]
object
The definition of ArbitraryCostUpsertRequestDataAttributesStrategy
object.
allocated_by
[object]
The strategy
allocated_by
.
allocated_tags [required]
[object]
The items
allocated_tags
.
key [required]
string
The items
key
.
value [required]
string
The items
value
.
percentage [required]
double
The items
percentage
. The numeric value format should be a 32bit float value.
allocated_by_filters
[object]
The strategy
allocated_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
allocated_by_tag_keys
[string]
The strategy
allocated_by_tag_keys
.
based_on_costs
[object]
The strategy
based_on_costs
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
based_on_timeseries
object
The strategy
based_on_timeseries
.
evaluate_grouped_by_filters
[object]
The strategy
evaluate_grouped_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
evaluate_grouped_by_tag_keys
[string]
The strategy
evaluate_grouped_by_tag_keys
.
granularity
string
The strategy
granularity
.
method [required]
string
The strategy
method
.
type [required]
string
The attributes
type
.
id
string
The ArbitraryCostUpsertRequestData
id
.
type [required]
enum
Upsert arbitrary rule resource type.
Allowed enum values: upsert_arbitrary_rule
default: upsert_arbitrary_rule
{
"data": {
"attributes": {
"costs_to_allocate": [
{
"condition": "is",
"tag": "account_id",
"value": "123456789",
"values": []
},
{
"condition": "in",
"tag": "environment",
"value": "",
"values": [
"production",
"staging"
]
}
],
"enabled": true,
"order_id": 1,
"provider": [
"aws",
"gcp"
],
"rule_name": "example-arbitrary-cost-rule",
"strategy": {
"allocated_by_tag_keys": [
"team",
"environment"
],
"based_on_costs": [
{
"condition": "is",
"tag": "service",
"value": "web-api",
"values": []
},
{
"condition": "not in",
"tag": "team",
"value": "",
"values": [
"legacy",
"deprecated"
]
}
],
"granularity": "daily",
"method": "proportional"
},
"type": "shared"
},
"type": "upsert_arbitrary_rule"
}
}
OK
The definition of ArbitraryRuleResponse
object.
항목
유형
설명
data
object
The definition of ArbitraryRuleResponseData
object.
attributes
object
The definition of ArbitraryRuleResponseDataAttributes
object.
costs_to_allocate [required]
[object]
The attributes
costs_to_allocate
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
created [required]
date-time
The attributes
created
.
enabled [required]
boolean
The attributes
enabled
.
last_modified_user_uuid [required]
string
The attributes
last_modified_user_uuid
.
order_id [required]
int64
The attributes
order_id
.
provider [required]
[string]
The attributes
provider
.
rejected
boolean
The attributes
rejected
.
rule_name [required]
string
The attributes
rule_name
.
strategy [required]
object
The definition of ArbitraryRuleResponseDataAttributesStrategy
object.
allocated_by
[object]
The strategy
allocated_by
.
allocated_tags [required]
[object]
The items
allocated_tags
.
key [required]
string
The items
key
.
value [required]
string
The items
value
.
percentage [required]
double
The items
percentage
. The numeric value format should be a 32bit float value.
allocated_by_filters
[object]
The strategy
allocated_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
allocated_by_tag_keys
[string]
The strategy
allocated_by_tag_keys
.
based_on_costs
[object]
The strategy
based_on_costs
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
based_on_timeseries
object
The rule strategy
based_on_timeseries
.
evaluate_grouped_by_filters
[object]
The strategy
evaluate_grouped_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
evaluate_grouped_by_tag_keys
[string]
The strategy
evaluate_grouped_by_tag_keys
.
granularity
string
The strategy
granularity
.
method [required]
string
The strategy
method
.
type [required]
string
The attributes
type
.
updated [required]
date-time
The attributes
updated
.
version [required]
int32
The attributes
version
.
id
string
The ArbitraryRuleResponseData
id
.
type [required]
enum
Arbitrary rule resource type.
Allowed enum values: arbitrary_rule
default: arbitrary_rule
{
"data": {
"attributes": {
"costs_to_allocate": [
{
"condition": "is",
"tag": "account_id",
"value": "123456789",
"values": null
},
{
"condition": "in",
"tag": "environment",
"value": "",
"values": [
"production",
"staging"
]
}
],
"created": "2023-01-01T12:00:00Z",
"enabled": true,
"last_modified_user_uuid": "user-123-uuid",
"order_id": 1,
"provider": [
"aws",
"gcp"
],
"rule_name": "Example Arbitrary Cost Rule",
"strategy": {
"allocated_by_tag_keys": [
"team",
"environment"
],
"based_on_costs": [
{
"condition": "is",
"tag": "service",
"value": "web-api",
"values": null
},
{
"condition": "not in",
"tag": "team",
"value": "",
"values": [
"legacy",
"deprecated"
]
}
],
"granularity": "daily",
"method": "proportional"
},
"type": "shared",
"updated": "2023-01-01T12:00:00Z",
"version": 1
},
"id": "123",
"type": "arbitrary_rule"
}
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"costs_to_allocate": [
{
"condition": "is",
"tag": "account_id",
"value": "123456789",
"values": []
},
{
"condition": "in",
"tag": "environment",
"value": "",
"values": [
"production",
"staging"
]
}
],
"enabled": true,
"order_id": 1,
"provider": [
"aws",
"gcp"
],
"rule_name": "example-arbitrary-cost-rule",
"strategy": {
"allocated_by_tag_keys": [
"team",
"environment"
],
"based_on_costs": [
{
"condition": "is",
"tag": "service",
"value": "web-api",
"values": []
},
{
"condition": "not in",
"tag": "team",
"value": "",
"values": [
"legacy",
"deprecated"
]
}
],
"granularity": "daily",
"method": "proportional"
},
"type": "shared"
},
"type": "upsert_arbitrary_rule"
}
}
EOF
PATCH https://api.ap1.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.ap2.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.datadoghq.eu/api/v2/cost/arbitrary_rule/{rule_id}https://api.ddog-gov.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.us3.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}
Update an existing arbitrary cost rule with new filters and allocation strategy.
Strategy Methods:
Filter Conditions:
Supported operators: is, is not, is all values, is untagged, contains, does not contain, in, not in, =, !=, like, not like
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
rule_id [required]
integer
The unique identifier of the arbitrary cost rule
항목
유형
설명
data
object
The definition of ArbitraryCostUpsertRequestData
object.
attributes
object
The definition of ArbitraryCostUpsertRequestDataAttributes
object.
costs_to_allocate [required]
[object]
The attributes
costs_to_allocate
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
enabled
boolean
The attributes
enabled
.
order_id
int64
The attributes
order_id
.
provider [required]
[string]
The attributes
provider
.
rejected
boolean
The attributes
rejected
.
rule_name [required]
string
The attributes
rule_name
.
strategy [required]
object
The definition of ArbitraryCostUpsertRequestDataAttributesStrategy
object.
allocated_by
[object]
The strategy
allocated_by
.
allocated_tags [required]
[object]
The items
allocated_tags
.
key [required]
string
The items
key
.
value [required]
string
The items
value
.
percentage [required]
double
The items
percentage
. The numeric value format should be a 32bit float value.
allocated_by_filters
[object]
The strategy
allocated_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
allocated_by_tag_keys
[string]
The strategy
allocated_by_tag_keys
.
based_on_costs
[object]
The strategy
based_on_costs
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
based_on_timeseries
object
The strategy
based_on_timeseries
.
evaluate_grouped_by_filters
[object]
The strategy
evaluate_grouped_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
evaluate_grouped_by_tag_keys
[string]
The strategy
evaluate_grouped_by_tag_keys
.
granularity
string
The strategy
granularity
.
method [required]
string
The strategy
method
.
type [required]
string
The attributes
type
.
id
string
The ArbitraryCostUpsertRequestData
id
.
type [required]
enum
Upsert arbitrary rule resource type.
Allowed enum values: upsert_arbitrary_rule
default: upsert_arbitrary_rule
{
"data": {
"attributes": {
"costs_to_allocate": [
{
"condition": "is",
"tag": "account_id",
"value": "123456789",
"values": []
},
{
"condition": "in",
"tag": "environment",
"value": "",
"values": [
"production",
"staging"
]
}
],
"enabled": true,
"order_id": 1,
"provider": [
"aws",
"gcp"
],
"rule_name": "example-arbitrary-cost-rule",
"strategy": {
"allocated_by_tag_keys": [
"team",
"environment"
],
"based_on_costs": [
{
"condition": "is",
"tag": "service",
"value": "web-api",
"values": []
},
{
"condition": "not in",
"tag": "team",
"value": "",
"values": [
"legacy",
"deprecated"
]
}
],
"granularity": "daily",
"method": "proportional"
},
"type": "shared"
},
"type": "upsert_arbitrary_rule"
}
}
OK
The definition of ArbitraryRuleResponse
object.
항목
유형
설명
data
object
The definition of ArbitraryRuleResponseData
object.
attributes
object
The definition of ArbitraryRuleResponseDataAttributes
object.
costs_to_allocate [required]
[object]
The attributes
costs_to_allocate
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
created [required]
date-time
The attributes
created
.
enabled [required]
boolean
The attributes
enabled
.
last_modified_user_uuid [required]
string
The attributes
last_modified_user_uuid
.
order_id [required]
int64
The attributes
order_id
.
provider [required]
[string]
The attributes
provider
.
rejected
boolean
The attributes
rejected
.
rule_name [required]
string
The attributes
rule_name
.
strategy [required]
object
The definition of ArbitraryRuleResponseDataAttributesStrategy
object.
allocated_by
[object]
The strategy
allocated_by
.
allocated_tags [required]
[object]
The items
allocated_tags
.
key [required]
string
The items
key
.
value [required]
string
The items
value
.
percentage [required]
double
The items
percentage
. The numeric value format should be a 32bit float value.
allocated_by_filters
[object]
The strategy
allocated_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
allocated_by_tag_keys
[string]
The strategy
allocated_by_tag_keys
.
based_on_costs
[object]
The strategy
based_on_costs
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
based_on_timeseries
object
The rule strategy
based_on_timeseries
.
evaluate_grouped_by_filters
[object]
The strategy
evaluate_grouped_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
evaluate_grouped_by_tag_keys
[string]
The strategy
evaluate_grouped_by_tag_keys
.
granularity
string
The strategy
granularity
.
method [required]
string
The strategy
method
.
type [required]
string
The attributes
type
.
updated [required]
date-time
The attributes
updated
.
version [required]
int32
The attributes
version
.
id
string
The ArbitraryRuleResponseData
id
.
type [required]
enum
Arbitrary rule resource type.
Allowed enum values: arbitrary_rule
default: arbitrary_rule
{
"data": {
"attributes": {
"costs_to_allocate": [
{
"condition": "is",
"tag": "account_id",
"value": "123456789",
"values": null
},
{
"condition": "in",
"tag": "environment",
"value": "",
"values": [
"production",
"staging"
]
}
],
"created": "2023-01-01T12:00:00Z",
"enabled": true,
"last_modified_user_uuid": "user-123-uuid",
"order_id": 1,
"provider": [
"aws",
"gcp"
],
"rule_name": "Example Arbitrary Cost Rule",
"strategy": {
"allocated_by_tag_keys": [
"team",
"environment"
],
"based_on_costs": [
{
"condition": "is",
"tag": "service",
"value": "web-api",
"values": null
},
{
"condition": "not in",
"tag": "team",
"value": "",
"values": [
"legacy",
"deprecated"
]
}
],
"granularity": "daily",
"method": "proportional"
},
"type": "shared",
"updated": "2023-01-01T12:00:00Z",
"version": 1
},
"id": "123",
"type": "arbitrary_rule"
}
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export rule_id="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"costs_to_allocate": [
{
"condition": "is",
"tag": "account_id",
"value": "123456789",
"values": []
},
{
"condition": "in",
"tag": "environment",
"value": "",
"values": [
"production",
"staging"
]
}
],
"enabled": true,
"order_id": 1,
"provider": [
"aws",
"gcp"
],
"rule_name": "example-arbitrary-cost-rule",
"strategy": {
"allocated_by_tag_keys": [
"team",
"environment"
],
"based_on_costs": [
{
"condition": "is",
"tag": "service",
"value": "web-api",
"values": []
},
{
"condition": "not in",
"tag": "team",
"value": "",
"values": [
"legacy",
"deprecated"
]
}
],
"granularity": "daily",
"method": "proportional"
},
"type": "shared"
},
"type": "upsert_arbitrary_rule"
}
}
EOF
DELETE https://api.ap1.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.ap2.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.datadoghq.eu/api/v2/cost/arbitrary_rule/{rule_id}https://api.ddog-gov.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.us3.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}
Delete an arbitrary cost rule - Delete an existing arbitrary cost rule by its ID
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
rule_id [required]
integer
The unique identifier of the arbitrary cost rule
No Content
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export rule_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule/${rule_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
GET https://api.ap1.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.ap2.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.datadoghq.eu/api/v2/cost/arbitrary_rule/{rule_id}https://api.ddog-gov.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.us3.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}https://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule/{rule_id}
Get a specific arbitrary cost rule - Retrieve a specific arbitrary cost rule by its ID
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
이름
유형
설명
rule_id [required]
integer
The unique identifier of the arbitrary cost rule
OK
The definition of ArbitraryRuleResponse
object.
항목
유형
설명
data
object
The definition of ArbitraryRuleResponseData
object.
attributes
object
The definition of ArbitraryRuleResponseDataAttributes
object.
costs_to_allocate [required]
[object]
The attributes
costs_to_allocate
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
created [required]
date-time
The attributes
created
.
enabled [required]
boolean
The attributes
enabled
.
last_modified_user_uuid [required]
string
The attributes
last_modified_user_uuid
.
order_id [required]
int64
The attributes
order_id
.
provider [required]
[string]
The attributes
provider
.
rejected
boolean
The attributes
rejected
.
rule_name [required]
string
The attributes
rule_name
.
strategy [required]
object
The definition of ArbitraryRuleResponseDataAttributesStrategy
object.
allocated_by
[object]
The strategy
allocated_by
.
allocated_tags [required]
[object]
The items
allocated_tags
.
key [required]
string
The items
key
.
value [required]
string
The items
value
.
percentage [required]
double
The items
percentage
. The numeric value format should be a 32bit float value.
allocated_by_filters
[object]
The strategy
allocated_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
allocated_by_tag_keys
[string]
The strategy
allocated_by_tag_keys
.
based_on_costs
[object]
The strategy
based_on_costs
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
based_on_timeseries
object
The rule strategy
based_on_timeseries
.
evaluate_grouped_by_filters
[object]
The strategy
evaluate_grouped_by_filters
.
condition [required]
string
The items
condition
.
tag [required]
string
The items
tag
.
value
string
The items
value
.
values
[string]
The items
values
.
evaluate_grouped_by_tag_keys
[string]
The strategy
evaluate_grouped_by_tag_keys
.
granularity
string
The strategy
granularity
.
method [required]
string
The strategy
method
.
type [required]
string
The attributes
type
.
updated [required]
date-time
The attributes
updated
.
version [required]
int32
The attributes
version
.
id
string
The ArbitraryRuleResponseData
id
.
type [required]
enum
Arbitrary rule resource type.
Allowed enum values: arbitrary_rule
default: arbitrary_rule
{
"data": {
"attributes": {
"costs_to_allocate": [
{
"condition": "is",
"tag": "account_id",
"value": "123456789",
"values": null
},
{
"condition": "in",
"tag": "environment",
"value": "",
"values": [
"production",
"staging"
]
}
],
"created": "2023-01-01T12:00:00Z",
"enabled": true,
"last_modified_user_uuid": "user-123-uuid",
"order_id": 1,
"provider": [
"aws",
"gcp"
],
"rule_name": "Example Arbitrary Cost Rule",
"strategy": {
"allocated_by_tag_keys": [
"team",
"environment"
],
"based_on_costs": [
{
"condition": "is",
"tag": "service",
"value": "web-api",
"values": null
},
{
"condition": "not in",
"tag": "team",
"value": "",
"values": [
"legacy",
"deprecated"
]
}
],
"granularity": "daily",
"method": "proportional"
},
"type": "shared",
"updated": "2023-01-01T12:00:00Z",
"version": 1
},
"id": "123",
"type": "arbitrary_rule"
}
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export rule_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule/${rule_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
POST https://api.ap1.datadoghq.com/api/v2/cost/arbitrary_rule/reorderhttps://api.ap2.datadoghq.com/api/v2/cost/arbitrary_rule/reorderhttps://api.datadoghq.eu/api/v2/cost/arbitrary_rule/reorderhttps://api.ddog-gov.com/api/v2/cost/arbitrary_rule/reorderhttps://api.datadoghq.com/api/v2/cost/arbitrary_rule/reorderhttps://api.us3.datadoghq.com/api/v2/cost/arbitrary_rule/reorderhttps://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule/reorder
Reorder arbitrary cost rules - Change the execution order of arbitrary cost rules.
Important: You must provide the complete list of all rule IDs in the desired execution order. The API will reorder ALL rules according to the provided sequence.
Rules are executed in the order specified, with lower indices (earlier in the array) having higher priority.
Example: If you have rules with IDs [123, 456, 789] and want to change order from 123→456→789 to 456→123→789, send: [{“id”: “456”}, {“id”: “123”}, {“id”: “789”}]
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
항목
유형
설명
data [required]
[object]
The ReorderRuleResourceArray
data
.
id
string
The ReorderRuleResourceData
id
.
type [required]
enum
Arbitrary rule resource type.
Allowed enum values: arbitrary_rule
default: arbitrary_rule
{
"data": [
{
"id": "string",
"type": "arbitrary_rule"
}
]
}
Successfully reordered rules
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/arbitrary_rule/reorder" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": [
{
"type": "arbitrary_rule"
}
]
}
EOF
GET https://api.ap1.datadoghq.com/api/v2/cost/custom_costshttps://api.ap2.datadoghq.com/api/v2/cost/custom_costshttps://api.datadoghq.eu/api/v2/cost/custom_costshttps://api.ddog-gov.com/api/v2/cost/custom_costshttps://api.datadoghq.com/api/v2/cost/custom_costshttps://api.us3.datadoghq.com/api/v2/cost/custom_costshttps://api.us5.datadoghq.com/api/v2/cost/custom_costs
List the Custom Costs files.
This endpoint requires the cloud_cost_management_read
permission.
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
이름
유형
설명
page[number]
integer
Page number for pagination
page[size]
integer
Page size for pagination
filter[status]
string
Filter by file status
sort
string
Sort key with optional descending prefix
OK
Response for List Custom Costs files.
항목
유형
설명
data
[object]
List of Custom Costs files.
attributes
object
Schema of a Custom Costs metadata.
billed_cost
double
Total cost in the cost file.
billing_currency
string
Currency used in the Custom Costs file.
charge_period
object
Usage charge period of a Custom Costs file.
end
double
End of the usage of the Custom Costs file.
start
double
Start of the usage of the Custom Costs file.
name
string
Name of the Custom Costs file.
provider_names
[string]
Providers contained in the Custom Costs file.
status
string
Status of the Custom Costs file.
uploaded_at
double
Timestamp, in millisecond, of the upload time of the Custom Costs file.
uploaded_by
object
Metadata of the user that has uploaded the Custom Costs file.
string
The name of the Custom Costs file.
icon
string
The name of the Custom Costs file.
name
string
Name of the user.
id
string
ID of the Custom Costs metadata.
type
string
Type of the Custom Costs file metadata.
meta
object
Meta for the response from the List Custom Costs endpoints.
total_filtered_count
int64
Number of Custom Costs files returned by the List Custom Costs endpoint
version
string
Version of Custom Costs file
{
"data": [
{
"attributes": {
"billed_cost": 100.5,
"billing_currency": "USD",
"charge_period": {
"end": 1706745600000,
"start": 1704067200000
},
"name": "my_file.json",
"provider_names": [
"my_provider"
],
"status": "active",
"uploaded_at": 1704067200000,
"uploaded_by": {
"email": "email.test@datadohq.com",
"icon": "icon.png",
"name": "Test User"
}
},
"id": "string",
"type": "string"
}
],
"meta": {
"total_filtered_count": "integer",
"version": "string"
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/custom_costs" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
List Custom Costs files returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.list_custom_costs_files()
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# List Custom Costs files returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
p api_instance.list_custom_costs_files()
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// List Custom Costs files returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.ListCustomCostsFiles(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.ListCustomCostsFiles`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.ListCustomCostsFiles`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// List Custom Costs files returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.CustomCostsFileListResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
CustomCostsFileListResponse result = apiInstance.listCustomCostsFiles();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#listCustomCostsFiles");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// List Custom Costs files returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.list_custom_costs_files().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* List Custom Costs files returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
apiInstance
.listCustomCostsFiles()
.then((data: v2.CustomCostsFileListResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
PUT https://api.ap1.datadoghq.com/api/v2/cost/custom_costshttps://api.ap2.datadoghq.com/api/v2/cost/custom_costshttps://api.datadoghq.eu/api/v2/cost/custom_costshttps://api.ddog-gov.com/api/v2/cost/custom_costshttps://api.datadoghq.com/api/v2/cost/custom_costshttps://api.us3.datadoghq.com/api/v2/cost/custom_costshttps://api.us5.datadoghq.com/api/v2/cost/custom_costs
Upload a Custom Costs file.
This endpoint requires the cloud_cost_management_write
permission.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
항목
유형
설명
BilledCost
double
Total cost in the cost file.
BillingCurrency
string
Currency used in the Custom Costs file.
ChargeDescription
string
Description for the line item cost.
ChargePeriodEnd
string
End date of the usage charge.
ChargePeriodStart
string
Start date of the usage charge.
ProviderName
string
Name of the provider for the line item.
Tags
object
Additional tags for the line item.
<any-key>
string
[
{
"ProviderName": "my_provider",
"ChargePeriodStart": "2023-05-06",
"ChargePeriodEnd": "2023-06-06",
"ChargeDescription": "my_description",
"BilledCost": 250,
"BillingCurrency": "USD",
"Tags": {
"key": "value"
}
}
]
Accepted
Response for Uploaded Custom Costs files.
항목
유형
설명
data
object
JSON API format for a Custom Costs file.
attributes
object
Schema of a Custom Costs metadata.
billed_cost
double
Total cost in the cost file.
billing_currency
string
Currency used in the Custom Costs file.
charge_period
object
Usage charge period of a Custom Costs file.
end
double
End of the usage of the Custom Costs file.
start
double
Start of the usage of the Custom Costs file.
name
string
Name of the Custom Costs file.
provider_names
[string]
Providers contained in the Custom Costs file.
status
string
Status of the Custom Costs file.
uploaded_at
double
Timestamp, in millisecond, of the upload time of the Custom Costs file.
uploaded_by
object
Metadata of the user that has uploaded the Custom Costs file.
string
The name of the Custom Costs file.
icon
string
The name of the Custom Costs file.
name
string
Name of the user.
id
string
ID of the Custom Costs metadata.
type
string
Type of the Custom Costs file metadata.
meta
object
Meta for the response from the Upload Custom Costs endpoints.
version
string
Version of Custom Costs file
{
"data": {
"attributes": {
"billed_cost": 100.5,
"billing_currency": "USD",
"charge_period": {
"end": 1706745600000,
"start": 1704067200000
},
"name": "my_file.json",
"provider_names": [
"my_provider"
],
"status": "active",
"uploaded_at": 1704067200000,
"uploaded_by": {
"email": "email.test@datadohq.com",
"icon": "icon.png",
"name": "Test User"
}
},
"id": "string",
"type": "string"
},
"meta": {
"version": "string"
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X PUT "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/custom_costs" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
[
{
"ProviderName": "my_provider",
"ChargePeriodStart": "2023-05-06",
"ChargePeriodEnd": "2023-06-06",
"ChargeDescription": "my_description",
"BilledCost": 250,
"BillingCurrency": "USD",
"Tags": {
"key": "value"
}
}
]
EOF
// Upload Custom Costs File returns "Accepted" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := []datadogV2.CustomCostsFileLineItem{
{
ProviderName: datadog.PtrString("my_provider"),
ChargePeriodStart: datadog.PtrString("2023-05-06"),
ChargePeriodEnd: datadog.PtrString("2023-06-06"),
ChargeDescription: datadog.PtrString("my_description"),
BilledCost: datadog.PtrFloat64(250),
BillingCurrency: datadog.PtrString("USD"),
Tags: map[string]string{
"key": "value",
},
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.UploadCustomCostsFile(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.UploadCustomCostsFile`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.UploadCustomCostsFile`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Upload Custom Costs File returns "Accepted" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.CustomCostsFileLineItem;
import com.datadog.api.client.v2.model.CustomCostsFileUploadResponse;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
List<CustomCostsFileLineItem> body =
Collections.singletonList(
new CustomCostsFileLineItem()
.providerName("my_provider")
.chargePeriodStart("2023-05-06")
.chargePeriodEnd("2023-06-06")
.chargeDescription("my_description")
.billedCost(250.0)
.billingCurrency("USD")
.tags(Map.ofEntries(Map.entry("key", "value"))));
try {
CustomCostsFileUploadResponse result = apiInstance.uploadCustomCostsFile(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#uploadCustomCostsFile");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Upload Custom Costs File returns "Accepted" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
from datadog_api_client.v2.model.custom_costs_file_line_item import CustomCostsFileLineItem
body = [
CustomCostsFileLineItem(
provider_name="my_provider",
charge_period_start="2023-05-06",
charge_period_end="2023-06-06",
charge_description="my_description",
billed_cost=250.0,
billing_currency="USD",
tags=dict(
key="value",
),
),
]
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.upload_custom_costs_file(body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Upload Custom Costs File returns "Accepted" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
body = [
DatadogAPIClient::V2::CustomCostsFileLineItem.new({
provider_name: "my_provider",
charge_period_start: "2023-05-06",
charge_period_end: "2023-06-06",
charge_description: "my_description",
billed_cost: 250,
billing_currency: "USD",
tags: {
key: "value",
},
}),
]
p api_instance.upload_custom_costs_file(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Upload Custom Costs File returns "Accepted" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
use datadog_api_client::datadogV2::model::CustomCostsFileLineItem;
use std::collections::BTreeMap;
#[tokio::main]
async fn main() {
let body = vec![CustomCostsFileLineItem::new()
.billed_cost(250.0 as f64)
.billing_currency("USD".to_string())
.charge_description("my_description".to_string())
.charge_period_end("2023-06-06".to_string())
.charge_period_start("2023-05-06".to_string())
.provider_name("my_provider".to_string())
.tags(BTreeMap::from([("key".to_string(), "value".to_string())]))];
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.upload_custom_costs_file(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Upload Custom Costs File returns "Accepted" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiUploadCustomCostsFileRequest = {
body: [
{
providerName: "my_provider",
chargePeriodStart: "2023-05-06",
chargePeriodEnd: "2023-06-06",
chargeDescription: "my_description",
billedCost: 250,
billingCurrency: "USD",
tags: {
key: "value",
},
},
],
};
apiInstance
.uploadCustomCostsFile(params)
.then((data: v2.CustomCostsFileUploadResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
DELETE https://api.ap1.datadoghq.com/api/v2/cost/custom_costs/{file_id}https://api.ap2.datadoghq.com/api/v2/cost/custom_costs/{file_id}https://api.datadoghq.eu/api/v2/cost/custom_costs/{file_id}https://api.ddog-gov.com/api/v2/cost/custom_costs/{file_id}https://api.datadoghq.com/api/v2/cost/custom_costs/{file_id}https://api.us3.datadoghq.com/api/v2/cost/custom_costs/{file_id}https://api.us5.datadoghq.com/api/v2/cost/custom_costs/{file_id}
Delete the specified Custom Costs file.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
file_id [required]
string
File ID.
No Content
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export file_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/custom_costs/${file_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Delete Custom Costs file returns "No Content" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
api_instance.delete_custom_costs_file(
file_id="file_id",
)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Delete Custom Costs file returns "No Content" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
api_instance.delete_custom_costs_file("file_id")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Delete Custom Costs file returns "No Content" response
package main
import (
"context"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
r, err := api.DeleteCustomCostsFile(ctx, "file_id")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.DeleteCustomCostsFile`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Delete Custom Costs file returns "No Content" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
apiInstance.deleteCustomCostsFile("file_id");
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#deleteCustomCostsFile");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Delete Custom Costs file returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.delete_custom_costs_file("file_id".to_string()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Delete Custom Costs file returns "No Content" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiDeleteCustomCostsFileRequest = {
fileId: "file_id",
};
apiInstance
.deleteCustomCostsFile(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v2/cost/custom_costs/{file_id}https://api.ap2.datadoghq.com/api/v2/cost/custom_costs/{file_id}https://api.datadoghq.eu/api/v2/cost/custom_costs/{file_id}https://api.ddog-gov.com/api/v2/cost/custom_costs/{file_id}https://api.datadoghq.com/api/v2/cost/custom_costs/{file_id}https://api.us3.datadoghq.com/api/v2/cost/custom_costs/{file_id}https://api.us5.datadoghq.com/api/v2/cost/custom_costs/{file_id}
Fetch the specified Custom Costs file.
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
이름
유형
설명
file_id [required]
string
File ID.
OK
Response for Get Custom Costs files.
항목
유형
설명
data
object
JSON API format of for a Custom Costs file with content.
attributes
object
Schema of a cost file's metadata.
billed_cost
double
Total cost in the cost file.
billing_currency
string
Currency used in the Custom Costs file.
charge_period
object
Usage charge period of a Custom Costs file.
end
double
End of the usage of the Custom Costs file.
start
double
Start of the usage of the Custom Costs file.
content
[object]
Detail of the line items from the Custom Costs file.
BilledCost
double
Total cost in the cost file.
BillingCurrency
string
Currency used in the Custom Costs file.
ChargeDescription
string
Description for the line item cost.
ChargePeriodEnd
string
End date of the usage charge.
ChargePeriodStart
string
Start date of the usage charge.
ProviderName
string
Name of the provider for the line item.
Tags
object
Additional tags for the line item.
<any-key>
string
name
string
Name of the Custom Costs file.
provider_names
[string]
Providers contained in the Custom Costs file.
status
string
Status of the Custom Costs file.
uploaded_at
double
Timestamp in millisecond of the upload time of the Custom Costs file.
uploaded_by
object
Metadata of the user that has uploaded the Custom Costs file.
string
The name of the Custom Costs file.
icon
string
The name of the Custom Costs file.
name
string
Name of the user.
id
string
ID of the Custom Costs metadata.
type
string
Type of the Custom Costs file metadata.
meta
object
Meta for the response from the Get Custom Costs endpoints.
version
string
Version of Custom Costs file
{
"data": {
"attributes": {
"billed_cost": 100.5,
"billing_currency": "USD",
"charge_period": {
"end": 1706745600000,
"start": 1704067200000
},
"content": [
{
"BilledCost": 100.5,
"BillingCurrency": "USD",
"ChargeDescription": "Monthly usage charge for my service",
"ChargePeriodEnd": "2023-02-28",
"ChargePeriodStart": "2023-02-01",
"ProviderName": "string",
"Tags": {
"<any-key>": "string"
}
}
],
"name": "my_file.json",
"provider_names": [
"my_provider"
],
"status": "active",
"uploaded_at": 1704067200000,
"uploaded_by": {
"email": "email.test@datadohq.com",
"icon": "icon.png",
"name": "Test User"
}
},
"id": "string",
"type": "string"
},
"meta": {
"version": "string"
}
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export file_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/custom_costs/${file_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get Custom Costs file returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.get_custom_costs_file(
file_id="file_id",
)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Get Custom Costs file returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
p api_instance.get_custom_costs_file("file_id")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Get Custom Costs file returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.GetCustomCostsFile(ctx, "file_id")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.GetCustomCostsFile`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.GetCustomCostsFile`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Get Custom Costs file returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.CustomCostsFileGetResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
CustomCostsFileGetResponse result = apiInstance.getCustomCostsFile("file_id");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#getCustomCostsFile");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Get Custom Costs file returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.get_custom_costs_file("file_id".to_string()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Get Custom Costs file returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiGetCustomCostsFileRequest = {
fileId: "file_id",
};
apiInstance
.getCustomCostsFile(params)
.then((data: v2.CustomCostsFileGetResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v2/cost/budgetshttps://api.ap2.datadoghq.com/api/v2/cost/budgetshttps://api.datadoghq.eu/api/v2/cost/budgetshttps://api.ddog-gov.com/api/v2/cost/budgetshttps://api.datadoghq.com/api/v2/cost/budgetshttps://api.us3.datadoghq.com/api/v2/cost/budgetshttps://api.us5.datadoghq.com/api/v2/cost/budgets
List budgets.
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
OK
An array of budgets.
항목
유형
설명
data
[object]
The BudgetArray
data
.
attributes
object
The attributes of a budget.
created_at
int64
The timestamp when the budget was created.
created_by
string
The id of the user that created the budget.
end_month
int64
The month when the budget ends.
entries
[object]
The entries of the budget.
amount
double
The amount
of the budget entry.
month
int64
The month
of the budget entry.
tag_filters
[object]
The tag_filters
of the budget entry.
tag_key
string
The key of the tag.
tag_value
string
The value of the tag.
metrics_query
string
The cost query used to track against the budget.
name
string
The name of the budget.
org_id
int64
The id of the org the budget belongs to.
start_month
int64
The month when the budget starts.
total_amount
double
The sum of all budget entries' amounts.
updated_at
int64
The timestamp when the budget was last updated.
updated_by
string
The id of the user that created the budget.
id
string
The id of the budget.
type
string
The type of the object, must be budget
.
{
"data": [
{
"attributes": {
"created_at": 1741011342772,
"created_by": "user1",
"end_month": 202502,
"metrics_query": "aws.cost.amortized{service:ec2} by {service}",
"name": "my budget",
"org_id": 123,
"start_month": 202501,
"total_amount": 1000,
"updated_at": 1741011342772,
"updated_by": "user2"
},
"id": "00000000-0a0a-0a0a-aaa0-00000000000a",
"type": "budget"
}
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/budgets" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
List budgets returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.list_budgets()
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# List budgets returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
p api_instance.list_budgets()
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// List budgets returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.ListBudgets(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.ListBudgets`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.ListBudgets`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// List budgets returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.BudgetArray;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
BudgetArray result = apiInstance.listBudgets();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#listBudgets");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// List budgets returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.list_budgets().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* List budgets returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
apiInstance
.listBudgets()
.then((data: v2.BudgetArray) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
PUT https://api.ap1.datadoghq.com/api/v2/cost/budgethttps://api.ap2.datadoghq.com/api/v2/cost/budgethttps://api.datadoghq.eu/api/v2/cost/budgethttps://api.ddog-gov.com/api/v2/cost/budgethttps://api.datadoghq.com/api/v2/cost/budgethttps://api.us3.datadoghq.com/api/v2/cost/budgethttps://api.us5.datadoghq.com/api/v2/cost/budget
Create a new budget or update an existing one.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
항목
유형
설명
data
object
A budget and all its entries.
attributes
object
The attributes of a budget.
created_at
int64
The timestamp when the budget was created.
created_by
string
The id of the user that created the budget.
end_month
int64
The month when the budget ends.
entries
[object]
The entries of the budget.
amount
double
The amount
of the budget entry.
month
int64
The month
of the budget entry.
tag_filters
[object]
The tag_filters
of the budget entry.
tag_key
string
The key of the tag.
tag_value
string
The value of the tag.
metrics_query
string
The cost query used to track against the budget.
name
string
The name of the budget.
org_id
int64
The id of the org the budget belongs to.
start_month
int64
The month when the budget starts.
total_amount
double
The sum of all budget entries' amounts.
updated_at
int64
The timestamp when the budget was last updated.
updated_by
string
The id of the user that created the budget.
id
string
The BudgetWithEntriesData
id
.
type
string
The type of the object, must be budget
.
{
"data": {
"attributes": {
"created_at": 1738258683590,
"created_by": "00000000-0a0a-0a0a-aaa0-00000000000a",
"end_month": 202502,
"entries": [
{
"amount": 500,
"month": 202501,
"tag_filters": [
{
"tag_key": "service",
"tag_value": "ec2"
}
]
}
],
"metrics_query": "aws.cost.amortized{service:ec2} by {service}",
"name": "my budget",
"org_id": 123,
"start_month": 202501,
"total_amount": 1000,
"updated_at": 1738258683590,
"updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"
},
"id": "00000000-0a0a-0a0a-aaa0-00000000000a",
"type": "string"
}
}
OK
The definition of the BudgetWithEntries
object.
항목
유형
설명
data
object
A budget and all its entries.
attributes
object
The attributes of a budget.
created_at
int64
The timestamp when the budget was created.
created_by
string
The id of the user that created the budget.
end_month
int64
The month when the budget ends.
entries
[object]
The entries of the budget.
amount
double
The amount
of the budget entry.
month
int64
The month
of the budget entry.
tag_filters
[object]
The tag_filters
of the budget entry.
tag_key
string
The key of the tag.
tag_value
string
The value of the tag.
metrics_query
string
The cost query used to track against the budget.
name
string
The name of the budget.
org_id
int64
The id of the org the budget belongs to.
start_month
int64
The month when the budget starts.
total_amount
double
The sum of all budget entries' amounts.
updated_at
int64
The timestamp when the budget was last updated.
updated_by
string
The id of the user that created the budget.
id
string
The BudgetWithEntriesData
id
.
type
string
The type of the object, must be budget
.
{
"data": {
"attributes": {
"created_at": 1738258683590,
"created_by": "00000000-0a0a-0a0a-aaa0-00000000000a",
"end_month": 202502,
"entries": [
{
"amount": 500,
"month": 202501,
"tag_filters": [
{
"tag_key": "service",
"tag_value": "ec2"
}
]
}
],
"metrics_query": "aws.cost.amortized{service:ec2} by {service}",
"name": "my budget",
"org_id": 123,
"start_month": 202501,
"total_amount": 1000,
"updated_at": 1738258683590,
"updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"
},
"id": "00000000-0a0a-0a0a-aaa0-00000000000a",
"type": "string"
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X PUT "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/budget" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{}
EOF
"""
Create or update a budget returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
from datadog_api_client.v2.model.budget_attributes import BudgetAttributes
from datadog_api_client.v2.model.budget_entry import BudgetEntry
from datadog_api_client.v2.model.budget_with_entries import BudgetWithEntries
from datadog_api_client.v2.model.budget_with_entries_data import BudgetWithEntriesData
from datadog_api_client.v2.model.tag_filter import TagFilter
body = BudgetWithEntries(
data=BudgetWithEntriesData(
attributes=BudgetAttributes(
created_at=1738258683590,
created_by="00000000-0a0a-0a0a-aaa0-00000000000a",
end_month=202502,
entries=[
BudgetEntry(
amount=500.0,
month=202501,
tag_filters=[
TagFilter(
tag_key="service",
tag_value="ec2",
),
],
),
],
metrics_query="aws.cost.amortized{service:ec2} by {service}",
name="my budget",
org_id=123,
start_month=202501,
total_amount=1000.0,
updated_at=1738258683590,
updated_by="00000000-0a0a-0a0a-aaa0-00000000000a",
),
id="00000000-0a0a-0a0a-aaa0-00000000000a",
),
)
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.upsert_budget(body=body)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Create or update a budget returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
body = DatadogAPIClient::V2::BudgetWithEntries.new({
data: DatadogAPIClient::V2::BudgetWithEntriesData.new({
attributes: DatadogAPIClient::V2::BudgetAttributes.new({
created_at: 1738258683590,
created_by: "00000000-0a0a-0a0a-aaa0-00000000000a",
end_month: 202502,
entries: [
DatadogAPIClient::V2::BudgetEntry.new({
amount: 500,
month: 202501,
tag_filters: [
DatadogAPIClient::V2::TagFilter.new({
tag_key: "service",
tag_value: "ec2",
}),
],
}),
],
metrics_query: "aws.cost.amortized{service:ec2} by {service}",
name: "my budget",
org_id: 123,
start_month: 202501,
total_amount: 1000,
updated_at: 1738258683590,
updated_by: "00000000-0a0a-0a0a-aaa0-00000000000a",
}),
id: "00000000-0a0a-0a0a-aaa0-00000000000a",
}),
})
p api_instance.upsert_budget(body)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Create or update a budget returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.BudgetWithEntries{
Data: &datadogV2.BudgetWithEntriesData{
Attributes: &datadogV2.BudgetAttributes{
CreatedAt: datadog.PtrInt64(1738258683590),
CreatedBy: datadog.PtrString("00000000-0a0a-0a0a-aaa0-00000000000a"),
EndMonth: datadog.PtrInt64(202502),
Entries: []datadogV2.BudgetEntry{
{
Amount: datadog.PtrFloat64(500),
Month: datadog.PtrInt64(202501),
TagFilters: []datadogV2.TagFilter{
{
TagKey: datadog.PtrString("service"),
TagValue: datadog.PtrString("ec2"),
},
},
},
},
MetricsQuery: datadog.PtrString("aws.cost.amortized{service:ec2} by {service}"),
Name: datadog.PtrString("my budget"),
OrgId: datadog.PtrInt64(123),
StartMonth: datadog.PtrInt64(202501),
TotalAmount: datadog.PtrFloat64(1000),
UpdatedAt: datadog.PtrInt64(1738258683590),
UpdatedBy: datadog.PtrString("00000000-0a0a-0a0a-aaa0-00000000000a"),
},
Id: datadog.PtrString("00000000-0a0a-0a0a-aaa0-00000000000a"),
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.UpsertBudget(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.UpsertBudget`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.UpsertBudget`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Create or update a budget returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.BudgetAttributes;
import com.datadog.api.client.v2.model.BudgetEntry;
import com.datadog.api.client.v2.model.BudgetWithEntries;
import com.datadog.api.client.v2.model.BudgetWithEntriesData;
import com.datadog.api.client.v2.model.TagFilter;
import java.util.Collections;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
BudgetWithEntries body =
new BudgetWithEntries()
.data(
new BudgetWithEntriesData()
.attributes(
new BudgetAttributes()
.createdAt(1738258683590L)
.createdBy("00000000-0a0a-0a0a-aaa0-00000000000a")
.endMonth(202502L)
.entries(
Collections.singletonList(
new BudgetEntry()
.amount(500.0)
.month(202501L)
.tagFilters(
Collections.singletonList(
new TagFilter()
.tagKey("service")
.tagValue("ec2")))))
.metricsQuery("aws.cost.amortized{service:ec2} by {service}")
.name("my budget")
.orgId(123L)
.startMonth(202501L)
.totalAmount(1000.0)
.updatedAt(1738258683590L)
.updatedBy("00000000-0a0a-0a0a-aaa0-00000000000a"))
.id("00000000-0a0a-0a0a-aaa0-00000000000a"));
try {
BudgetWithEntries result = apiInstance.upsertBudget(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#upsertBudget");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Create or update a budget returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
use datadog_api_client::datadogV2::model::BudgetAttributes;
use datadog_api_client::datadogV2::model::BudgetEntry;
use datadog_api_client::datadogV2::model::BudgetWithEntries;
use datadog_api_client::datadogV2::model::BudgetWithEntriesData;
use datadog_api_client::datadogV2::model::TagFilter;
#[tokio::main]
async fn main() {
let body = BudgetWithEntries::new().data(
BudgetWithEntriesData::new()
.attributes(
BudgetAttributes::new()
.created_at(1738258683590)
.created_by("00000000-0a0a-0a0a-aaa0-00000000000a".to_string())
.end_month(202502)
.entries(vec![BudgetEntry::new()
.amount(500.0 as f64)
.month(202501)
.tag_filters(vec![TagFilter::new()
.tag_key("service".to_string())
.tag_value("ec2".to_string())])])
.metrics_query("aws.cost.amortized{service:ec2} by {service}".to_string())
.name("my budget".to_string())
.org_id(123)
.start_month(202501)
.total_amount(1000.0 as f64)
.updated_at(1738258683590)
.updated_by("00000000-0a0a-0a0a-aaa0-00000000000a".to_string()),
)
.id("00000000-0a0a-0a0a-aaa0-00000000000a".to_string()),
);
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.upsert_budget(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Create or update a budget returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiUpsertBudgetRequest = {
body: {
data: {
attributes: {
createdAt: 1738258683590,
createdBy: "00000000-0a0a-0a0a-aaa0-00000000000a",
endMonth: 202502,
entries: [
{
amount: 500,
month: 202501,
tagFilters: [
{
tagKey: "service",
tagValue: "ec2",
},
],
},
],
metricsQuery: "aws.cost.amortized{service:ec2} by {service}",
name: "my budget",
orgId: 123,
startMonth: 202501,
totalAmount: 1000,
updatedAt: 1738258683590,
updatedBy: "00000000-0a0a-0a0a-aaa0-00000000000a",
},
id: "00000000-0a0a-0a0a-aaa0-00000000000a",
},
},
};
apiInstance
.upsertBudget(params)
.then((data: v2.BudgetWithEntries) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
DELETE https://api.ap1.datadoghq.com/api/v2/cost/budget/{budget_id}https://api.ap2.datadoghq.com/api/v2/cost/budget/{budget_id}https://api.datadoghq.eu/api/v2/cost/budget/{budget_id}https://api.ddog-gov.com/api/v2/cost/budget/{budget_id}https://api.datadoghq.com/api/v2/cost/budget/{budget_id}https://api.us3.datadoghq.com/api/v2/cost/budget/{budget_id}https://api.us5.datadoghq.com/api/v2/cost/budget/{budget_id}
Delete a budget.
OAuth apps require the cloud_cost_management_write
authorization scope to access this endpoint.
이름
유형
설명
budget_id [required]
string
Budget id.
No Content
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export budget_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/budget/${budget_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Delete a budget returns "No Content" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
api_instance.delete_budget(
budget_id="budget_id",
)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Delete a budget returns "No Content" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
api_instance.delete_budget("budget_id")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Delete a budget returns "No Content" response
package main
import (
"context"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
r, err := api.DeleteBudget(ctx, "budget_id")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.DeleteBudget`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Delete a budget returns "No Content" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
apiInstance.deleteBudget("budget_id");
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#deleteBudget");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Delete a budget returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.delete_budget("budget_id".to_string()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Delete a budget returns "No Content" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiDeleteBudgetRequest = {
budgetId: "budget_id",
};
apiInstance
.deleteBudget(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v2/cost/budget/{budget_id}https://api.ap2.datadoghq.com/api/v2/cost/budget/{budget_id}https://api.datadoghq.eu/api/v2/cost/budget/{budget_id}https://api.ddog-gov.com/api/v2/cost/budget/{budget_id}https://api.datadoghq.com/api/v2/cost/budget/{budget_id}https://api.us3.datadoghq.com/api/v2/cost/budget/{budget_id}https://api.us5.datadoghq.com/api/v2/cost/budget/{budget_id}
Get a budget.
OAuth apps require the cloud_cost_management_read
authorization scope to access this endpoint.
이름
유형
설명
budget_id [required]
string
Budget id.
OK
The definition of the BudgetWithEntries
object.
항목
유형
설명
data
object
A budget and all its entries.
attributes
object
The attributes of a budget.
created_at
int64
The timestamp when the budget was created.
created_by
string
The id of the user that created the budget.
end_month
int64
The month when the budget ends.
entries
[object]
The entries of the budget.
amount
double
The amount
of the budget entry.
month
int64
The month
of the budget entry.
tag_filters
[object]
The tag_filters
of the budget entry.
tag_key
string
The key of the tag.
tag_value
string
The value of the tag.
metrics_query
string
The cost query used to track against the budget.
name
string
The name of the budget.
org_id
int64
The id of the org the budget belongs to.
start_month
int64
The month when the budget starts.
total_amount
double
The sum of all budget entries' amounts.
updated_at
int64
The timestamp when the budget was last updated.
updated_by
string
The id of the user that created the budget.
id
string
The BudgetWithEntriesData
id
.
type
string
The type of the object, must be budget
.
{
"data": {
"attributes": {
"created_at": 1738258683590,
"created_by": "00000000-0a0a-0a0a-aaa0-00000000000a",
"end_month": 202502,
"entries": [
{
"amount": 500,
"month": 202501,
"tag_filters": [
{
"tag_key": "service",
"tag_value": "ec2"
}
]
}
],
"metrics_query": "aws.cost.amortized{service:ec2} by {service}",
"name": "my budget",
"org_id": 123,
"start_month": 202501,
"total_amount": 1000,
"updated_at": 1738258683590,
"updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"
},
"id": "00000000-0a0a-0a0a-aaa0-00000000000a",
"type": "string"
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export budget_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/budget/${budget_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get a budget returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CloudCostManagementApi(api_client)
response = api_instance.get_budget(
budget_id="budget_id",
)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Get a budget returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
p api_instance.get_budget("budget_id")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Get a budget returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewCloudCostManagementApi(apiClient)
resp, r, err := api.GetBudget(ctx, "budget_id")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.GetBudget`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.GetBudget`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Get a budget returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.BudgetWithEntries;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
try {
BudgetWithEntries result = apiInstance.getBudget("budget_id");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CloudCostManagementApi#getBudget");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Get a budget returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = CloudCostManagementAPI::with_config(configuration);
let resp = api.get_budget("budget_id".to_string()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
* Get a budget returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);
const params: v2.CloudCostManagementApiGetBudgetRequest = {
budgetId: "budget_id",
};
apiInstance
.getBudget(params)
.then((data: v2.BudgetWithEntries) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"