- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
The Network Device Monitoring API allows you to fetch devices and interfaces and their attributes. See the Network Device Monitoring page for more information.
GET https://api.ap1.datadoghq.com/api/v2/ndm/deviceshttps://api.datadoghq.eu/api/v2/ndm/deviceshttps://api.ddog-gov.com/api/v2/ndm/deviceshttps://api.datadoghq.com/api/v2/ndm/deviceshttps://api.us3.datadoghq.com/api/v2/ndm/deviceshttps://api.us5.datadoghq.com/api/v2/ndm/devices
Get the list of devices.
이름
유형
설명
page[number]
integer
The page number to fetch.
page[size]
integer
The number of devices to return per page.
sort
string
The field to sort the devices by.
filter[tag]
string
Filter devices by tag.
OK
List devices response.
항목
유형
설명
data
[object]
The list devices response data.
attributes
object
The device attributes
description
string
The device description
device_type
string
The device type
integration
string
The device integration
interface_statuses
object
Count of the device interfaces by status
down
int64
The number of interfaces that are down
off
int64
The number of interfaces that are off
up
int64
The number of interfaces that are up
warning
int64
The number of interfaces that are in a warning state
ip_address
string
The device IP address
location
string
The device location
model
string
The device model
name
string
The device name
os_hostname
string
The device OS hostname
os_name
string
The device OS name
os_version
string
The device OS version
ping_status
string
The device ping status
product_name
string
The device product name
serial_number
string
The device serial number
status
string
The device SNMP status
subnet
string
The device subnet
sys_object_id
string
The device sys_object_id
tags
[string]
The list of device tags
vendor
string
The device vendor
version
string
The device version
id
string
The device ID
type
string
The type of the resource. The value should always be device.
meta
object
Object describing meta attributes of response.
page
object
Pagination object.
total_filtered_count
int64
Total count of devices matched by the filter.
{
"data": [
{
"attributes": {
"description": "a device monitored with NDM",
"device_type": "other",
"integration": "snmp",
"interface_statuses": {
"down": "integer",
"off": "integer",
"up": "integer",
"warning": "integer"
},
"ip_address": "1.2.3.4",
"location": "paris",
"model": "xx-123",
"name": "example device",
"os_hostname": "string",
"os_name": "example OS",
"os_version": "1.0.2",
"ping_status": "unmonitored",
"product_name": "example device",
"serial_number": "X12345",
"status": "ok",
"subnet": "1.2.3.4/24",
"sys_object_id": "1.3.6.1.4.1.99999",
"tags": [
"device_ip:1.2.3.4",
"device_id:example:1.2.3.4"
],
"vendor": "example vendor",
"version": "1.2.3"
},
"id": "example:1.2.3.4",
"type": "string"
}
],
"meta": {
"page": {
"total_filtered_count": 1
}
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/ndm/devices" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get the list of devices returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.network_device_monitoring_api import NetworkDeviceMonitoringApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = NetworkDeviceMonitoringApi(api_client)
response = api_instance.list_devices(
page_number=0,
page_size=1,
filter_tag="device_namespace:default",
)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Get the list of devices returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::NetworkDeviceMonitoringAPI.new
opts = {
page_size: 1,
page_number: 0,
filter_tag: "device_namespace:default",
}
p api_instance.list_devices(opts)
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Get the list of devices returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewNetworkDeviceMonitoringApi(apiClient)
resp, r, err := api.ListDevices(ctx, *datadogV2.NewListDevicesOptionalParameters().WithPageSize(1).WithPageNumber(0).WithFilterTag("device_namespace:default"))
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NetworkDeviceMonitoringApi.ListDevices`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `NetworkDeviceMonitoringApi.ListDevices`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Get the list of devices returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.NetworkDeviceMonitoringApi;
import com.datadog.api.client.v2.api.NetworkDeviceMonitoringApi.ListDevicesOptionalParameters;
import com.datadog.api.client.v2.model.ListDevicesResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
NetworkDeviceMonitoringApi apiInstance = new NetworkDeviceMonitoringApi(defaultClient);
try {
ListDevicesResponse result =
apiInstance.listDevices(
new ListDevicesOptionalParameters()
.pageSize(1L)
.pageNumber(0L)
.filterTag("device_namespace:default"));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NetworkDeviceMonitoringApi#listDevices");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
// Get the list of devices returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_network_device_monitoring::ListDevicesOptionalParams;
use datadog_api_client::datadogV2::api_network_device_monitoring::NetworkDeviceMonitoringAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = NetworkDeviceMonitoringAPI::with_config(configuration);
let resp = api
.list_devices(
ListDevicesOptionalParams::default()
.page_size(1)
.page_number(0)
.filter_tag("device_namespace:default".to_string()),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
/**
* Get the list of devices returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.NetworkDeviceMonitoringApi(configuration);
const params: v2.NetworkDeviceMonitoringApiListDevicesRequest = {
pageNumber: 0,
pageSize: 1,
filterTag: "device_namespace:default",
};
apiInstance
.listDevices(params)
.then((data: v2.ListDevicesResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v2/ndm/devices/{device_id}https://api.datadoghq.eu/api/v2/ndm/devices/{device_id}https://api.ddog-gov.com/api/v2/ndm/devices/{device_id}https://api.datadoghq.com/api/v2/ndm/devices/{device_id}https://api.us3.datadoghq.com/api/v2/ndm/devices/{device_id}https://api.us5.datadoghq.com/api/v2/ndm/devices/{device_id}
Get the device details.
이름
유형
설명
device_id [required]
string
The id of the device to fetch.
OK
The GetDevice
operation’s response.
항목
유형
설명
data
object
Get device response data.
attributes
object
The device attributes
description
string
A description of the device.
device_type
string
The type of the device.
integration
string
The integration of the device.
ip_address
string
The IP address of the device.
location
string
The location of the device.
model
string
The model of the device.
name
string
The name of the device.
os_hostname
string
The operating system hostname of the device.
os_name
string
The operating system name of the device.
os_version
string
The operating system version of the device.
ping_status
string
The ping status of the device.
product_name
string
The product name of the device.
serial_number
string
The serial number of the device.
status
string
The status of the device.
subnet
string
The subnet of the device.
sys_object_id
string
The device sys_object_id
.
tags
[string]
A list of tags associated with the device.
vendor
string
The vendor of the device.
version
string
The version of the device.
id
string
The device ID
type
string
The type of the resource. The value should always be device.
{
"data": {
"attributes": {
"description": "a device monitored with NDM",
"device_type": "other",
"integration": "snmp",
"ip_address": "1.2.3.4",
"location": "paris",
"model": "xx-123",
"name": "example device",
"os_hostname": "1.0.2",
"os_name": "example OS",
"os_version": "1.0.2",
"ping_status": "unmonitored",
"product_name": "example device",
"serial_number": "X12345",
"status": "ok",
"subnet": "1.2.3.4/24",
"sys_object_id": "1.3.6.1.4.1.99999",
"tags": [
"device_ip:1.2.3.4",
"device_id:example:1.2.3.4"
],
"vendor": "example vendor",
"version": "1.2.3"
},
"id": "example:1.2.3.4",
"type": "string"
}
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export device_id="example:1.2.3.4"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/ndm/devices/${device_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get the device details returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.network_device_monitoring_api import NetworkDeviceMonitoringApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = NetworkDeviceMonitoringApi(api_client)
response = api_instance.get_device(
device_id="default_device",
)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Get the device details returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::NetworkDeviceMonitoringAPI.new
p api_instance.get_device("default_device")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Get the device details returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewNetworkDeviceMonitoringApi(apiClient)
resp, r, err := api.GetDevice(ctx, "default_device")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NetworkDeviceMonitoringApi.GetDevice`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `NetworkDeviceMonitoringApi.GetDevice`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Get the device details returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.NetworkDeviceMonitoringApi;
import com.datadog.api.client.v2.model.GetDeviceResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
NetworkDeviceMonitoringApi apiInstance = new NetworkDeviceMonitoringApi(defaultClient);
try {
GetDeviceResponse result = apiInstance.getDevice("default_device");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NetworkDeviceMonitoringApi#getDevice");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
// Get the device details returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_network_device_monitoring::NetworkDeviceMonitoringAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = NetworkDeviceMonitoringAPI::with_config(configuration);
let resp = api.get_device("default_device".to_string()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
/**
* Get the device details returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.NetworkDeviceMonitoringApi(configuration);
const params: v2.NetworkDeviceMonitoringApiGetDeviceRequest = {
deviceId: "default_device",
};
apiInstance
.getDevice(params)
.then((data: v2.GetDeviceResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v2/ndm/interfaceshttps://api.datadoghq.eu/api/v2/ndm/interfaceshttps://api.ddog-gov.com/api/v2/ndm/interfaceshttps://api.datadoghq.com/api/v2/ndm/interfaceshttps://api.us3.datadoghq.com/api/v2/ndm/interfaceshttps://api.us5.datadoghq.com/api/v2/ndm/interfaces
Get the list of interfaces of the device.
이름
유형
설명
device_id [required]
string
The ID of the device to get interfaces from.
OK
The GetInterfaces
operation’s response.
항목
유형
설명
data
[object]
Get Interfaces response
attributes
object
The interface attributes
alias
string
The interface alias
description
string
The interface description
index
int64
The interface index
mac_address
string
The interface MAC address
name
string
The interface name
status
enum
The interface status
Allowed enum values: up,down,warning,off
id
string
The interface ID
type
string
The type of the resource. The value should always be interface.
{
"data": [
{
"attributes": {
"alias": "interface_0",
"description": "a network interface",
"index": 0,
"mac_address": "00:00:00:00:00:00",
"name": "if0",
"status": "up"
},
"id": "example:1.2.3.4:99",
"type": "string"
}
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
# Required query arguments
export device_id="example:1.2.3.4"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/ndm/interfaces?device_id=${device_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get the list of interfaces of the device returns "OK" response
"""
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.network_device_monitoring_api import NetworkDeviceMonitoringApi
configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = NetworkDeviceMonitoringApi(api_client)
response = api_instance.get_interfaces(
device_id="default:1.2.3.4",
)
print(response)
First install the library and its dependencies and then save the example to example.py
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Get the list of interfaces of the device returns "OK" response
require "datadog_api_client"
api_instance = DatadogAPIClient::V2::NetworkDeviceMonitoringAPI.new
p api_instance.get_interfaces("default:1.2.3.4")
First install the library and its dependencies and then save the example to example.rb
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Get the list of interfaces of the device returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewNetworkDeviceMonitoringApi(apiClient)
resp, r, err := api.GetInterfaces(ctx, "default:1.2.3.4")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NetworkDeviceMonitoringApi.GetInterfaces`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `NetworkDeviceMonitoringApi.GetInterfaces`:\n%s\n", responseContent)
}
First install the library and its dependencies and then save the example to main.go
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Get the list of interfaces of the device returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.NetworkDeviceMonitoringApi;
import com.datadog.api.client.v2.model.GetInterfacesResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
NetworkDeviceMonitoringApi apiInstance = new NetworkDeviceMonitoringApi(defaultClient);
try {
GetInterfacesResponse result = apiInstance.getInterfaces("default:1.2.3.4");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NetworkDeviceMonitoringApi#getInterfaces");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
First install the library and its dependencies and then save the example to Example.java
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
// Get the list of interfaces of the device returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_network_device_monitoring::NetworkDeviceMonitoringAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = NetworkDeviceMonitoringAPI::with_config(configuration);
let resp = api.get_interfaces("default:1.2.3.4".to_string()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
/**
* Get the list of interfaces of the device returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.NetworkDeviceMonitoringApi(configuration);
const params: v2.NetworkDeviceMonitoringApiGetInterfacesRequest = {
deviceId: "default:1.2.3.4",
};
apiInstance
.getInterfaces(params)
.then((data: v2.GetInterfacesResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"