List SKUs
https://api.datadoghq.com/api/v2/product-catalog/skushttps://api.us3.datadoghq.com/api/v2/product-catalog/skushttps://api.us5.datadoghq.com/api/v2/product-catalog/skushttps://api.datadoghq.eu/api/v2/product-catalog/skushttps://api.ap1.datadoghq.com/api/v2/product-catalog/skushttps://api.ap2.datadoghq.com/api/v2/product-catalog/skushttps://api.uk1.datadoghq.com/api/v2/product-catalog/skushttps://api.ddog-gov.com/api/v2/product-catalog/skushttps://api.us2.ddog-gov.com/api/v2/product-catalog/skusOverview
Get every generally available Datadog SKU, with the pricing and allotment metadata that applies to it, for the Datadog site serving the request. A SKU is generally available when it is billed through a metered commitment or through automatic billing; SKUs in any other phase are not returned.
Prices, allotments, and pricing tiers are returned as they were in effect on
as_of_date, which defaults to the date of the request. Prices are public list prices:
they do not reflect discounts, commitments, or negotiated rates on an account.
Each SKU is a separate resource in data, identified by its SKU code, and sorted by
that code in ascending order. The whole catalog is returned in a single response, so
this endpoint is not paginated.
OAuth apps require one of the following authorization scopes to access this endpoint: billing_read, usage_read.
Arguments
Query Strings
version [required]The version of the product catalog response contract to return. v1 is the latest.
This is independent of the /api/v2 path segment, which is the version of the
Datadog API itself.
v1as_of_dateThe date the returned prices, allotments, and pricing tiers are effective as of, in
YYYY-MM-DD format. Defaults to the date of the request, and must not be later
than it. Set it to a date in a past billing period to reconcile that period against
the prices that were in effect then, rather than today.
Response
OK
Response containing the generally available SKUs and their pricing metadata.
data [required]The generally available SKUs, sorted by SKU code in ascending order.
attributes [required]The pricing and allotment metadata of a SKU.
allotments [required]The allotments the SKU provides to other SKUs. Every entry carries the code of this
SKU as its parent_sku_code. Empty when the SKU provides no allotments.
child_sku_code [required]The code of the SKU that receives the allotment.
hourly_quantity [required]The quantity allotted per hour. Fractional for some allotments, and equal to
monthly_quantity for others, depending on how the child SKU meters usage.
monthly_quantity [required]The quantity allotted per month.
parent_sku_code [required]The code of the SKU that provides the allotment. Always the code of the SKU the allotment is returned under.
billing_dimension [required]The identifier of the billing dimension the SKU is billed on, as used by the usage metering endpoints. Several SKUs can share one billing dimension, so this value does not identify a SKU.
billing_units [required]The billable usage unit the SKU is priced per. null for SKUs that are not priced
per unit of usage, such as those whose pricing_type is percent.
currency [required]The ISO-4217 code of the currency the prices are expressed in.
default_on_demand_option [required]The billing frequency applied to on-demand usage of the SKU by default.
hourly, monthlynumber_of_units_included_in_price [required]The number of billable usage units that one unit of price covers. Divide measured
usage by this value before multiplying by the price. For example, a SKU priced at 18.00 with
number_of_units_included_in_price of 1 costs 18.00 per host, while a SKU priced
at 12.00 with number_of_units_included_in_price of 10000 costs 12.00 per
10,000 requests. It is a scaling factor on the price, not a free allotment; included
quantities are in allotments. The same factor applies to the price of a tier in
on_demand_tiered whose pricing_unit_type is unit. It does not apply to a tier
whose pricing_unit_type is block: that tier's price is charged for the whole
block bounded by min_usage_quantity and max_usage_quantity, however much of the
block is used. 0 for SKUs that are not priced per unit of usage, such as those
whose pricing_type is percent.
on_demand_list_price [required]The public list price of on-demand usage of the SKU, as a decimal string. The number
of decimal places is not normalized, so values such as 0, 0.9, and 30000.00
all occur. null when the SKU is priced with tiers, in which case the prices are in
on_demand_tiered.
on_demand_tiered [required]The tiered pricing applied to on-demand usage of the SKU. null when the SKU is priced
with a single list price instead.
tiers [required]The pricing tiers, ordered by ascending usage quantity.
max_usage_quantity [required]The exclusive upper bound of the usage range the tier prices. null on the final
tier, which is unbounded.
min_usage_quantity [required]The inclusive lower bound of the usage range the tier prices.
price [required]The price applied to usage in the tier, as a decimal string. The number of decimal
places is not normalized, so free tiers appear as either 0 or 0.00.
pricing_unit_type [required]Whether the tier's price applies per unit of usage or to a block of usage.
block, unitpricing_type [required]How the SKU is priced. usage prices each billable usage unit, and percent prices a
percentage; percent-priced SKUs have no billing_units.
usage, percentsku_name [required]The human-readable name of the SKU.
id [required]The code that identifies the SKU.
type [required]The SKU resource type.
Sku{
"data": [
{
"attributes": {
"allotments": [
{
"child_sku_code": "CUSTOM-EVENTS",
"hourly_quantity": 0.684932,
"monthly_quantity": 500,
"parent_sku_code": "HOSTS-PRO"
}
],
"billing_dimension": "infra_host",
"billing_units": "hosts",
"currency": "USD",
"default_on_demand_option": "monthly",
"number_of_units_included_in_price": 1,
"on_demand_list_price": "18.00",
"on_demand_tiered": {
"tiers": [
{
"max_usage_quantity": 100000,
"min_usage_quantity": 1,
"price": "120.00",
"pricing_unit_type": "unit"
}
]
},
"pricing_type": "usage",
"sku_name": "Infra Host (Pro)"
},
"id": "HOSTS-PRO",
"type": "Sku"
}
]
}Bad Request - version is missing or invalid, or as_of_date is malformed or in the future
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Forbidden - the caller has neither the billing_read nor the usage_read permission
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Not Found - the requested catalog version is not supported
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Code Example
# Required query arguments
export version="v1"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/product-catalog/skus?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Required query arguments
export version="v1"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/product-catalog/skus?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Required query arguments
export version="v1"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/product-catalog/skus?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Required query arguments
export version="v1"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/product-catalog/skus?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Required query arguments
export version="v1"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/product-catalog/skus?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Required query arguments
export version="v1"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/product-catalog/skus?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Required query arguments
export version="v1"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/product-catalog/skus?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Required query arguments
export version="v1"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/product-catalog/skus?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Required query arguments
export version="v1"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/product-catalog/skus?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"// List SKUs 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())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
configuration.SetUnstableOperationEnabled("v2.ListProductCatalogSKUs", true)
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewProductCatalogApi(apiClient)
resp, r, err := api.ListProductCatalogSKUs(ctx, datadogV2.PRODUCTCATALOGSKUSAPIVERSION_V1, *datadogV2.NewListProductCatalogSKUsOptionalParameters())
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProductCatalogApi.ListProductCatalogSKUs`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `ProductCatalogApi.ListProductCatalogSKUs`:\n%s\n", responseContent)
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// List SKUs returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ProductCatalogApi;
import com.datadog.api.client.v2.model.ProductCatalogSKUsAPIVersion;
import com.datadog.api.client.v2.model.ProductCatalogSKUsResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
defaultClient.setUnstableOperationEnabled("v2.listProductCatalogSKUs", true);
ProductCatalogApi apiInstance = new ProductCatalogApi(defaultClient);
try {
ProductCatalogSKUsResponse result =
apiInstance.listProductCatalogSKUs(ProductCatalogSKUsAPIVersion.V1);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductCatalogApi#listProductCatalogSKUs");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
List SKUs returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.product_catalog_api import ProductCatalogApi
from datadog_api_client.v2.model.product_catalog_sk_us_api_version import ProductCatalogSKUsAPIVersion
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["list_product_catalog_sk_us"] = True
with ApiClient(configuration) as api_client:
api_instance = ProductCatalogApi(api_client)
response = api_instance.list_product_catalog_sk_us(
version=ProductCatalogSKUsAPIVersion.V1,
)
print(response)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# List SKUs returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.list_product_catalog_sk_us".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ProductCatalogAPI.new
p api_instance.list_product_catalog_sk_us(ProductCatalogSKUsAPIVersion::V1)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// List SKUs returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_product_catalog::ListProductCatalogSKUsOptionalParams;
use datadog_api_client::datadogV2::api_product_catalog::ProductCatalogAPI;
use datadog_api_client::datadogV2::model::ProductCatalogSKUsAPIVersion;
#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.list_product_catalog_sk_us", true);
let api = ProductCatalogAPI::with_config(configuration);
let resp = api
.list_product_catalog_sk_us(
ProductCatalogSKUsAPIVersion::V1,
ListProductCatalogSKUsOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run/**
* List SKUs returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
configuration.unstableOperations["v2.listProductCatalogSKUs"] = true;
const apiInstance = new v2.ProductCatalogApi(configuration);
const params: v2.ProductCatalogApiListProductCatalogSKUsRequest = {
version: "v1",
};
apiInstance
.listProductCatalogSKUs(params)
.then((data: v2.ProductCatalogSKUsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"