Datadog-AWS インテグレーションの構成は、Datadog API から直接行います。 詳細については、AWS インテグレーションのページを参照してください。
POST https://api.datadoghq.eu/api/v1/integration/awshttps://api.ddog-gov.com/api/v1/integration/awshttps://api.datadoghq.com/api/v1/integration/awshttps://api.us3.datadoghq.com/api/v1/integration/aws
Datadog と Amazon Web Services のインテグレーションを作成します。
POST
メソッドを使用すると、Datadog オーガニゼーションの既存の構成に
新しい構成を追加する形でインテグレーション構成が更新されます。
これはロールベース認証用の一意の AWS アカウント ID となります。
AWS リクエストオブジェクト
フィールド
種類
説明
access_key_id
string
Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.
account_id
string
Your AWS Account ID without dashes.
account_specific_namespace_rules
object
An object, (in the form {"namespace1":true/false, "namespace2":true/false}
),
that enables or disables metric collection for specific AWS namespaces for this
AWS account only.
<any-key>
boolean
A list of additional properties.
excluded_regions
[string]
An array of AWS regions to exclude from metrics collection.
filter_tags
[string]
The array of EC2 tags (in the form key:value
) defines a filter that Datadog uses when collecting metrics from EC2.
Wildcards, such as ?
(for single characters) and *
(for multiple characters) can also be used.
Only hosts that match one of the defined tags
will be imported into Datadog. The rest will be ignored.
Host matching a given tag can also be excluded by adding !
before the tag.
For example, env:production,instance-type:c1.*,!region:us-east-1
host_tags
[string]
Array of tags (in the form key:value
) to add to all hosts
and metrics reporting through this integration.
role_name
string
Your Datadog role delegation name.
secret_access_key
string
Your AWS secret access key. Only required if your AWS account is a GovCloud or China account.
{
"access_key_id": "string",
"account_id": "1234567",
"account_specific_namespace_rules": {
"<any-key>": false
},
"excluded_regions": [
"us-east-1",
"us-west-2"
],
"filter_tags": [
"<KEY>:<VALUE>"
],
"host_tags": [
"<KEY>:<VALUE>"
],
"role_name": "DatadogAWSIntegrationRole",
"secret_access_key": "string"
}
OK
The Response returned by the AWS Create Account call.
{
"external_id": "string"
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication Error
Error response object.
{
"errors": [
"Bad Request"
]
}
Conflict Error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/aws" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{}
EOF
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
body := *datadog.NewAWSAccount() // AWSAccount | AWS Request Object
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.AWSIntegrationApi.CreateAWSAccount(ctx).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.CreateAWSAccount``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateAWSAccount`: AWSAccountCreateResponse
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from AWSIntegrationApi.CreateAWSAccount:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
go run "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.AwsIntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);
AWSAccount body = new AWSAccount(); // AWSAccount | AWS Request Object
try {
AWSAccountCreateResponse result = apiInstance.createAWSAccount(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AwsIntegrationApi#createAWSAccount");
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:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
java "Example.java"
from datadog import initialize, api
options = {
'api_key': '<DATADOG_API_KEY>',
'app_key': '<DATADOG_APPLICATION_KEY>'
}
initialize(**options)
api.AwsIntegration.create(
account_id="<AWS_ACCOUNT_ID>",
host_tags=["tag:example"],
filter_tags=["filter:example"],
role_name="<AWS_ROLE_NAME>",
account_specific_namespace_rules={'namespace1': True/False, 'namespace2': True/False},
excluded_regions=["us-east-1", "us-west-1"]
)
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python "example.py"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import aws_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = aws_integration_api.AWSIntegrationApi(api_client)
body = AWSAccount(
access_key_id="access_key_id_example",
account_id="1234567",
account_specific_namespace_rules={
"key": True,
},
excluded_regions=["us-east-1","us-west-2"],
filter_tags=["<KEY>:<VALUE>"],
host_tags=["<KEY>:<VALUE>"],
role_name="DatadogAWSIntegrationRole",
secret_access_key="secret_access_key_example",
) # AWSAccount | AWS Request Object
# example passing only required values which don't have defaults set
try:
# Create an AWS integration
api_response = api_instance.create_aws_account(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AWSIntegrationApi->create_aws_account: %s\n" % e)
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python3 "example.py"
require 'rubygems'
require 'dogapi'
api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'
dog = Dogapi::Client.new(api_key, app_key)
config = {
"account_id": "<AWS_ACCOUNT_ID>",
"filter_tags": ["<KEY>:<VALUE>"],
"host_tags": ["<KEY>:<VALUE>"],
"role_name": "DatadogAWSIntegrationRole",
"account_specific_namespace_rules": {"auto_scaling": false, "opsworks": false},
"excluded_regions": ["us-east-1", "us-west-1"]
}
dog.aws_integration_create(config)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
body = DatadogAPIClient::V1::AWSAccount.new # AWSAccount | AWS Request Object
begin
# Create an AWS integration
result = api_instance.create_aws_account(body)
p result
rescue DatadogAPIClient::V1::APIError => e
puts "Error when calling AWSIntegrationAPI->create_aws_account: #{e}"
end
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
DELETE https://api.datadoghq.com/api/v1/integration/aws/filteringNot supported in the EU regionNot supported in the GOV regionNot supported in the US3 region
タグのフィルタリングエントリを削除します。
特定の AWS アカウントと dd-aws
ネームスペースのタグフィルタリングエントリを削除します。
{
"account_id": "FAKEAC0FAKEAC2FAKEAC",
"namespace": "string"
}
OK
{}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication Error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X DELETE "https://api.datadoghq.com/api/v1/integration/aws/filtering" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{}
EOF
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
body := *datadog.NewAWSTagFilterDeleteRequest() // AWSTagFilterDeleteRequest | Delete a tag filtering entry for a given AWS account and `dd-aws` namespace.
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.AWSIntegrationApi.DeleteAWSTagFilter(ctx).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.DeleteAWSTagFilter``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteAWSTagFilter`: interface{}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from AWSIntegrationApi.DeleteAWSTagFilter:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
go run "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.AwsIntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);
AWSTagFilterDeleteRequest body = new AWSTagFilterDeleteRequest(); // AWSTagFilterDeleteRequest | Delete a tag filtering entry for a given AWS account and `dd-aws` namespace.
try {
Object result = apiInstance.deleteAWSTagFilter(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AwsIntegrationApi#deleteAWSTagFilter");
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:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
java "Example.java"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import aws_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = aws_integration_api.AWSIntegrationApi(api_client)
body = AWSTagFilterDeleteRequest(
account_id="FAKEAC0FAKEAC2FAKEAC",
namespace=AWSNamespace("elb"),
) # AWSTagFilterDeleteRequest | Delete a tag filtering entry for a given AWS account and `dd-aws` namespace.
# example passing only required values which don't have defaults set
try:
# Delete a tag filtering entry
api_response = api_instance.delete_aws_tag_filter(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AWSIntegrationApi->delete_aws_tag_filter: %s\n" % e)
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
body = DatadogAPIClient::V1::AWSTagFilterDeleteRequest.new # AWSTagFilterDeleteRequest | Delete a tag filtering entry for a given AWS account and `dd-aws` namespace.
begin
# Delete a tag filtering entry
result = api_instance.delete_aws_tag_filter(body)
p result
rescue DatadogAPIClient::V1::APIError => e
puts "Error when calling AWSIntegrationAPI->delete_aws_tag_filter: #{e}"
end
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
DELETE https://api.datadoghq.eu/api/v1/integration/awshttps://api.ddog-gov.com/api/v1/integration/awshttps://api.datadoghq.com/api/v1/integration/awshttps://api.us3.datadoghq.com/api/v1/integration/aws
指定の account_id
と role_name parameters
に一致する Datadog-AWS インテグレーションを削除します。
AWS リクエストオブジェクト
フィールド
種類
説明
access_key_id
string
Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.
account_id
string
Your AWS Account ID without dashes.
account_specific_namespace_rules
object
An object, (in the form {"namespace1":true/false, "namespace2":true/false}
),
that enables or disables metric collection for specific AWS namespaces for this
AWS account only.
<any-key>
boolean
A list of additional properties.
excluded_regions
[string]
An array of AWS regions to exclude from metrics collection.
filter_tags
[string]
The array of EC2 tags (in the form key:value
) defines a filter that Datadog uses when collecting metrics from EC2.
Wildcards, such as ?
(for single characters) and *
(for multiple characters) can also be used.
Only hosts that match one of the defined tags
will be imported into Datadog. The rest will be ignored.
Host matching a given tag can also be excluded by adding !
before the tag.
For example, env:production,instance-type:c1.*,!region:us-east-1
host_tags
[string]
Array of tags (in the form key:value
) to add to all hosts
and metrics reporting through this integration.
role_name
string
Your Datadog role delegation name.
secret_access_key
string
Your AWS secret access key. Only required if your AWS account is a GovCloud or China account.
{
"access_key_id": "string",
"account_id": "1234567",
"account_specific_namespace_rules": {
"<any-key>": false
},
"excluded_regions": [
"us-east-1",
"us-west-2"
],
"filter_tags": [
"<KEY>:<VALUE>"
],
"host_tags": [
"<KEY>:<VALUE>"
],
"role_name": "DatadogAWSIntegrationRole",
"secret_access_key": "string"
}
OK
{}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication Error
Error response object.
{
"errors": [
"Bad Request"
]
}
Conflict Error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X DELETE "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/aws" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{}
EOF
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
body := *datadog.NewAWSAccount() // AWSAccount | AWS request object
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.AWSIntegrationApi.DeleteAWSAccount(ctx).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.DeleteAWSAccount``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteAWSAccount`: interface{}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from AWSIntegrationApi.DeleteAWSAccount:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
go run "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.AwsIntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);
AWSAccount body = new AWSAccount(); // AWSAccount | AWS request object
try {
Object result = apiInstance.deleteAWSAccount(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AwsIntegrationApi#deleteAWSAccount");
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:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
java "Example.java"
from datadog import initialize, api
options = {
'api_key': '<DATADOG_API_KEY>',
'app_key': '<DATADOG_APPLICATION_KEY>'
}
initialize(**options)
account_id = "<AWS_ACCOUNT_ID>"
role_name = "<AWS_ROLE_NAME>"
api.AwsIntegration.delete(account_id=account_id, role_name=role_name)
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python "example.py"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import aws_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = aws_integration_api.AWSIntegrationApi(api_client)
body = AWSAccount(
access_key_id="access_key_id_example",
account_id="1234567",
account_specific_namespace_rules={
"key": True,
},
excluded_regions=["us-east-1","us-west-2"],
filter_tags=["<KEY>:<VALUE>"],
host_tags=["<KEY>:<VALUE>"],
role_name="DatadogAWSIntegrationRole",
secret_access_key="secret_access_key_example",
) # AWSAccount | AWS request object
# example passing only required values which don't have defaults set
try:
# Delete an AWS integration
api_response = api_instance.delete_aws_account(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AWSIntegrationApi->delete_aws_account: %s\n" % e)
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python3 "example.py"
require 'rubygems'
require 'dogapi'
api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'
config = {
"account_id": '<AWS_ACCOUNT_ID>',
"role_name": 'DatadogAWSIntegrationRole'
}
dog = Dogapi::Client.new(api_key, app_key)
dog.aws_integration_delete(config)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
body = DatadogAPIClient::V1::AWSAccount.new # AWSAccount | AWS request object
begin
# Delete an AWS integration
result = api_instance.delete_aws_account(body)
p result
rescue DatadogAPIClient::V1::APIError => e
puts "Error when calling AWSIntegrationAPI->delete_aws_account: #{e}"
end
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
PUT https://api.datadoghq.eu/api/v1/integration/aws/generate_new_external_idhttps://api.ddog-gov.com/api/v1/integration/aws/generate_new_external_idhttps://api.datadoghq.com/api/v1/integration/aws/generate_new_external_idhttps://api.us3.datadoghq.com/api/v1/integration/aws/generate_new_external_id
特定の AWS アカウント ID/ロール名ペアに対して新しい AWS 外部 ID を作成します。
Datadog ロールの委任名です。 AWS アカウントのロール名の詳細については、 Datadog AWS インテグレーションのコンフィギュレーション情報を参照してください。
フィールド
種類
説明
access_key_id
string
Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.
account_id
string
Your AWS Account ID without dashes.
account_specific_namespace_rules
object
An object, (in the form {"namespace1":true/false, "namespace2":true/false}
),
that enables or disables metric collection for specific AWS namespaces for this
AWS account only.
<any-key>
boolean
A list of additional properties.
excluded_regions
[string]
An array of AWS regions to exclude from metrics collection.
filter_tags
[string]
The array of EC2 tags (in the form key:value
) defines a filter that Datadog uses when collecting metrics from EC2.
Wildcards, such as ?
(for single characters) and *
(for multiple characters) can also be used.
Only hosts that match one of the defined tags
will be imported into Datadog. The rest will be ignored.
Host matching a given tag can also be excluded by adding !
before the tag.
For example, env:production,instance-type:c1.*,!region:us-east-1
host_tags
[string]
Array of tags (in the form key:value
) to add to all hosts
and metrics reporting through this integration.
role_name
string
Your Datadog role delegation name.
secret_access_key
string
Your AWS secret access key. Only required if your AWS account is a GovCloud or China account.
{
"access_key_id": "string",
"account_id": "1234567",
"account_specific_namespace_rules": {
"<any-key>": false
},
"excluded_regions": [
"us-east-1",
"us-west-2"
],
"filter_tags": [
"<KEY>:<VALUE>"
],
"host_tags": [
"<KEY>:<VALUE>"
],
"role_name": "DatadogAWSIntegrationRole",
"secret_access_key": "string"
}
OK
The Response returned by the AWS Create Account call.
{
"external_id": "string"
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication Error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X PUT "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/aws/generate_new_external_id" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{}
EOF
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
body := *datadog.NewAWSAccount() // AWSAccount | Your Datadog role delegation name. For more information about your AWS account Role name, see the [Datadog AWS integration configuration info](https://github.com/DataDog/documentation/blob/master/integrations/amazon_web_services/#installation).
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.AWSIntegrationApi.CreateNewAWSExternalID(ctx).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.CreateNewAWSExternalID``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateNewAWSExternalID`: AWSAccountCreateResponse
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from AWSIntegrationApi.CreateNewAWSExternalID:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
go run "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.AwsIntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);
AWSAccount body = new AWSAccount(); // AWSAccount | Your Datadog role delegation name. For more information about your AWS account Role name, see the [Datadog AWS integration configuration info](https://github.com/DataDog/documentation/blob/master/integrations/amazon_web_services/#installation).
try {
AWSAccountCreateResponse result = apiInstance.createNewAWSExternalID(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AwsIntegrationApi#createNewAWSExternalID");
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:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
java "Example.java"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import aws_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = aws_integration_api.AWSIntegrationApi(api_client)
body = AWSAccount(
access_key_id="access_key_id_example",
account_id="1234567",
account_specific_namespace_rules={
"key": True,
},
excluded_regions=["us-east-1","us-west-2"],
filter_tags=["<KEY>:<VALUE>"],
host_tags=["<KEY>:<VALUE>"],
role_name="DatadogAWSIntegrationRole",
secret_access_key="secret_access_key_example",
) # AWSAccount | Your Datadog role delegation name. For more information about your AWS account Role name, see the [Datadog AWS integration configuration info](https://github.com/DataDog/documentation/blob/master/integrations/amazon_web_services/#installation).
# example passing only required values which don't have defaults set
try:
# Generate a new external ID
api_response = api_instance.create_new_aws_external_id(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AWSIntegrationApi->create_new_aws_external_id: %s\n" % e)
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
body = DatadogAPIClient::V1::AWSAccount.new # AWSAccount | Your Datadog role delegation name. For more information about your AWS account Role name, see the [Datadog AWS integration configuration info](https://github.com/DataDog/documentation/blob/master/integrations/amazon_web_services/#installation).
begin
# Generate a new external ID
result = api_instance.create_new_aws_external_id(body)
p result
rescue DatadogAPIClient::V1::APIError => e
puts "Error when calling AWSIntegrationAPI->create_new_aws_external_id: #{e}"
end
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
GET https://api.datadoghq.com/api/v1/integration/aws/filteringNot supported in the EU regionNot supported in the GOV regionNot supported in the US3 region
すべての AWS タグフィルターを取得します。
名前
種類
説明
account_id [required]
string
Only return AWS filters that matches this account_id
.
OK
An array of tag filter rules by namespace
and tag filter string.
フィールド
種類
説明
filters
[object]
An array of tag filters.
namespace
enum
The namespace associated with the tag filter entry.
Allowed enum values: elb,application_elb,sqs,rds,custom,network_elb,lambda
tag_filter_str
string
The tag filter string.
{
"filters": [
{
"namespace": "string",
"tag_filter_str": "prod*"
}
]
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication Error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Required query arguments
export account_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.datadoghq.com/api/v1/integration/aws/filtering?account_id=${account_id}" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
accountId := "accountId_example" // string | Only return AWS filters that matches this `account_id`.
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.AWSIntegrationApi.ListAWSTagFilters(ctx).AccountId(accountId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.ListAWSTagFilters``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListAWSTagFilters`: AWSTagFilterListResponse
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from AWSIntegrationApi.ListAWSTagFilters:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
go run "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.AwsIntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);
String accountId = "accountId_example"; // String | Only return AWS filters that matches this `account_id`.
try {
AWSTagFilterListResponse result = apiInstance.listAWSTagFilters(accountId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AwsIntegrationApi#listAWSTagFilters");
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:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
java "Example.java"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import aws_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = aws_integration_api.AWSIntegrationApi(api_client)
account_id = "account_id_example" # str | Only return AWS filters that matches this `account_id`.
# example passing only required values which don't have defaults set
try:
# Get all AWS tag filters
api_response = api_instance.list_aws_tag_filters(account_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AWSIntegrationApi->list_aws_tag_filters: %s\n" % e)
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
account_id = 'account_id_example' # String | Only return AWS filters that matches this `account_id`.
begin
# Get all AWS tag filters
result = api_instance.list_aws_tag_filters(account_id)
p result
rescue DatadogAPIClient::V1::APIError => e
puts "Error when calling AWSIntegrationAPI->list_aws_tag_filters: #{e}"
end
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
GET https://api.datadoghq.eu/api/v1/integration/awshttps://api.ddog-gov.com/api/v1/integration/awshttps://api.datadoghq.com/api/v1/integration/awshttps://api.us3.datadoghq.com/api/v1/integration/aws
Datadog Organization で使用できるすべての Datadog-AWS インテグレーションをリストします。
名前
種類
説明
account_id
string
Only return AWS accounts that matches this account_id
.
role_name
string
Only return AWS accounts that matches this role_name.
access_key_id
string
Only return AWS accounts that matches this access_key_id
.
OK
List of enabled AWS accounts.
フィールド
種類
説明
accounts
[object]
List of enabled AWS accounts.
access_key_id
string
Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.
account_id
string
Your AWS Account ID without dashes.
account_specific_namespace_rules
object
An object, (in the form {"namespace1":true/false, "namespace2":true/false}
),
that enables or disables metric collection for specific AWS namespaces for this
AWS account only.
<any-key>
boolean
A list of additional properties.
excluded_regions
[string]
An array of AWS regions to exclude from metrics collection.
filter_tags
[string]
The array of EC2 tags (in the form key:value
) defines a filter that Datadog uses when collecting metrics from EC2.
Wildcards, such as ?
(for single characters) and *
(for multiple characters) can also be used.
Only hosts that match one of the defined tags
will be imported into Datadog. The rest will be ignored.
Host matching a given tag can also be excluded by adding !
before the tag.
For example, env:production,instance-type:c1.*,!region:us-east-1
host_tags
[string]
Array of tags (in the form key:value
) to add to all hosts
and metrics reporting through this integration.
role_name
string
Your Datadog role delegation name.
secret_access_key
string
Your AWS secret access key. Only required if your AWS account is a GovCloud or China account.
{
"accounts": [
{
"access_key_id": "string",
"account_id": "1234567",
"account_specific_namespace_rules": {
"<any-key>": false
},
"excluded_regions": [
"us-east-1",
"us-west-2"
],
"filter_tags": [
"<KEY>:<VALUE>"
],
"host_tags": [
"<KEY>:<VALUE>"
],
"role_name": "DatadogAWSIntegrationRole",
"secret_access_key": "string"
}
]
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication Error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/aws" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
accountId := "accountId_example" // string | Only return AWS accounts that matches this `account_id`. (optional)
roleName := "roleName_example" // string | Only return AWS accounts that matches this role_name. (optional)
accessKeyId := "accessKeyId_example" // string | Only return AWS accounts that matches this `access_key_id`. (optional)
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.AWSIntegrationApi.ListAWSAccounts(ctx).AccountId(accountId).RoleName(roleName).AccessKeyId(accessKeyId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.ListAWSAccounts``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListAWSAccounts`: AWSAccountListResponse
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from AWSIntegrationApi.ListAWSAccounts:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
go run "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.AwsIntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);
String accountId = "accountId_example"; // String | Only return AWS accounts that matches this `account_id`.
String roleName = "roleName_example"; // String | Only return AWS accounts that matches this role_name.
String accessKeyId = "accessKeyId_example"; // String | Only return AWS accounts that matches this `access_key_id`.
try {
AWSAccountListResponse result = apiInstance.listAWSAccounts(new AwsIntegrationApi.ListAWSAccountsOptionalParameters()
.accountId(accountId)
.roleName(roleName)
.accessKeyId(accessKeyId));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AwsIntegrationApi#listAWSAccounts");
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:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
java "Example.java"
from datadog import initialize, api
options = {
'api_key': '<DATADOG_API_KEY>',
'app_key': '<DATADOG_APPLICATION_KEY>'
}
initialize(**options)
api.AwsIntegration.list()
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python "example.py"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import aws_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = aws_integration_api.AWSIntegrationApi(api_client)
account_id = "account_id_example" # str | Only return AWS accounts that matches this `account_id`. (optional)
role_name = "role_name_example" # str | Only return AWS accounts that matches this role_name. (optional)
access_key_id = "access_key_id_example" # str | Only return AWS accounts that matches this `access_key_id`. (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# List all AWS integrations
api_response = api_instance.list_aws_accounts(account_id=account_id, role_name=role_name, access_key_id=access_key_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AWSIntegrationApi->list_aws_accounts: %s\n" % e)
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python3 "example.py"
require 'rubygems'
require 'dogapi'
api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'
dog = Dogapi::Client.new(api_key, app_key)
dog.aws_integration_list
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
opts = {
account_id: 'account_id_example', # String | Only return AWS accounts that matches this `account_id`.
role_name: 'role_name_example', # String | Only return AWS accounts that matches this role_name.
access_key_id: 'access_key_id_example' # String | Only return AWS accounts that matches this `access_key_id`.
}
begin
# List all AWS integrations
result = api_instance.list_aws_accounts(opts)
p result
rescue DatadogAPIClient::V1::APIError => e
puts "Error when calling AWSIntegrationAPI->list_aws_accounts: #{e}"
end
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
GET https://api.datadoghq.eu/api/v1/integration/aws/available_namespace_ruleshttps://api.ddog-gov.com/api/v1/integration/aws/available_namespace_ruleshttps://api.datadoghq.com/api/v1/integration/aws/available_namespace_ruleshttps://api.us3.datadoghq.com/api/v1/integration/aws/available_namespace_rules
特定の Datadog-AWS インテグレーションのすべてのネームスペース規則をリストします。このエンドポイントは引数を受け取りません。
OK
[
"namespace1",
"namespace2",
"namespace3"
]
Authentication Error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/aws/available_namespace_rules" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.AWSIntegrationApi.ListAvailableAWSNamespaces(ctx).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.ListAvailableAWSNamespaces``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListAvailableAWSNamespaces`: []string
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from AWSIntegrationApi.ListAvailableAWSNamespaces:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
go run "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.AwsIntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);
try {
List<String> result = apiInstance.listAvailableAWSNamespaces();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AwsIntegrationApi#listAvailableAWSNamespaces");
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:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
java "Example.java"
from datadog import initialize, api
options = {
'api_key': '<DATADOG_API_KEY>',
'app_key': '<DATADOG_APPLICATION_KEY>'
}
initialize(**options)
api.AwsIntegration.list_namespace_rules()
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python "example.py"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import aws_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = aws_integration_api.AWSIntegrationApi(api_client)
# example, this endpoint has no required or optional parameters
try:
# List namespace rules
api_response = api_instance.list_available_aws_namespaces()
pprint(api_response)
except ApiException as e:
print("Exception when calling AWSIntegrationApi->list_available_aws_namespaces: %s\n" % e)
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python3 "example.py"
require 'rubygems'
require 'dogapi'
api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'
dog = Dogapi::Client.new(api_key, app_key)
dog.aws_integration_list_namespaces
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
begin
# List namespace rules
result = api_instance.list_available_aws_namespaces
p result
rescue DatadogAPIClient::V1::APIError => e
puts "Error when calling AWSIntegrationAPI->list_available_aws_namespaces: #{e}"
end
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
POST https://api.datadoghq.com/api/v1/integration/aws/filteringNot supported in the EU regionNot supported in the GOV regionNot supported in the US3 region
AWS タグフィルターを設定します。
aws_account_identifier
、namespace
、フィルタリング文字列を使用して、AWS タブフィルターを設定します。
ネームスペースには、application_elb
、elb
、lambda
、network_elb
、rds
、sqs
、custom
を使用できます。
{
"account_id": "1234567",
"namespace": "string",
"tag_filter_str": "prod*"
}
OK
{}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication Error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.datadoghq.com/api/v1/integration/aws/filtering" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{}
EOF
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
body := *datadog.NewAWSTagFilterCreateRequest() // AWSTagFilterCreateRequest | Set an AWS tag filter using an `aws_account_identifier`, `namespace`, and filtering string. Namespace options are `application_elb`, `elb`, `lambda`, `network_elb`, `rds`, `sqs`, and `custom`.
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.AWSIntegrationApi.CreateAWSTagFilter(ctx).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.CreateAWSTagFilter``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateAWSTagFilter`: interface{}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from AWSIntegrationApi.CreateAWSTagFilter:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
go run "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.AwsIntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);
AWSTagFilterCreateRequest body = new AWSTagFilterCreateRequest(); // AWSTagFilterCreateRequest | Set an AWS tag filter using an `aws_account_identifier`, `namespace`, and filtering string. Namespace options are `application_elb`, `elb`, `lambda`, `network_elb`, `rds`, `sqs`, and `custom`.
try {
Object result = apiInstance.createAWSTagFilter(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AwsIntegrationApi#createAWSTagFilter");
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:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
java "Example.java"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import aws_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = aws_integration_api.AWSIntegrationApi(api_client)
body = AWSTagFilterCreateRequest(
account_id="1234567",
namespace=AWSNamespace("elb"),
tag_filter_str="prod*",
) # AWSTagFilterCreateRequest | Set an AWS tag filter using an `aws_account_identifier`, `namespace`, and filtering string. Namespace options are `application_elb`, `elb`, `lambda`, `network_elb`, `rds`, `sqs`, and `custom`.
# example passing only required values which don't have defaults set
try:
# Set an AWS tag filter
api_response = api_instance.create_aws_tag_filter(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AWSIntegrationApi->create_aws_tag_filter: %s\n" % e)
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
body = DatadogAPIClient::V1::AWSTagFilterCreateRequest.new # AWSTagFilterCreateRequest | Set an AWS tag filter using an `aws_account_identifier`, `namespace`, and filtering string. Namespace options are `application_elb`, `elb`, `lambda`, `network_elb`, `rds`, `sqs`, and `custom`.
begin
# Set an AWS tag filter
result = api_instance.create_aws_tag_filter(body)
p result
rescue DatadogAPIClient::V1::APIError => e
puts "Error when calling AWSIntegrationAPI->create_aws_tag_filter: #{e}"
end
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comNot supported in the US3 regionNot supported in the EU regionNot supported in the US1-FED region" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"
PUT https://api.datadoghq.eu/api/v1/integration/awshttps://api.ddog-gov.com/api/v1/integration/awshttps://api.datadoghq.com/api/v1/integration/awshttps://api.us3.datadoghq.com/api/v1/integration/aws
Datadog-Amazon Web Services インテグレーションを更新します。
名前
種類
説明
account_id
string
Only return AWS accounts that matches this account_id
.
role_name
string
Only return AWS accounts that match this role_name
.
Required if account_id
is specified.
access_key_id
string
Only return AWS accounts that matches this access_key_id
.
Required if none of the other two options are specified.
AWS リクエストオブジェクト
フィールド
種類
説明
access_key_id
string
Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.
account_id
string
Your AWS Account ID without dashes.
account_specific_namespace_rules
object
An object, (in the form {"namespace1":true/false, "namespace2":true/false}
),
that enables or disables metric collection for specific AWS namespaces for this
AWS account only.
<any-key>
boolean
A list of additional properties.
excluded_regions
[string]
An array of AWS regions to exclude from metrics collection.
filter_tags
[string]
The array of EC2 tags (in the form key:value
) defines a filter that Datadog uses when collecting metrics from EC2.
Wildcards, such as ?
(for single characters) and *
(for multiple characters) can also be used.
Only hosts that match one of the defined tags
will be imported into Datadog. The rest will be ignored.
Host matching a given tag can also be excluded by adding !
before the tag.
For example, env:production,instance-type:c1.*,!region:us-east-1
host_tags
[string]
Array of tags (in the form key:value
) to add to all hosts
and metrics reporting through this integration.
role_name
string
Your Datadog role delegation name.
secret_access_key
string
Your AWS secret access key. Only required if your AWS account is a GovCloud or China account.
{
"access_key_id": "string",
"account_id": "1234567",
"account_specific_namespace_rules": {
"<any-key>": false
},
"excluded_regions": [
"us-east-1",
"us-west-2"
],
"filter_tags": [
"<KEY>:<VALUE>"
],
"host_tags": [
"<KEY>:<VALUE>"
],
"role_name": "DatadogAWSIntegrationRole",
"secret_access_key": "string"
}
OK
{}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication Error
Error response object.
{
"errors": [
"Bad Request"
]
}
Conflict Error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X PUT "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v1/integration/aws" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{}
EOF
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
body := *datadog.NewAWSAccount() // AWSAccount | AWS request object
accountId := "accountId_example" // string | Only return AWS accounts that matches this `account_id`. (optional)
roleName := "roleName_example" // string | Only return AWS accounts that match this `role_name`. Required if `account_id` is specified. (optional)
accessKeyId := "accessKeyId_example" // string | Only return AWS accounts that matches this `access_key_id`. Required if none of the other two options are specified. (optional)
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.AWSIntegrationApi.UpdateAWSAccount(ctx).Body(body).AccountId(accountId).RoleName(roleName).AccessKeyId(accessKeyId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.UpdateAWSAccount``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateAWSAccount`: interface{}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from AWSIntegrationApi.UpdateAWSAccount:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
go run "main.go"
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.auth.*;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.AwsIntegrationApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);
AWSAccount body = new AWSAccount(); // AWSAccount | AWS request object
String accountId = "accountId_example"; // String | Only return AWS accounts that matches this `account_id`.
String roleName = "roleName_example"; // String | Only return AWS accounts that match this `role_name`. Required if `account_id` is specified.
String accessKeyId = "accessKeyId_example"; // String | Only return AWS accounts that matches this `access_key_id`. Required if none of the other two options are specified.
try {
Object result = apiInstance.updateAWSAccount(body, new AwsIntegrationApi.UpdateAWSAccountOptionalParameters()
.accountId(accountId)
.roleName(roleName)
.accessKeyId(accessKeyId));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AwsIntegrationApi#updateAWSAccount");
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:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
java "Example.java"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import aws_integration_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = aws_integration_api.AWSIntegrationApi(api_client)
body = AWSAccount(
access_key_id="access_key_id_example",
account_id="1234567",
account_specific_namespace_rules={
"key": True,
},
excluded_regions=["us-east-1","us-west-2"],
filter_tags=["<KEY>:<VALUE>"],
host_tags=["<KEY>:<VALUE>"],
role_name="DatadogAWSIntegrationRole",
secret_access_key="secret_access_key_example",
) # AWSAccount | AWS request object
account_id = "account_id_example" # str | Only return AWS accounts that matches this `account_id`. (optional)
role_name = "role_name_example" # str | Only return AWS accounts that match this `role_name`. Required if `account_id` is specified. (optional)
access_key_id = "access_key_id_example" # str | Only return AWS accounts that matches this `access_key_id`. Required if none of the other two options are specified. (optional)
# example passing only required values which don't have defaults set
try:
# Update an AWS integration
api_response = api_instance.update_aws_account(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AWSIntegrationApi->update_aws_account: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Update an AWS integration
api_response = api_instance.update_aws_account(body, account_id=account_id, role_name=role_name, access_key_id=access_key_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling AWSIntegrationApi->update_aws_account: %s\n" % e)
First install the library and its dependencies and then save the example to example.py
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
python3 "example.py"
require 'datadog_api_client'
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
body = DatadogAPIClient::V1::AWSAccount.new # AWSAccount | AWS request object
opts = {
account_id: 'account_id_example', # String | Only return AWS accounts that matches this `account_id`.
role_name: 'role_name_example', # String | Only return AWS accounts that match this `role_name`. Required if `account_id` is specified.
access_key_id: 'access_key_id_example' # String | Only return AWS accounts that matches this `access_key_id`. Required if none of the other two options are specified.
}
begin
# Update an AWS integration
result = api_instance.update_aws_account(body, opts)
p result
rescue DatadogAPIClient::V1::APIError => e
puts "Error when calling AWSIntegrationAPI->update_aws_account: #{e}"
end
First install the library and its dependencies and then save the example to example.rb
and run following commands:
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>"
rb "example.rb"