The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS and Azure. See the Cloud Cost Management page for more information.
/**
* List Cloud Cost Management AWS CUR configs returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CloudCostManagementApi(configuration);apiInstance.listCostAWSCURConfigs().then((data: v2.AwsCURConfigsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
List the AWS accounts in an organization by calling ‘organizations:ListAccounts’ from the specified management account.
This endpoint requires the cloud_cost_management_read authorization scope.
"""
List related AWS accounts returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.cloud_cost_management_apiimportCloudCostManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=CloudCostManagementApi(api_client)response=api_instance.list_aws_related_accounts(filter_management_account_id="123456789123",)print(response)
# List related AWS accounts returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CloudCostManagementAPI.newpapi_instance.list_aws_related_accounts("123456789123")
// List related AWS accounts returns "OK" response
packagemainimport("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")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCloudCostManagementApi(apiClient)resp,r,err:=api.ListAWSRelatedAccounts(ctx,"123456789123")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CloudCostManagementApi.ListAWSRelatedAccounts`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CloudCostManagementApi.ListAWSRelatedAccounts`:\n%s\n",responseContent)}
/**
* List related AWS accounts returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CloudCostManagementApi(configuration);constparams: v2.CloudCostManagementApiListAWSRelatedAccountsRequest={filterManagementAccountId:"123456789123",};apiInstance.listAWSRelatedAccounts(params).then((data: v2.AWSRelatedAccountsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));