diff --git a/cisco_aci/changelog.d/18842.added b/cisco_aci/changelog.d/18842.added new file mode 100644 index 0000000000000..59e3a59c27851 --- /dev/null +++ b/cisco_aci/changelog.d/18842.added @@ -0,0 +1 @@ +[NDM] [Cisco ACI] Utilize raw ID for interface metadata diff --git a/cisco_aci/datadog_checks/cisco_aci/models.py b/cisco_aci/datadog_checks/cisco_aci/models.py index 3081d8ffd685c..8031978213f3f 100644 --- a/cisco_aci/datadog_checks/cisco_aci/models.py +++ b/cisco_aci/datadog_checks/cisco_aci/models.py @@ -135,8 +135,11 @@ class Status(StrEnum): class InterfaceMetadata(BaseModel): device_id: Optional[str] = Field(default=None) id_tags: list = Field(default_factory=list) + raw_id: Optional[str] = Field(default=None) + raw_id_type: Optional[str] = Field(default='cisco_aci') index: Optional[int] = Field(default=None) name: Optional[str] = Field(default=None) + alias: Optional[str] = Field(default=None) description: Optional[str] = Field(default=None) mac_address: Optional[str] = Field(default=None) admin_status: Optional[AdminStatus] = Field(default=None) diff --git a/cisco_aci/datadog_checks/cisco_aci/ndm.py b/cisco_aci/datadog_checks/cisco_aci/ndm.py index 5681350d6b39f..7e9c066a72708 100644 --- a/cisco_aci/datadog_checks/cisco_aci/ndm.py +++ b/cisco_aci/datadog_checks/cisco_aci/ndm.py @@ -48,9 +48,11 @@ def create_interface_metadata(phys_if, address, namespace): eth = PhysIf(**phys_if.get('l1PhysIf', {})) interface = InterfaceMetadata( device_id='{}:{}'.format(namespace, address), + raw_id=eth.attributes.id, id_tags=['interface:{}'.format(eth.attributes.name)], index=eth.attributes.id, name=eth.attributes.name, + alias=eth.attributes.id, description=eth.attributes.desc, mac_address=eth.attributes.router_mac, admin_status=eth.attributes.admin_st, diff --git a/cisco_aci/tests/fixtures/metadata.py b/cisco_aci/tests/fixtures/metadata.py index 71a5a21fedcb8..e3b1236b34d8a 100644 --- a/cisco_aci/tests/fixtures/metadata.py +++ b/cisco_aci/tests/fixtures/metadata.py @@ -137,6 +137,8 @@ INTERFACE_METADATA = [ { 'admin_status': 1, + 'alias': 'eth1/1', + 'raw_id': 'eth1/1', 'device_id': 'default:10.0.200.0', 'id_tags': [ 'interface:eth1/1', @@ -150,6 +152,8 @@ }, { 'admin_status': 1, + 'alias': 'eth1/2', + 'raw_id': 'eth1/2', 'device_id': 'default:10.0.200.0', 'id_tags': [ 'interface:eth1/2', @@ -163,6 +167,8 @@ }, { 'admin_status': 1, + 'alias': 'eth1/3', + 'raw_id': 'eth1/3', 'device_id': 'default:10.0.200.0', 'id_tags': [ 'interface:eth1/3', @@ -176,6 +182,8 @@ }, { 'admin_status': 1, + 'alias': 'eth1/1', + 'raw_id': 'eth1/1', 'device_id': 'default:10.0.200.1', 'id_tags': [ 'interface:eth1/1', @@ -189,6 +197,8 @@ }, { 'admin_status': 1, + 'alias': 'eth1/2', + 'raw_id': 'eth1/2', 'device_id': 'default:10.0.200.1', 'id_tags': [ 'interface:eth1/2', @@ -202,6 +212,8 @@ }, { 'admin_status': 1, + 'alias': 'eth1/3', + 'raw_id': 'eth1/3', 'device_id': 'default:10.0.200.1', 'id_tags': [ 'interface:eth1/3', @@ -215,6 +227,8 @@ }, { 'admin_status': 1, + 'alias': 'eth5/1', + 'raw_id': 'eth5/1', 'device_id': 'default:10.0.200.5', 'id_tags': [ 'interface:eth5/1', @@ -228,6 +242,8 @@ }, { 'admin_status': 1, + 'alias': 'eth5/2', + 'raw_id': 'eth5/2', 'device_id': 'default:10.0.200.5', 'id_tags': [ 'interface:eth5/2', @@ -241,6 +257,8 @@ }, { 'admin_status': 1, + 'alias': 'eth7/1', + 'raw_id': 'eth7/1', 'device_id': 'default:10.0.200.5', 'id_tags': [ 'interface:eth7/1',