Skip to content

Commit 5fa76fc

Browse files
authored
[NDMC-191] collect is physical from cisco aci (DataDog#22537)
* collect is physical from cisco aci * add test * fix test
1 parent c342686 commit 5fa76fc

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

cisco_aci/datadog_checks/cisco_aci/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ class InterfaceMetadata(BaseModel):
226226
admin_status: Optional[AdminStatus] = Field(default=None)
227227
oper_status: Optional[OperStatus] = Field(default=None)
228228
integration: Optional[str] = Field(default='cisco-aci')
229+
is_physical: Optional[bool] = Field(default=None)
229230

230231
model_config = ConfigDict(validate_assignment=True, use_enum_values=True)
231232

cisco_aci/datadog_checks/cisco_aci/ndm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def create_interface_metadata(phys_if, address, namespace):
6565
description=eth.attributes.desc,
6666
mac_address=eth.attributes.router_mac,
6767
admin_status=eth.attributes.admin_st,
68+
is_physical=True,
6869
)
6970
if eth.ethpm_phys_if:
7071
interface.oper_status = eth.ethpm_phys_if.attributes.oper_st

cisco_aci/tests/fixtures/metadata.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
'name': 'eth1/1',
146146
'oper_status': 1,
147147
'status': 'up',
148+
'is_physical': True,
148149
},
149150
{
150151
'admin_status': 1,
@@ -160,6 +161,7 @@
160161
'name': 'eth1/2',
161162
'oper_status': 1,
162163
'status': 'up',
164+
'is_physical': True,
163165
},
164166
{
165167
'admin_status': 1,
@@ -175,6 +177,7 @@
175177
'name': 'eth1/3',
176178
'oper_status': 2,
177179
'status': 'down',
180+
'is_physical': True,
178181
},
179182
{
180183
'admin_status': 1,
@@ -190,6 +193,7 @@
190193
'name': 'eth1/1',
191194
'oper_status': 1,
192195
'status': 'up',
196+
'is_physical': True,
193197
},
194198
{
195199
'admin_status': 1,
@@ -205,6 +209,7 @@
205209
'name': 'eth1/2',
206210
'oper_status': 1,
207211
'status': 'up',
212+
'is_physical': True,
208213
},
209214
{
210215
'admin_status': 1,
@@ -220,6 +225,7 @@
220225
'name': 'eth1/3',
221226
'oper_status': 2,
222227
'status': 'down',
228+
'is_physical': True,
223229
},
224230
{
225231
'admin_status': 1,
@@ -235,6 +241,7 @@
235241
'name': 'eth5/1',
236242
'oper_status': 1,
237243
'status': 'up',
244+
'is_physical': True,
238245
},
239246
{
240247
'admin_status': 1,
@@ -250,6 +257,7 @@
250257
'name': 'eth5/2',
251258
'oper_status': 1,
252259
'status': 'up',
260+
'is_physical': True,
253261
},
254262
{
255263
'admin_status': 1,
@@ -265,6 +273,7 @@
265273
'name': 'eth7/1',
266274
'oper_status': 2,
267275
'status': 'down',
276+
'is_physical': True,
268277
},
269278
]
270279

0 commit comments

Comments
 (0)