diff --git a/examples/device42_to_infrahub/config.yml b/examples/device42_to_infrahub/config.yml new file mode 100644 index 0000000..bc43bca --- /dev/null +++ b/examples/device42_to_infrahub/config.yml @@ -0,0 +1,54 @@ +--- +name: from-device42 + +source: + name: genericrestapi + settings: + url: "http://swaggerdemo.device42.com" + auth_method: "basic" + username: "guest" + password: "device42_rocks!" + api_endpoint: "/api/1.0" + response_key_pattern: "objects" + +destination: + name: infrahub + settings: + url: "http://localhost:8000" + +order: [ + "BuiltinTag", + "OrganizationTenant", + "LocationSite", +] + +schema_mapping: + # Builtin Tags (Device42 tags) + - name: BuiltinTag + mapping: tags + identifiers: ["name"] + fields: + - name: name + mapping: name + + # Organizations (Customers in Device42) + - name: OrganizationTenant + mapping: customers + identifiers: ["name"] + fields: + - name: name + mapping: name + - name: description + mapping: notes + + # Locations (Buildings in Device42) + - name: LocationSite + mapping: buildings + identifiers: ["name"] + fields: + - name: name + mapping: name + - name: tags + mapping: tags + reference: BuiltinTag + diff --git a/examples/peeringdb_to_infrahub/genenericrestapi/__init__.py b/examples/device42_to_infrahub/genericrestapi/__init__.py similarity index 100% rename from examples/peeringdb_to_infrahub/genenericrestapi/__init__.py rename to examples/device42_to_infrahub/genericrestapi/__init__.py diff --git a/examples/device42_to_infrahub/genericrestapi/sync_adapter.py b/examples/device42_to_infrahub/genericrestapi/sync_adapter.py new file mode 100644 index 0000000..37df9d5 --- /dev/null +++ b/examples/device42_to_infrahub/genericrestapi/sync_adapter.py @@ -0,0 +1,18 @@ +from infrahub_sync.adapters.genericrestapi import GenericrestapiAdapter + +from .sync_models import ( + BuiltinTag, + LocationSite, + OrganizationTenant, +) + + +# ------------------------------------------------------- +# AUTO-GENERATED FILE, DO NOT MODIFY +# This file has been generated with the command `infrahub-sync generate` +# All modifications will be lost the next time you reexecute this command +# ------------------------------------------------------- +class GenericrestapiSync(GenericrestapiAdapter): + BuiltinTag = BuiltinTag + LocationSite = LocationSite + OrganizationTenant = OrganizationTenant diff --git a/examples/device42_to_infrahub/genericrestapi/sync_models.py b/examples/device42_to_infrahub/genericrestapi/sync_models.py new file mode 100644 index 0000000..41e7cda --- /dev/null +++ b/examples/device42_to_infrahub/genericrestapi/sync_models.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import Any + +from infrahub_sync.adapters.genericrestapi import GenericrestapiModel + + +# ------------------------------------------------------- +# AUTO-GENERATED FILE, DO NOT MODIFY +# This file has been generated with the command `infrahub-sync generate` +# All modifications will be lost the next time you reexecute this command +# ------------------------------------------------------- +class BuiltinTag(GenericrestapiModel): + _modelname = "BuiltinTag" + _identifiers = ("name",) + _attributes = () + name: str + + local_id: str | None = None + local_data: Any | None = None + + +class LocationSite(GenericrestapiModel): + _modelname = "LocationSite" + _identifiers = ("name",) + _attributes = ("tags",) + name: str + tags: list[str] | None = [] + + local_id: str | None = None + local_data: Any | None = None + + +class OrganizationTenant(GenericrestapiModel): + _modelname = "OrganizationTenant" + _identifiers = ("name",) + _attributes = ("description",) + description: str | None = None + name: str + + local_id: str | None = None + local_data: Any | None = None diff --git a/examples/peeringdb_to_infrahub/generic_rest_api/__init__.py b/examples/device42_to_infrahub/infrahub/__init__.py similarity index 100% rename from examples/peeringdb_to_infrahub/generic_rest_api/__init__.py rename to examples/device42_to_infrahub/infrahub/__init__.py diff --git a/examples/device42_to_infrahub/infrahub/sync_adapter.py b/examples/device42_to_infrahub/infrahub/sync_adapter.py new file mode 100644 index 0000000..a1210b3 --- /dev/null +++ b/examples/device42_to_infrahub/infrahub/sync_adapter.py @@ -0,0 +1,18 @@ +from infrahub_sync.adapters.infrahub import InfrahubAdapter + +from .sync_models import ( + BuiltinTag, + LocationSite, + OrganizationTenant, +) + + +# ------------------------------------------------------- +# AUTO-GENERATED FILE, DO NOT MODIFY +# This file has been generated with the command `infrahub-sync generate` +# All modifications will be lost the next time you reexecute this command +# ------------------------------------------------------- +class InfrahubSync(InfrahubAdapter): + BuiltinTag = BuiltinTag + LocationSite = LocationSite + OrganizationTenant = OrganizationTenant diff --git a/examples/device42_to_infrahub/infrahub/sync_models.py b/examples/device42_to_infrahub/infrahub/sync_models.py new file mode 100644 index 0000000..d8e14ef --- /dev/null +++ b/examples/device42_to_infrahub/infrahub/sync_models.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import Any + +from infrahub_sync.adapters.infrahub import InfrahubModel + + +# ------------------------------------------------------- +# AUTO-GENERATED FILE, DO NOT MODIFY +# This file has been generated with the command `infrahub-sync generate` +# All modifications will be lost the next time you reexecute this command +# ------------------------------------------------------- +class BuiltinTag(InfrahubModel): + _modelname = "BuiltinTag" + _identifiers = ("name",) + _attributes = () + name: str + + local_id: str | None = None + local_data: Any | None = None + + +class LocationSite(InfrahubModel): + _modelname = "LocationSite" + _identifiers = ("name",) + _attributes = ("tags",) + name: str + tags: list[str] | None = [] + + local_id: str | None = None + local_data: Any | None = None + + +class OrganizationTenant(InfrahubModel): + _modelname = "OrganizationTenant" + _identifiers = ("name",) + _attributes = ("description",) + description: str | None = None + name: str + + local_id: str | None = None + local_data: Any | None = None diff --git a/examples/peeringdb_to_infrahub/genenericrestapi/sync_adapter.py b/examples/peeringdb_to_infrahub/genenericrestapi/sync_adapter.py deleted file mode 100644 index 616c643..0000000 --- a/examples/peeringdb_to_infrahub/genenericrestapi/sync_adapter.py +++ /dev/null @@ -1,28 +0,0 @@ -from infrahub_sync.adapters.genenericrestapi import GenenericrestapiAdapter - -from .sync_models import ( - InfraAutonomousSystem, - InfraBGPCommunity, - InfraBGPPeerGroup, - InfraBGPRoutingPolicy, - InfraIXP, - InfraIXPConnection, - IpamIPAddress, - OrganizationProvider, -) - - -# ------------------------------------------------------- -# AUTO-GENERATED FILE, DO NOT MODIFY -# This file has been generated with the command `infrahub-sync generate` -# All modifications will be lost the next time you reexecute this command -# ------------------------------------------------------- -class GenenericrestapiSync(GenenericrestapiAdapter): - InfraAutonomousSystem = InfraAutonomousSystem - InfraBGPPeerGroup = InfraBGPPeerGroup - IpamIPAddress = IpamIPAddress - OrganizationProvider = OrganizationProvider - InfraBGPCommunity = InfraBGPCommunity - InfraBGPRoutingPolicy = InfraBGPRoutingPolicy - InfraIXP = InfraIXP - InfraIXPConnection = InfraIXPConnection diff --git a/examples/peeringdb_to_infrahub/genenericrestapi/sync_models.py b/examples/peeringdb_to_infrahub/genenericrestapi/sync_models.py deleted file mode 100644 index 3e095d1..0000000 --- a/examples/peeringdb_to_infrahub/genenericrestapi/sync_models.py +++ /dev/null @@ -1,141 +0,0 @@ -from __future__ import annotations - -from typing import Any - -from infrahub_sync.adapters.genenericrestapi import GenenericrestapiModel - - -# ------------------------------------------------------- -# AUTO-GENERATED FILE, DO NOT MODIFY -# This file has been generated with the command `infrahub-sync generate` -# All modifications will be lost the next time you reexecute this command -# ------------------------------------------------------- -class InfraAutonomousSystem(GenenericrestapiModel): - _modelname = "InfraAutonomousSystem" - _identifiers = ("asn",) - _attributes = ( - "organization", - "affiliated", - "irr_as_set", - "name", - "ipv4_max_prefixes", - "description", - "ipv6_max_prefixes", - ) - asn: int - affiliated: bool | None = None - irr_as_set: str | None = None - name: str - ipv4_max_prefixes: int | None = None - description: str | None = None - ipv6_max_prefixes: int | None = None - organization: str | None = None - - local_id: str | None = None - local_data: Any | None = None - - -class InfraBGPPeerGroup(GenenericrestapiModel): - _modelname = "InfraBGPPeerGroup" - _identifiers = ("name",) - _attributes = ("bgp_communities", "import_policies", "export_policies", "description", "status") - name: str - description: str | None = None - status: str | None = None - bgp_communities: list[str] | None = [] - import_policies: list[str] | None = [] - export_policies: list[str] | None = [] - - local_id: str | None = None - local_data: Any | None = None - - -class IpamIPAddress(GenenericrestapiModel): - _modelname = "IpamIPAddress" - _identifiers = ("address",) - _attributes = ("description",) - description: str | None = None - address: str - - local_id: str | None = None - local_data: Any | None = None - - -class OrganizationProvider(GenenericrestapiModel): - _modelname = "OrganizationProvider" - _identifiers = ("name",) - _attributes = () - name: str - - local_id: str | None = None - local_data: Any | None = None - - -class InfraBGPCommunity(GenenericrestapiModel): - _modelname = "InfraBGPCommunity" - _identifiers = ("name",) - _attributes = ("description", "label", "community_type", "value") - name: str - description: str | None = None - label: str | None = None - community_type: str | None = None - value: str - - local_id: str | None = None - local_data: Any | None = None - - -class InfraBGPRoutingPolicy(GenenericrestapiModel): - _modelname = "InfraBGPRoutingPolicy" - _identifiers = ("name",) - _attributes = ("bgp_communities", "address_family", "policy_type", "label", "weight", "description") - address_family: int - policy_type: str - label: str | None = None - weight: int | None = 1000 - name: str - description: str | None = None - bgp_communities: list[str] | None = [] - - local_id: str | None = None - local_data: Any | None = None - - -class InfraIXP(GenenericrestapiModel): - _modelname = "InfraIXP" - _identifiers = ("name",) - _attributes = ("export_policies", "bgp_communities", "import_policies", "status", "description") - status: str | None = "enabled" - name: str - description: str | None = None - export_policies: list[str] | None = [] - bgp_communities: list[str] | None = [] - import_policies: list[str] | None = [] - - local_id: str | None = None - local_data: Any | None = None - - -class InfraIXPConnection(GenenericrestapiModel): - _modelname = "InfraIXPConnection" - _identifiers = ("name",) - _attributes = ( - "internet_exchange_point", - "ipv4_address", - "ipv6_address", - "status", - "peeringdb_netixlan", - "vlan", - "description", - ) - name: str - status: str | None = "enabled" - peeringdb_netixlan: int | None = None - vlan: int | None = None - description: str | None = None - internet_exchange_point: str - ipv4_address: str | None = None - ipv6_address: str | None = None - - local_id: str | None = None - local_data: Any | None = None diff --git a/examples/peeringdb_to_infrahub/generic_rest_api/sync_adapter.py b/examples/peeringdb_to_infrahub/generic_rest_api/sync_adapter.py deleted file mode 100644 index 376377d..0000000 --- a/examples/peeringdb_to_infrahub/generic_rest_api/sync_adapter.py +++ /dev/null @@ -1,28 +0,0 @@ -from infrahub_sync.adapters.generic_rest_api import Generic_Rest_ApiAdapter - -from .sync_models import ( - InfraAutonomousSystem, - InfraBGPCommunity, - InfraBGPPeerGroup, - InfraBGPRoutingPolicy, - InfraIXP, - InfraIXPConnection, - IpamIPAddress, - OrganizationProvider, -) - - -# ------------------------------------------------------- -# AUTO-GENERATED FILE, DO NOT MODIFY -# This file has been generated with the command `infrahub-sync generate` -# All modifications will be lost the next time you reexecute this command -# ------------------------------------------------------- -class Generic_Rest_ApiSync(Generic_Rest_ApiAdapter): - InfraAutonomousSystem = InfraAutonomousSystem - InfraBGPPeerGroup = InfraBGPPeerGroup - IpamIPAddress = IpamIPAddress - OrganizationProvider = OrganizationProvider - InfraBGPRoutingPolicy = InfraBGPRoutingPolicy - InfraBGPCommunity = InfraBGPCommunity - InfraIXP = InfraIXP - InfraIXPConnection = InfraIXPConnection diff --git a/examples/peeringdb_to_infrahub/generic_rest_api/sync_models.py b/examples/peeringdb_to_infrahub/generic_rest_api/sync_models.py deleted file mode 100644 index abe1283..0000000 --- a/examples/peeringdb_to_infrahub/generic_rest_api/sync_models.py +++ /dev/null @@ -1,141 +0,0 @@ -from __future__ import annotations - -from typing import Any - -from infrahub_sync.adapters.generic_rest_api import Generic_Rest_ApiModel - - -# ------------------------------------------------------- -# AUTO-GENERATED FILE, DO NOT MODIFY -# This file has been generated with the command `infrahub-sync generate` -# All modifications will be lost the next time you reexecute this command -# ------------------------------------------------------- -class InfraAutonomousSystem(Generic_Rest_ApiModel): - _modelname = "InfraAutonomousSystem" - _identifiers = ("asn",) - _attributes = ( - "organization", - "affiliated", - "irr_as_set", - "name", - "ipv4_max_prefixes", - "description", - "ipv6_max_prefixes", - ) - asn: int - affiliated: bool | None = None - irr_as_set: str | None = None - name: str - ipv4_max_prefixes: int | None = None - description: str | None = None - ipv6_max_prefixes: int | None = None - organization: str | None = None - - local_id: str | None = None - local_data: Any | None = None - - -class InfraBGPPeerGroup(Generic_Rest_ApiModel): - _modelname = "InfraBGPPeerGroup" - _identifiers = ("name",) - _attributes = ("import_policies", "export_policies", "bgp_communities", "description", "status") - name: str - description: str | None = None - status: str | None = None - import_policies: list[str] | None = [] - export_policies: list[str] | None = [] - bgp_communities: list[str] | None = [] - - local_id: str | None = None - local_data: Any | None = None - - -class IpamIPAddress(Generic_Rest_ApiModel): - _modelname = "IpamIPAddress" - _identifiers = ("address",) - _attributes = ("description",) - description: str | None = None - address: str - - local_id: str | None = None - local_data: Any | None = None - - -class OrganizationProvider(Generic_Rest_ApiModel): - _modelname = "OrganizationProvider" - _identifiers = ("name",) - _attributes = () - name: str - - local_id: str | None = None - local_data: Any | None = None - - -class InfraBGPRoutingPolicy(Generic_Rest_ApiModel): - _modelname = "InfraBGPRoutingPolicy" - _identifiers = ("name",) - _attributes = ("bgp_communities", "label", "description", "policy_type", "weight", "address_family") - name: str - label: str | None = None - description: str | None = None - policy_type: str - weight: int | None = 1000 - address_family: int - bgp_communities: list[str] | None = [] - - local_id: str | None = None - local_data: Any | None = None - - -class InfraBGPCommunity(Generic_Rest_ApiModel): - _modelname = "InfraBGPCommunity" - _identifiers = ("name",) - _attributes = ("description", "label", "community_type", "value") - name: str - description: str | None = None - label: str | None = None - community_type: str | None = None - value: str - - local_id: str | None = None - local_data: Any | None = None - - -class InfraIXP(Generic_Rest_ApiModel): - _modelname = "InfraIXP" - _identifiers = ("name",) - _attributes = ("export_policies", "bgp_communities", "import_policies", "description", "status") - name: str - description: str | None = None - status: str | None = "enabled" - export_policies: list[str] | None = [] - bgp_communities: list[str] | None = [] - import_policies: list[str] | None = [] - - local_id: str | None = None - local_data: Any | None = None - - -class InfraIXPConnection(Generic_Rest_ApiModel): - _modelname = "InfraIXPConnection" - _identifiers = ("name",) - _attributes = ( - "internet_exchange_point", - "ipv4_address", - "ipv6_address", - "status", - "peeringdb_netixlan", - "vlan", - "description", - ) - name: str - status: str | None = "enabled" - peeringdb_netixlan: int | None = None - vlan: int | None = None - description: str | None = None - internet_exchange_point: str - ipv4_address: str | None = None - ipv6_address: str | None = None - - local_id: str | None = None - local_data: Any | None = None diff --git a/examples/peeringdb_to_infrahub/genericrestapi/sync_models.py b/examples/peeringdb_to_infrahub/genericrestapi/sync_models.py index f07111e..a7eec18 100644 --- a/examples/peeringdb_to_infrahub/genericrestapi/sync_models.py +++ b/examples/peeringdb_to_infrahub/genericrestapi/sync_models.py @@ -13,12 +13,12 @@ class InfraAutonomousSystem(GenericrestapiModel): _modelname = "InfraAutonomousSystem" _identifiers = ("asn",) - _attributes = ("irr_as_set", "name", "ipv4_max_prefixes", "ipv6_max_prefixes") - asn: int - irr_as_set: str | None = None + _attributes = ("ipv6_max_prefixes", "name", "ipv4_max_prefixes", "irr_as_set") + ipv6_max_prefixes: int | None = None name: str ipv4_max_prefixes: int | None = None - ipv6_max_prefixes: int | None = None + asn: int + irr_as_set: str | None = None local_id: str | None = None local_data: Any | None = None diff --git a/examples/peeringdb_to_infrahub/infrahub/sync_models.py b/examples/peeringdb_to_infrahub/infrahub/sync_models.py index dd1b07c..7d43792 100644 --- a/examples/peeringdb_to_infrahub/infrahub/sync_models.py +++ b/examples/peeringdb_to_infrahub/infrahub/sync_models.py @@ -13,12 +13,12 @@ class InfraAutonomousSystem(InfrahubModel): _modelname = "InfraAutonomousSystem" _identifiers = ("asn",) - _attributes = ("irr_as_set", "name", "ipv4_max_prefixes", "ipv6_max_prefixes") - asn: int - irr_as_set: str | None = None + _attributes = ("ipv6_max_prefixes", "name", "ipv4_max_prefixes", "irr_as_set") + ipv6_max_prefixes: int | None = None name: str ipv4_max_prefixes: int | None = None - ipv6_max_prefixes: int | None = None + asn: int + irr_as_set: str | None = None local_id: str | None = None local_data: Any | None = None diff --git a/examples/prometheus_to_infrahub (node_exporter)/infrahub/sync_adapter.py b/examples/prometheus_to_infrahub (node_exporter)/infrahub/sync_adapter.py index d91c544..5cdfe8d 100644 --- a/examples/prometheus_to_infrahub (node_exporter)/infrahub/sync_adapter.py +++ b/examples/prometheus_to_infrahub (node_exporter)/infrahub/sync_adapter.py @@ -1,10 +1,10 @@ from infrahub_sync.adapters.infrahub import InfrahubAdapter from .sync_models import ( + VirtualizationVirtualMachine, VirtualizationVMDisk, VirtualizationVMFilesystem, VirtualizationVMNetworkInterface, - VirtualizationVirtualMachine, ) diff --git a/examples/prometheus_to_infrahub (node_exporter)/infrahub/sync_models.py b/examples/prometheus_to_infrahub (node_exporter)/infrahub/sync_models.py index 79fbe14..17dd6c3 100644 --- a/examples/prometheus_to_infrahub (node_exporter)/infrahub/sync_models.py +++ b/examples/prometheus_to_infrahub (node_exporter)/infrahub/sync_models.py @@ -1,9 +1,10 @@ from __future__ import annotations -from typing import Any, List +from typing import Any from infrahub_sync.adapters.infrahub import InfrahubModel + # ------------------------------------------------------- # AUTO-GENERATED FILE, DO NOT MODIFY # This file has been generated with the command `infrahub-sync generate` @@ -20,6 +21,7 @@ class VirtualizationVMDisk(InfrahubModel): local_id: str | None = None local_data: Any | None = None + class VirtualizationVMFilesystem(InfrahubModel): _modelname = "VirtualizationVMFilesystem" _identifiers = ("virtual_machine", "mountpoint") @@ -35,6 +37,7 @@ class VirtualizationVMFilesystem(InfrahubModel): local_id: str | None = None local_data: Any | None = None + class VirtualizationVMNetworkInterface(InfrahubModel): _modelname = "VirtualizationVMNetworkInterface" _identifiers = ("virtual_machine", "name") @@ -51,10 +54,19 @@ class VirtualizationVMNetworkInterface(InfrahubModel): local_id: str | None = None local_data: Any | None = None + class VirtualizationVirtualMachine(InfrahubModel): _modelname = "VirtualizationVirtualMachine" _identifiers = ("name",) - _attributes = ("os_name", "ip_forwarding_enabled", "os_kernel", "status", "architecture", "conntrack_limit", "mem_total_bytes") + _attributes = ( + "os_name", + "ip_forwarding_enabled", + "os_kernel", + "status", + "architecture", + "conntrack_limit", + "mem_total_bytes", + ) os_name: str | None = None ip_forwarding_enabled: bool | None = None os_kernel: str | None = None diff --git a/examples/prometheus_to_infrahub (node_exporter)/prometheus/sync_adapter.py b/examples/prometheus_to_infrahub (node_exporter)/prometheus/sync_adapter.py index 9967a03..c1bd69f 100644 --- a/examples/prometheus_to_infrahub (node_exporter)/prometheus/sync_adapter.py +++ b/examples/prometheus_to_infrahub (node_exporter)/prometheus/sync_adapter.py @@ -1,10 +1,10 @@ from infrahub_sync.adapters.prometheus import PrometheusAdapter from .sync_models import ( + VirtualizationVirtualMachine, VirtualizationVMDisk, VirtualizationVMFilesystem, VirtualizationVMNetworkInterface, - VirtualizationVirtualMachine, ) diff --git a/examples/prometheus_to_infrahub (node_exporter)/prometheus/sync_models.py b/examples/prometheus_to_infrahub (node_exporter)/prometheus/sync_models.py index 11523da..573ba10 100644 --- a/examples/prometheus_to_infrahub (node_exporter)/prometheus/sync_models.py +++ b/examples/prometheus_to_infrahub (node_exporter)/prometheus/sync_models.py @@ -1,9 +1,10 @@ from __future__ import annotations -from typing import Any, List +from typing import Any from infrahub_sync.adapters.prometheus import PrometheusModel + # ------------------------------------------------------- # AUTO-GENERATED FILE, DO NOT MODIFY # This file has been generated with the command `infrahub-sync generate` @@ -20,6 +21,7 @@ class VirtualizationVMDisk(PrometheusModel): local_id: str | None = None local_data: Any | None = None + class VirtualizationVMFilesystem(PrometheusModel): _modelname = "VirtualizationVMFilesystem" _identifiers = ("virtual_machine", "mountpoint") @@ -35,6 +37,7 @@ class VirtualizationVMFilesystem(PrometheusModel): local_id: str | None = None local_data: Any | None = None + class VirtualizationVMNetworkInterface(PrometheusModel): _modelname = "VirtualizationVMNetworkInterface" _identifiers = ("virtual_machine", "name") @@ -51,10 +54,19 @@ class VirtualizationVMNetworkInterface(PrometheusModel): local_id: str | None = None local_data: Any | None = None + class VirtualizationVirtualMachine(PrometheusModel): _modelname = "VirtualizationVirtualMachine" _identifiers = ("name",) - _attributes = ("os_name", "ip_forwarding_enabled", "os_kernel", "status", "architecture", "conntrack_limit", "mem_total_bytes") + _attributes = ( + "os_name", + "ip_forwarding_enabled", + "os_kernel", + "status", + "architecture", + "conntrack_limit", + "mem_total_bytes", + ) os_name: str | None = None ip_forwarding_enabled: bool | None = None os_kernel: str | None = None diff --git a/infrahub_sync/adapters/rest_api_client.py b/infrahub_sync/adapters/rest_api_client.py index 573ab40..65dcdcb 100644 --- a/infrahub_sync/adapters/rest_api_client.py +++ b/infrahub_sync/adapters/rest_api_client.py @@ -25,7 +25,7 @@ def __init__( # Determine authentication method, some are use by more than one API. # Example: - # -> Peering Manager + # -> Peering Manager & Device42 if auth_method == "token" and api_token: self.headers["Authorization"] = f"Token {api_token}" # -> LibreNMS @@ -37,7 +37,7 @@ def __init__( # -> RIPE API elif auth_method == "key" and api_token: self.headers["Authorization"] = f"Key {api_token}" - # -> Observium + # -> Observium & Device42 elif auth_method == "basic" and username and password: self.auth = (username, password) elif auth_method == "none":