annet 0.13.4__py3-none-any.whl → 0.13.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of annet might be problematic. Click here for more details.

@@ -19,15 +19,12 @@ _VENDORS = {
19
19
  }
20
20
 
21
21
 
22
- def _vendor_to_hw(vendor):
23
- return HardwareView(_VENDORS.get(vendor.lower(), vendor), None)
24
-
25
-
26
- def get_hw(manufacturer: str, model: str):
22
+ def get_hw(manufacturer: str, model: str, platform_name: str):
27
23
  # by some reason Netbox calls Mellanox SN as MSN, so we fix them here
28
24
  if manufacturer == "Mellanox" and model.startswith("MSN"):
29
25
  model = model.replace("MSN", "SN", 1)
30
- hw = _vendor_to_hw(manufacturer + " " + model)
26
+ vendor = manufacturer + " " + model
27
+ hw = HardwareView(_VENDORS.get(vendor.lower(), vendor), platform_name)
31
28
  if not hw:
32
29
  raise ValueError(f"unsupported manufacturer {manufacturer}")
33
30
  return hw
@@ -80,6 +80,17 @@ class InterfaceType:
80
80
  label: str
81
81
 
82
82
 
83
+ @dataclass
84
+ class InterfaceMode:
85
+ value: str
86
+ label: str
87
+
88
+
89
+ @dataclass
90
+ class InterfaceVlan(Entity):
91
+ vid: int
92
+
93
+
83
94
  @dataclass
84
95
  class Interface(Entity):
85
96
  device: Entity
@@ -87,6 +98,9 @@ class Interface(Entity):
87
98
  description: str
88
99
  type: InterfaceType
89
100
  connected_endpoints: Optional[list[InterfaceConnectedEndpoint]]
101
+ mode: Optional[InterfaceMode]
102
+ untagged_vlan: Optional[InterfaceVlan]
103
+ tagged_vlans: Optional[List[InterfaceVlan]]
90
104
  display: str = ""
91
105
  ip_addresses: List[IpAddress] = field(default_factory=list)
92
106
 
@@ -44,6 +44,9 @@ def extend_device(
44
44
  ) -> models.NetboxDevice:
45
45
  manufacturer = device.device_type.manufacturer.name
46
46
  model = device.device_type.model
47
+ platform_name = ""
48
+ if device.platform:
49
+ platform_name = device.platform.name
47
50
 
