Skip to content

Update NDM GetInterfaces documentation to add get_ip_addresses param #2149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-04-14 08:41:56.357428",
"spec_repo_commit": "e73254d7"
"regenerated": "2025-04-14 16:33:13.933543",
"spec_repo_commit": "c0287407"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-04-14 08:41:56.373102",
"spec_repo_commit": "e73254d7"
"regenerated": "2025-04-14 16:33:13.949636",
"spec_repo_commit": "c0287407"
}
}
}
7 changes: 7 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46074,6 +46074,13 @@ paths:
required: true
schema:
type: string
- description: Whether to get the IP addresses of the interfaces.
example: true
in: query
name: get_ip_addresses
required: false
schema:
type: boolean
responses:
'200':
content:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2024-07-05T14:25:54.313Z"
"2025-04-09T22:39:12.378Z"
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"entries": [
{
"_id": "5a6a117e682a544c1c30e0f45537c11a",
"_id": "6c05b1996e29df1ac976189f432c5396",
"_order": 0,
"cache": {},
"request": {
Expand All @@ -21,16 +21,20 @@
"value": "application/json"
}
],
"headersSize": 529,
"headersSize": 558,
"httpVersion": "HTTP/1.1",
"method": "GET",
"queryString": [
{
"name": "device_id",
"value": "default:1.2.3.4"
},
{
"name": "get_ip_addresses",
"value": "true"
}
],
"url": "https://api.datadoghq.com/api/v2/ndm/interfaces?device_id=default:1.2.3.4"
"url": "https://api.datadoghq.com/api/v2/ndm/interfaces?device_id=default%3A1.2.3.4&get_ip_addresses=true"
},
"response": {
"bodySize": 220,
Expand All @@ -46,14 +50,14 @@
"value": "application/vnd.api+json"
}
],
"headersSize": 523,
"headersSize": 524,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2024-07-05T14:25:54.323Z",
"time": 526
"startedDateTime": "2025-04-09T22:39:12.388Z",
"time": 956
}
],
"pages": [],
Expand Down
1 change: 1 addition & 0 deletions examples/v2/network-device-monitoring/GetInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const apiInstance = new v2.NetworkDeviceMonitoringApi(configuration);

const params: v2.NetworkDeviceMonitoringApiGetInterfacesRequest = {
deviceId: "default:1.2.3.4",
getIpAddresses: true,
};

apiInstance
Expand Down
4 changes: 4 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4950,6 +4950,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
"type": "string",
"format": "",
},
"getIpAddresses": {
"type": "boolean",
"format": "",
},
"operationResponseType": "GetInterfacesResponse",
},
"v2.ListDeviceUserTags": {
Expand Down
1 change: 1 addition & 0 deletions features/v2/network_device_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Feature: Network Device Monitoring
Scenario: Get the list of interfaces of the device returns "OK" response
Given new "GetInterfaces" request
And request contains "device_id" parameter with value "default:1.2.3.4"
And request contains "get_ip_addresses" parameter with value true
When the request is sent
Then the response status is 200 OK
And the response "data[0].type" is equal to "interface"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export class NetworkDeviceMonitoringApiRequestFactory extends BaseAPIRequestFact

public async getInterfaces(
deviceId: string,
getIpAddresses?: boolean,
_options?: Configuration
): Promise<RequestContext> {
const _config = _options || this.configuration;
Expand Down Expand Up @@ -85,6 +86,13 @@ export class NetworkDeviceMonitoringApiRequestFactory extends BaseAPIRequestFact
""
);
}
if (getIpAddresses !== undefined) {
requestContext.setQueryParam(
"get_ip_addresses",
ObjectSerializer.serialize(getIpAddresses, "boolean", ""),
""
);
}

// Apply auth methods
applySecurityAuthentication(_config, requestContext, [
Expand Down Expand Up @@ -559,6 +567,11 @@ export interface NetworkDeviceMonitoringApiGetInterfacesRequest {
* @type string
*/
deviceId: string;
/**
* Whether to get the IP addresses of the interfaces.
* @type boolean
*/
getIpAddresses?: boolean;
}

export interface NetworkDeviceMonitoringApiListDevicesRequest {
Expand Down Expand Up @@ -653,6 +666,7 @@ export class NetworkDeviceMonitoringApi {
): Promise<GetInterfacesResponse> {
const requestContextPromise = this.requestFactory.getInterfaces(
param.deviceId,
param.getIpAddresses,
options
);
return requestContextPromise.then((requestContext) => {
Expand Down