Get detailed information about an agent
https://api.datadoghq.com/api/v2/fleet/agents/{agent_key}https://api.us3.datadoghq.com/api/v2/fleet/agents/{agent_key}https://api.us5.datadoghq.com/api/v2/fleet/agents/{agent_key}https://api.datadoghq.eu/api/v2/fleet/agents/{agent_key}https://api.ap1.datadoghq.com/api/v2/fleet/agents/{agent_key}https://api.ap2.datadoghq.com/api/v2/fleet/agents/{agent_key}https://api.uk1.datadoghq.com/api/v2/fleet/agents/{agent_key}https://api.ddog-gov.com/api/v2/fleet/agents/{agent_key}https://api.us2.ddog-gov.com/api/v2/fleet/agents/{agent_key}Présentation
Retrieve detailed information about a specific Datadog Agent.
By default, only agent_infos is returned. Use the include query parameter to
request additional data: integrations and/or configuration_files.
Arguments
Paramètres du chemin
agent_key [required]The unique identifier (Agent key) for the Datadog Agent. Must be a 32-character lowercase hexadecimal string.
Chaînes de requête
includeComma-separated list of additional fields to include in the response. Valid values are integrations and configuration_files. Omitting this parameter returns only agent_infos. Unrecognized values are silently ignored rather than causing an error.
Réponse
OK
Response containing detailed information about a specific Datadog Agent.
data [required]Detailed information about a specific Datadog Agent.
attributes [required]Attributes for the v2 agent detail response.
agent_infos [required]Detailed information about a Datadog Agent.
active_ha_agentThe currently active agent in the high-availability group.
agent_versionThe Datadog Agent version.
api_key_nameThe API key name (if available and not redacted).
api_key_uuidThe API key UUID.
cloud_providerThe cloud provider where the agent is running.
cluster_nameKubernetes cluster name (if applicable).
config_idThe configuration identifier applied to the agent.
datadog_agent_keyThe unique agent key identifier.
datadog_data_centerThe Datadog data center the agent reports to.
ecs_fargate_cluster_nameThe ECS Fargate cluster name, if the agent runs in an ECS Fargate environment.
ecs_fargate_task_arnThe ECS Fargate task ARN, if the agent runs in an ECS Fargate environment.
enabled_productsDatadog products enabled on the agent.
envEnvironments the agent is reporting from.
first_seen_atTimestamp when the agent was first seen.
ha_agent_hostsHosts participating in the agent's high-availability group.
ha_agent_stateThe high-availability state of the agent.
hostnameThe hostname of the agent.
hostname_aliasesAlternative hostname list for the agent.
install_method_installer_versionThe version of the installer used.
install_method_toolThe tool used to install the agent.
ip_addressesIP addresses of the agent.
is_single_step_instrumentation_enabledWhether single-step instrumentation is enabled.
last_restart_atTimestamp of the last agent restart.
osThe operating system.
os_versionThe operating system version.
otel_collectorsOpenTelemetry collectors associated with the agent (if applicable).
pod_nameKubernetes pod name (if applicable).
preferred_ha_active_agentThe preferred active agent in the high-availability group.
python_versionThe Python version used by the agent.
regionRegions where the agent is running.
remote_agent_managementRemote agent management status.
remote_config_statusRemote configuration status.
servicesServices running on the agent.
support_agent_upgradeWhether the agent supports remote agent upgrade.
tagsTags associated with the agent.
teamTeam associated with the agent.
configuration_filesConfiguration file details, present only when configuration_files is included in the include query parameter.
agent_configurationConfiguration information organized by layers.
compiled_configurationThe final compiled configuration.
env_configurationConfiguration from environment variables.
file_configurationConfiguration from files.
remote_configurationRemote configuration settings.
runtime_configurationRuntime configuration.
application_monitoring_configurationConfiguration information organized by layers.
compiled_configurationThe final compiled configuration.
env_configurationConfiguration from environment variables.
file_configurationConfiguration from files.
remote_configurationRemote configuration settings.
runtime_configurationRuntime configuration.
otel_collectors_configurationConfiguration for OpenTelemetry collectors associated with the agent. Present only when the agent has associated OpenTelemetry collectors.
collector_idThe unique identifier of the OpenTelemetry collector.
compiled_configurationThe final compiled configuration of the OpenTelemetry collector.
distributionThe distribution of the OpenTelemetry collector.
security_agent_configurationConfiguration information organized by layers.
compiled_configurationThe final compiled configuration.
env_configurationConfiguration from environment variables.
file_configurationConfiguration from files.
remote_configurationRemote configuration settings.
runtime_configurationRuntime configuration.
system_probe_configurationConfiguration information organized by layers.
compiled_configurationThe final compiled configuration.
env_configurationConfiguration from environment variables.
file_configurationConfiguration from files.
remote_configurationRemote configuration settings.
runtime_configurationRuntime configuration.
integrationsIntegration details, present only when integrations is included in the include query parameter.
configuration_filesConfiguration files for integrations.
agent_hashHash of the configuration file as seen by the agent.
file_contentThe raw content of the configuration file.
file_pathPath to the configuration file.
filenameName of the configuration file.
error_integrationsIntegrations with errors.
data_typeType of data collected, such as metrics or logs.
error_messagesError messages if the integration has issues.
init_configInitialization configuration (YAML format).
instance_configInstance-specific configuration (YAML format).
is_custom_checkWhether this is a custom integration.
is_defaultWhether this is a default integration instance.
is_initWhether this integration configuration is an init config.
log_configLog collection configuration (YAML format).
nameName of the integration instance.
pod_countNumber of pods running this integration. Absent from the response when the count is zero.
source_indexIndex in the configuration file.
source_pathPath to the configuration file.
typeIntegration type.
missing_integrationsDetected but not configured integrations.
escaped_nameEscaped integration name.
prefixIntegration prefix identifier.
warning_integrationsIntegrations with warnings.
data_typeType of data collected, such as metrics or logs.
error_messagesError messages if the integration has issues.
init_configInitialization configuration (YAML format).
instance_configInstance-specific configuration (YAML format).
is_custom_checkWhether this is a custom integration.
is_defaultWhether this is a default integration instance.
is_initWhether this integration configuration is an init config.
log_configLog collection configuration (YAML format).
nameName of the integration instance.
pod_countNumber of pods running this integration. Absent from the response when the count is zero.
source_indexIndex in the configuration file.
source_pathPath to the configuration file.
typeIntegration type.
working_integrationsIntegrations that are working correctly.
data_typeType of data collected, such as metrics or logs.
error_messagesError messages if the integration has issues.
init_configInitialization configuration (YAML format).
instance_configInstance-specific configuration (YAML format).
is_custom_checkWhether this is a custom integration.
is_defaultWhether this is a default integration instance.
is_initWhether this integration configuration is an init config.
log_configLog collection configuration (YAML format).
nameName of the integration instance.
pod_countNumber of pods running this integration. Absent from the response when the count is zero.
source_indexIndex in the configuration file.
source_pathPath to the configuration file.
typeIntegration type.
id [required]The unique agent key identifier.
type [required]The type of the agent resource.
agentagent{
"data": {
"attributes": {
"agent_infos": {
"active_ha_agent": "string",
"agent_version": "7.50.0",
"api_key_name": "Production API Key",
"api_key_uuid": "a1b2c3d4-e5f6-4321-a123-123456789abc",
"cloud_provider": "aws",
"cluster_name": "string",
"config_id": "string",
"datadog_agent_key": "a1b2c3d4e5f67890a1b2c3d4e5f67890",
"datadog_data_center": "us1",
"ecs_fargate_cluster_name": "my-ecs-cluster",
"ecs_fargate_task_arn": "arn:aws:ecs:us-east-1:123456789012:task/my-cluster/abc123",
"enabled_products": [],
"env": [],
"first_seen_at": "integer",
"ha_agent_hosts": [],
"ha_agent_state": "string",
"hostname": "my-hostname",
"hostname_aliases": [],
"install_method_installer_version": "1.2.3",
"install_method_tool": "chef",
"ip_addresses": [],
"is_single_step_instrumentation_enabled": false,
"last_restart_at": "integer",
"os": "linux",
"os_version": "Ubuntu 20.04",
"otel_collectors": [],
"pod_name": "string",
"preferred_ha_active_agent": "string",
"python_version": "3.9.5",
"region": [],
"remote_agent_management": "enabled",
"remote_config_status": "connected",
"services": [],
"support_agent_upgrade": false,
"tags": [],
"team": "string"
},
"configuration_files": {
"agent_configuration": {
"compiled_configuration": "string",
"env_configuration": "string",
"file_configuration": "string",
"remote_configuration": "string",
"runtime_configuration": "string"
},
"application_monitoring_configuration": {
"compiled_configuration": "string",
"env_configuration": "string",
"file_configuration": "string",
"remote_configuration": "string",
"runtime_configuration": "string"
},
"otel_collectors_configuration": [
{
"collector_id": "string",
"compiled_configuration": "string",
"distribution": "string"
}
],
"security_agent_configuration": {
"compiled_configuration": "string",
"env_configuration": "string",
"file_configuration": "string",
"remote_configuration": "string",
"runtime_configuration": "string"
},
"system_probe_configuration": {
"compiled_configuration": "string",
"env_configuration": "string",
"file_configuration": "string",
"remote_configuration": "string",
"runtime_configuration": "string"
}
},
"integrations": {
"configuration_files": [
{
"agent_hash": "string",
"file_content": "string",
"file_path": "/conf.d/postgres.d/postgres.yaml",
"filename": "postgres.yaml"
}
],
"error_integrations": [
{
"data_type": "metrics",
"error_messages": [],
"init_config": "string",
"instance_config": "string",
"is_custom_check": false,
"is_default": false,
"is_init": false,
"log_config": "string",
"name": "string",
"pod_count": "integer",
"source_index": "integer",
"source_path": "string",
"type": "postgres"
}
],
"missing_integrations": [
{
"escaped_name": "postgresql",
"prefix": "postgres"
}
],
"warning_integrations": [
{
"data_type": "metrics",
"error_messages": [],
"init_config": "string",
"instance_config": "string",
"is_custom_check": false,
"is_default": false,
"is_init": false,
"log_config": "string",
"name": "string",
"pod_count": "integer",
"source_index": "integer",
"source_path": "string",
"type": "postgres"
}
],
"working_integrations": [
{
"data_type": "metrics",
"error_messages": [],
"init_config": "string",
"instance_config": "string",
"is_custom_check": false,
"is_default": false,
"is_init": false,
"log_config": "string",
"name": "string",
"pod_count": "integer",
"source_index": "integer",
"source_path": "string",
"type": "postgres"
}
]
}
},
"id": "a1b2c3d4e5f67890a1b2c3d4e5f67890",
"type": "agent"
}
}Bad Request
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Unauthorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Not Found
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Exemple de code
# Path parameters
export agent_key="a1b2c3d4e5f67890a1b2c3d4e5f67890"
# 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/fleet/agents/${agent_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export agent_key="a1b2c3d4e5f67890a1b2c3d4e5f67890"
# 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/fleet/agents/${agent_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export agent_key="a1b2c3d4e5f67890a1b2c3d4e5f67890"
# 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/fleet/agents/${agent_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export agent_key="a1b2c3d4e5f67890a1b2c3d4e5f67890"
# 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/fleet/agents/${agent_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export agent_key="a1b2c3d4e5f67890a1b2c3d4e5f67890"
# 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/fleet/agents/${agent_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export agent_key="a1b2c3d4e5f67890a1b2c3d4e5f67890"
# 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/fleet/agents/${agent_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export agent_key="a1b2c3d4e5f67890a1b2c3d4e5f67890"
# 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/fleet/agents/${agent_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export agent_key="a1b2c3d4e5f67890a1b2c3d4e5f67890"
# 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/fleet/agents/${agent_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export agent_key="a1b2c3d4e5f67890a1b2c3d4e5f67890"
# 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/fleet/agents/${agent_key}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"// Get detailed information about an agent 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()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewFleetAutomationApi(apiClient)
resp, r, err := api.GetFleetAgentDetailV2(ctx, "a1b2c3d4e5f67890a1b2c3d4e5f67890", *datadogV2.NewGetFleetAgentDetailV2OptionalParameters())
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FleetAutomationApi.GetFleetAgentDetailV2`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `FleetAutomationApi.GetFleetAgentDetailV2`:\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"// Get detailed information about an agent returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.FleetAutomationApi;
import com.datadog.api.client.v2.model.FleetAgentDetailV2Response;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient);
try {
FleetAgentDetailV2Response result =
apiInstance.getFleetAgentDetailV2("a1b2c3d4e5f67890a1b2c3d4e5f67890");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FleetAutomationApi#getFleetAgentDetailV2");
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""""
Get detailed information about an agent returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.fleet_automation_api import FleetAutomationApi
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = FleetAutomationApi(api_client)
response = api_instance.get_fleet_agent_detail_v2(
agent_key="a1b2c3d4e5f67890a1b2c3d4e5f67890",
)
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"# Get detailed information about an agent returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
p api_instance.get_fleet_agent_detail_v2("a1b2c3d4e5f67890a1b2c3d4e5f67890")
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"// Get detailed information about an agent returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
use datadog_api_client::datadogV2::api_fleet_automation::GetFleetAgentDetailV2OptionalParams;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = FleetAutomationAPI::with_config(configuration);
let resp = api
.get_fleet_agent_detail_v2(
"a1b2c3d4e5f67890a1b2c3d4e5f67890".to_string(),
GetFleetAgentDetailV2OptionalParams::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/**
* Get detailed information about an agent 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,
},
},
});
const apiInstance = new v2.FleetAutomationApi(configuration);
const params: v2.FleetAutomationApiGetFleetAgentDetailV2Request = {
agentKey: "a1b2c3d4e5f67890a1b2c3d4e5f67890",
};
apiInstance
.getFleetAgentDetailV2(params)
.then((data: v2.FleetAgentDetailV2Response) => {
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"