48
51
  return models.NetboxDevice(
49
52
  url=device.url,
@@ -71,7 +74,7 @@ def extend_device(
71
74
 
72
75
  fqdn=device.name,
73
76
  hostname=device.name,
74
- hw=get_hw(manufacturer, model),
77
+ hw=get_hw(manufacturer, model, platform_name),
75
78
  breed=get_breed(manufacturer, model),
76
79
  interfaces=[],
77
80
  neighbours_ids=[],
@@ -42,6 +42,9 @@ def extend_device(
42
42
  neighbours: Optional[List[models.NetboxDevice]],
43
43
  storage: Storage,
44
44
  ) -> models.NetboxDevice:
45
+ platform_name: str = ""
46
+ if device.platform:
47
+ platform_name = device.platform.name
45
48
  return extend_device_base(
46
49
  device=device,
47
50
  interfaces=interfaces,
@@ -52,6 +55,7 @@ def extend_device(
52
55
  hw=get_hw(
53
56
  device.device_type.manufacturer.name,
54
57
  device.device_type.model,
58
+ platform_name,
55
59
  ),
56
60
  neighbours=neighbours,
57
61
  storage=storage,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: annet
3
- Version: 0.13.4
3
+ Version: 0.13.6
4
4
  Summary: annet
5
5
  Home-page: https://github.com/annetutil/annet
6
6
  License: MIT
@@ -26,15 +26,15 @@ annet/adapters/netbox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
26
26
  annet/adapters/netbox/provider.py,sha256=OM7Hq2vnMHNVBfubJvx2qJlMYm3VvKhomdLMNO8YnLQ,1024
27
27
  annet/adapters/netbox/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  annet/adapters/netbox/common/client.py,sha256=-lWZmphD-OPuLIHNKhW_h2bnjrVaiyKYAD_MUPasEbo,2483
29
- annet/adapters/netbox/common/manufacturer.py,sha256=UH_tEKT3GXC8WSm15q0xxXRE7aj0b0icgwmR--PRWBs,1771
30
- annet/adapters/netbox/common/models.py,sha256=rmFQ93NUCnFM-p58aS4sjiOaTuYR0Xz65soiW7IQfDk,2516
29
+ annet/adapters/netbox/common/manufacturer.py,sha256=van_-9-3cnBadZkF3Srae_m8cUSjf8KQCCCHFcdeQyo,1758
30
+ annet/adapters/netbox/common/models.py,sha256=zxAADsHld1r0z3RswEt6bYQrJUYHyI_1hBSB-GbPvIM,2760
31
31
  annet/adapters/netbox/common/query.py,sha256=OgUuF-bvshpoBUkrOs0tsMUAhjTsttzx3VV30ryFl0Y,577
32
32
  annet/adapters/netbox/common/status_client.py,sha256=W4nTb2yvBlJ2UkWUmUhKQ2PaSQb1shjhHj5ebb4s2s4,591
33
33
  annet/adapters/netbox/common/storage_opts.py,sha256=rl_0pr3VzmOy6PDZIUMkKSBfJh90gD9TFL3yBhK_8ME,337
34
34
  annet/adapters/netbox/v24/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- annet/adapters/netbox/v24/storage.py,sha256=uDcAuabORu8ag3OXDHXKDK469Pd-kNXpUI_Cg-hgW_k,5919
35
+ annet/adapters/netbox/v24/storage.py,sha256=ogCu5XXIpcpPtuz7dWfDFIbqtz8k5G96PL6mhAQWwBU,6026
36
36
  annet/adapters/netbox/v37/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
- annet/adapters/netbox/v37/storage.py,sha256=9CxLr2tMWvGA1BLtjd5TTp2qEUQ_aYJq0eZSe-S242E,7372
37
+ annet/adapters/netbox/v37/storage.py,sha256=XIP11yp_ypi2lEQdtqNXGkzUYNxFCfDsmUM5pnoMFPU,7496
38
38
  annet/annlib/__init__.py,sha256=fT1l4xV5fqqg8HPw9HqmZVN2qwS8i6X1aIm2zGDjxKY,252
39
39
  annet/annlib/command.py,sha256=uuBddMQphtn8P5MO5kzIa8_QrtMns-k05VeKv1bcAuA,1043
40
40
  annet/annlib/diff.py,sha256=UPt3kYFQdQdVVy3ePYzNHPAxMVmHxCrCnZnMCV6ou2Q,4587
@@ -124,10 +124,10 @@ annet/rulebook/texts/routeros.rul,sha256=ipfxjj0mjFef6IsUlupqx4BY_Je_OUb8u_U1019
124
124
  annet_generators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
125
125
  annet_generators/example/__init__.py,sha256=zVd8_DrXuOASrNzg2Ab94rPyvJff83L-_HppDFxnUjM,228
126
126
  annet_generators/example/lldp.py,sha256=68CLrK7vxTQQy9XIBxtywuEdBNlIlfXGYj8_wYWs5UI,1146
127
- annet-0.13.4.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
128
- annet-0.13.4.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
129
- annet-0.13.4.dist-info/METADATA,sha256=Ug49vbZb6q3AP41fId0L8o2hCst2KTJ9V4l2MgYF2rA,694
130
- annet-0.13.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
131
- annet-0.13.4.dist-info/entry_points.txt,sha256=yHimujIzR2bwNIbb--MTs_GpXiAve89Egpu2LlgTEkg,119
132
- annet-0.13.4.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
133
- annet-0.13.4.dist-info/RECORD,,
127
+ annet-0.13.6.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
128
+ annet-0.13.6.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
129
+ annet-0.13.6.dist-info/METADATA,sha256=o_MGhpo38KbBhndlGER9EnhCvJdLWy1uZbsDNr78ODU,694
130
+ annet-0.13.6.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
131
+ annet-0.13.6.dist-info/entry_points.txt,sha256=yHimujIzR2bwNIbb--MTs_GpXiAve89Egpu2LlgTEkg,119
132
+ annet-0.13.6.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
133
+ annet-0.13.6.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (70.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5