Skip to content

Commit 2c82ebd

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Update NDM GetInterfaces documentation to add ip_addresses attribute (#2792)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 59133b0 commit 2c82ebd

File tree

5 files changed

+53
-6
lines changed

5 files changed

+53
-6
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-04-08 20:00:43.803169",
8-
"spec_repo_commit": "3e2afa30"
7+
"regenerated": "2025-04-08 20:55:38.627224",
8+
"spec_repo_commit": "21cf6edb"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-08 20:00:43.818345",
13-
"spec_repo_commit": "3e2afa30"
12+
"regenerated": "2025-04-08 20:55:38.642824",
13+
"spec_repo_commit": "21cf6edb"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -17271,6 +17271,14 @@ components:
1727117271
example: 0
1727217272
format: int64
1727317273
type: integer
17274+
ip_addresses:
17275+
description: The interface IP addresses
17276+
example:
17277+
- 1.1.1.1
17278+
- 1.1.1.2
17279+
items:
17280+
type: string
17281+
type: array
1727417282
mac_address:
1727517283
description: The interface MAC address
1727617284
example: 00:00:00:00:00:00

src/main/java/com/datadog/api/client/v2/model/InterfaceAttributes.java

+39-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
import com.fasterxml.jackson.annotation.JsonInclude;
1313
import com.fasterxml.jackson.annotation.JsonProperty;
1414
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
15+
import java.util.ArrayList;
1516
import java.util.HashMap;
17+
import java.util.List;
1618
import java.util.Map;
1719
import java.util.Objects;
1820

@@ -21,6 +23,7 @@
2123
InterfaceAttributes.JSON_PROPERTY_ALIAS,
2224
InterfaceAttributes.JSON_PROPERTY_DESCRIPTION,
2325
InterfaceAttributes.JSON_PROPERTY_INDEX,
26+
InterfaceAttributes.JSON_PROPERTY_IP_ADDRESSES,
2427
InterfaceAttributes.JSON_PROPERTY_MAC_ADDRESS,
2528
InterfaceAttributes.JSON_PROPERTY_NAME,
2629
InterfaceAttributes.JSON_PROPERTY_STATUS
@@ -38,6 +41,9 @@ public class InterfaceAttributes {
3841
public static final String JSON_PROPERTY_INDEX = "index";
3942
private Long index;
4043

44+
public static final String JSON_PROPERTY_IP_ADDRESSES = "ip_addresses";
45+
private List<String> ipAddresses = null;
46+
4147
public static final String JSON_PROPERTY_MAC_ADDRESS = "mac_address";
4248
private String macAddress;
4349

@@ -110,6 +116,35 @@ public void setIndex(Long index) {
110116
this.index = index;
111117
}
112118

119+
public InterfaceAttributes ipAddresses(List<String> ipAddresses) {
120+
this.ipAddresses = ipAddresses;
121+
return this;
122+
}
123+
124+
public InterfaceAttributes addIpAddressesItem(String ipAddressesItem) {
125+
if (this.ipAddresses == null) {
126+
this.ipAddresses = new ArrayList<>();
127+
}
128+
this.ipAddresses.add(ipAddressesItem);
129+
return this;
130+
}
131+
132+
/**
133+
* The interface IP addresses
134+
*
135+
* @return ipAddresses
136+
*/
137+
@jakarta.annotation.Nullable
138+
@JsonProperty(JSON_PROPERTY_IP_ADDRESSES)
139+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
140+
public List<String> getIpAddresses() {
141+
return ipAddresses;
142+
}
143+
144+
public void setIpAddresses(List<String> ipAddresses) {
145+
this.ipAddresses = ipAddresses;
146+
}
147+
113148
public InterfaceAttributes macAddress(String macAddress) {
114149
this.macAddress = macAddress;
115150
return this;
@@ -236,6 +271,7 @@ public boolean equals(Object o) {
236271
return Objects.equals(this.alias, interfaceAttributes.alias)
237272
&& Objects.equals(this.description, interfaceAttributes.description)
238273
&& Objects.equals(this.index, interfaceAttributes.index)
274+
&& Objects.equals(this.ipAddresses, interfaceAttributes.ipAddresses)
239275
&& Objects.equals(this.macAddress, interfaceAttributes.macAddress)
240276
&& Objects.equals(this.name, interfaceAttributes.name)
241277
&& Objects.equals(this.status, interfaceAttributes.status)
@@ -244,7 +280,8 @@ public boolean equals(Object o) {
244280

245281
@Override
246282
public int hashCode() {
247-
return Objects.hash(alias, description, index, macAddress, name, status, additionalProperties);
283+
return Objects.hash(
284+
alias, description, index, ipAddresses, macAddress, name, status, additionalProperties);
248285
}
249286

250287
@Override
@@ -254,6 +291,7 @@ public String toString() {
254291
sb.append(" alias: ").append(toIndentedString(alias)).append("\n");
255292
sb.append(" description: ").append(toIndentedString(description)).append("\n");
256293
sb.append(" index: ").append(toIndentedString(index)).append("\n");
294+
sb.append(" ipAddresses: ").append(toIndentedString(ipAddresses)).append("\n");
257295
sb.append(" macAddress: ").append(toIndentedString(macAddress)).append("\n");
258296
sb.append(" name: ").append(toIndentedString(name)).append("\n");
259297
sb.append(" status: ").append(toIndentedString(status)).append("\n");

src/test/resources/cassettes/features/v2/Get_the_list_of_interfaces_of_the_device_returns_OK_response.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"secure": true
1414
},
1515
"httpResponse": {
16-
"body": "{\"data\":[{\"id\":\"default:1.2.3.4:99\",\"type\":\"interface\",\"attributes\":{\"name\":\"if99\",\"status\":\"up\",\"description\":\"a network interface\",\"mac_address\":\"00:00:00:00:00:00\",\"alias\":\"interface_99\",\"index\":99}},{\"id\":\"default:1.2.3.4:999\",\"type\":\"interface\",\"attributes\":{\"name\":\"if999\",\"status\":\"down\",\"description\":\"another network interface\",\"mac_address\":\"99:99:99:99:99:99\",\"alias\":\"interface_999\",\"index\":999}}]}",
16+
"body": "{\"data\":[{\"id\":\"default:1.2.3.4:99\",\"type\":\"interface\",\"attributes\":{\"name\":\"if99\",\"status\":\"up\",\"description\":\"a network interface\",\"mac_address\":\"00:00:00:00:00:00\",\"ip_addresses\":[\"1.1.1.1\",\"1.1.1.2\"],\"alias\":\"interface_99\",\"index\":99}},{\"id\":\"default:1.2.3.4:999\",\"type\":\"interface\",\"attributes\":{\"name\":\"if999\",\"status\":\"down\",\"description\":\"another network interface\",\"mac_address\":\"99:99:99:99:99:99\",\"alias\":\"interface_999\",\"index\":999}}]}",
1717
"headers": {
1818
"Content-Type": [
1919
"application/vnd.api+json"

src/test/resources/com/datadog/api/client/v2/api/network_device_monitoring.feature

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Feature: Network Device Monitoring
8686
And the response "data[0].attributes.name" is equal to "if99"
8787
And the response "data[0].attributes.description" is equal to "a network interface"
8888
And the response "data[0].attributes.mac_address" is equal to "00:00:00:00:00:00"
89+
And the response "data[0].attributes.ip_addresses" is equal to ["1.1.1.1","1.1.1.2"]
8990
And the response "data[0].attributes.alias" is equal to "interface_99"
9091
And the response "data[0].attributes.index" is equal to 99
9192
And the response "data[0].attributes.status" is equal to "up"

0 commit comments

Comments
 (0)