From fcda17231f2c95d8fbc52e328ae1a12c49617832 Mon Sep 17 00:00:00 2001 From: Paul Stuart Date: Mon, 2 Feb 2026 13:42:24 -0800 Subject: [PATCH 1/8] update entities docs --- docs/README.md | 163 ++ docs/entities.md | 1413 +----------------- docs/examples/aggregate.py | 84 ++ docs/examples/asn.py | 78 + docs/examples/asn_range.py | 93 ++ docs/examples/cable.py | 79 + docs/examples/cable_path.py | 62 + docs/examples/circuit.py | 95 ++ docs/examples/circuit_group.py | 81 + docs/examples/circuit_group_assignment.py | 76 + docs/examples/circuit_termination.py | 94 ++ docs/examples/circuit_type.py | 79 + docs/examples/cluster.py | 86 ++ docs/examples/cluster_group.py | 77 + docs/examples/cluster_type.py | 77 + docs/examples/console_port.py | 106 ++ docs/examples/console_server_port.py | 108 ++ docs/examples/contact.py | 74 + docs/examples/contact_assignment.py | 74 + docs/examples/contact_group.py | 77 + docs/examples/contact_role.py | 77 + docs/examples/custom_field.py | 71 + docs/examples/custom_field_choice_set.py | 69 + docs/examples/custom_link.py | 71 + docs/examples/device.py | 114 ++ docs/examples/device_bay.py | 106 ++ docs/examples/device_role.py | 79 + docs/examples/device_type.py | 83 + docs/examples/fhrp_group.py | 77 + docs/examples/fhrp_group_assignment.py | 77 + docs/examples/front_port.py | 111 ++ docs/examples/ike_policy.py | 77 + docs/examples/ike_proposal.py | 83 + docs/examples/interface_example.py | 109 ++ docs/examples/inventory_item.py | 111 ++ docs/examples/inventory_item_role.py | 81 + docs/examples/ip_address.py | 80 + docs/examples/ip_range.py | 83 + docs/examples/ip_sec_policy.py | 74 + docs/examples/ip_sec_profile.py | 87 ++ docs/examples/ip_sec_proposal.py | 74 + docs/examples/journal_entry.py | 71 + docs/examples/l2vpn.py | 83 + docs/examples/l2vpn_termination.py | 77 + docs/examples/location.py | 92 ++ docs/examples/mac_address.py | 74 + docs/examples/manufacturer.py | 77 + docs/examples/module.py | 152 ++ docs/examples/module_bay.py | 106 ++ docs/examples/module_type.py | 80 + docs/examples/module_type_profile.py | 76 + docs/examples/owner.py | 75 + docs/examples/owner_group.py | 67 + docs/examples/platform.py | 77 + docs/examples/power_feed.py | 94 ++ docs/examples/power_outlet.py | 110 ++ docs/examples/power_panel.py | 83 + docs/examples/power_port.py | 106 ++ docs/examples/prefix.py | 80 + docs/examples/provider.py | 77 + docs/examples/provider_account.py | 80 + docs/examples/provider_network.py | 80 + docs/examples/rack.py | 92 ++ docs/examples/rack_reservation.py | 93 ++ docs/examples/rack_role.py | 79 + docs/examples/rack_type.py | 83 + docs/examples/rear_port.py | 111 ++ docs/examples/region.py | 77 + docs/examples/rir.py | 77 + docs/examples/role.py | 77 + docs/examples/route_target.py | 78 + docs/examples/service.py | 74 + docs/examples/site.py | 83 + docs/examples/site_group.py | 77 + docs/examples/tag.py | 72 + docs/examples/tenant.py | 77 + docs/examples/tenant_group.py | 77 + docs/examples/tunnel.py | 84 ++ docs/examples/tunnel_group.py | 77 + docs/examples/tunnel_termination.py | 82 + docs/examples/virtual_chassis.py | 74 + docs/examples/virtual_circuit.py | 100 ++ docs/examples/virtual_circuit_termination.py | 137 ++ docs/examples/virtual_circuit_type.py | 81 + docs/examples/virtual_device_context.py | 116 ++ docs/examples/virtual_disk.py | 82 + docs/examples/virtual_machine.py | 86 ++ docs/examples/vlan.py | 83 + docs/examples/vlan_group.py | 81 + docs/examples/vlan_translation_policy.py | 70 + docs/examples/vlan_translation_rule.py | 82 + docs/examples/vm_interface.py | 79 + docs/examples/vrf.py | 78 + docs/examples/wireless_lan.py | 80 + docs/examples/wireless_lan_group.py | 79 + docs/examples/wireless_link.py | 149 ++ 96 files changed, 8203 insertions(+), 1411 deletions(-) create mode 100644 docs/README.md create mode 100644 docs/examples/aggregate.py create mode 100644 docs/examples/asn.py create mode 100644 docs/examples/asn_range.py create mode 100644 docs/examples/cable.py create mode 100644 docs/examples/cable_path.py create mode 100644 docs/examples/circuit.py create mode 100644 docs/examples/circuit_group.py create mode 100644 docs/examples/circuit_group_assignment.py create mode 100644 docs/examples/circuit_termination.py create mode 100644 docs/examples/circuit_type.py create mode 100644 docs/examples/cluster.py create mode 100644 docs/examples/cluster_group.py create mode 100644 docs/examples/cluster_type.py create mode 100644 docs/examples/console_port.py create mode 100644 docs/examples/console_server_port.py create mode 100644 docs/examples/contact.py create mode 100644 docs/examples/contact_assignment.py create mode 100644 docs/examples/contact_group.py create mode 100644 docs/examples/contact_role.py create mode 100644 docs/examples/custom_field.py create mode 100644 docs/examples/custom_field_choice_set.py create mode 100644 docs/examples/custom_link.py create mode 100644 docs/examples/device.py create mode 100644 docs/examples/device_bay.py create mode 100644 docs/examples/device_role.py create mode 100644 docs/examples/device_type.py create mode 100644 docs/examples/fhrp_group.py create mode 100644 docs/examples/fhrp_group_assignment.py create mode 100644 docs/examples/front_port.py create mode 100644 docs/examples/ike_policy.py create mode 100644 docs/examples/ike_proposal.py create mode 100644 docs/examples/interface_example.py create mode 100644 docs/examples/inventory_item.py create mode 100644 docs/examples/inventory_item_role.py create mode 100644 docs/examples/ip_address.py create mode 100644 docs/examples/ip_range.py create mode 100644 docs/examples/ip_sec_policy.py create mode 100644 docs/examples/ip_sec_profile.py create mode 100644 docs/examples/ip_sec_proposal.py create mode 100644 docs/examples/journal_entry.py create mode 100644 docs/examples/l2vpn.py create mode 100644 docs/examples/l2vpn_termination.py create mode 100644 docs/examples/location.py create mode 100644 docs/examples/mac_address.py create mode 100644 docs/examples/manufacturer.py create mode 100644 docs/examples/module.py create mode 100644 docs/examples/module_bay.py create mode 100644 docs/examples/module_type.py create mode 100644 docs/examples/module_type_profile.py create mode 100644 docs/examples/owner.py create mode 100644 docs/examples/owner_group.py create mode 100644 docs/examples/platform.py create mode 100644 docs/examples/power_feed.py create mode 100644 docs/examples/power_outlet.py create mode 100644 docs/examples/power_panel.py create mode 100644 docs/examples/power_port.py create mode 100644 docs/examples/prefix.py create mode 100644 docs/examples/provider.py create mode 100644 docs/examples/provider_account.py create mode 100644 docs/examples/provider_network.py create mode 100644 docs/examples/rack.py create mode 100644 docs/examples/rack_reservation.py create mode 100644 docs/examples/rack_role.py create mode 100644 docs/examples/rack_type.py create mode 100644 docs/examples/rear_port.py create mode 100644 docs/examples/region.py create mode 100644 docs/examples/rir.py create mode 100644 docs/examples/role.py create mode 100644 docs/examples/route_target.py create mode 100644 docs/examples/service.py create mode 100644 docs/examples/site.py create mode 100644 docs/examples/site_group.py create mode 100644 docs/examples/tag.py create mode 100644 docs/examples/tenant.py create mode 100644 docs/examples/tenant_group.py create mode 100644 docs/examples/tunnel.py create mode 100644 docs/examples/tunnel_group.py create mode 100644 docs/examples/tunnel_termination.py create mode 100644 docs/examples/virtual_chassis.py create mode 100644 docs/examples/virtual_circuit.py create mode 100644 docs/examples/virtual_circuit_termination.py create mode 100644 docs/examples/virtual_circuit_type.py create mode 100644 docs/examples/virtual_device_context.py create mode 100644 docs/examples/virtual_disk.py create mode 100644 docs/examples/virtual_machine.py create mode 100644 docs/examples/vlan.py create mode 100644 docs/examples/vlan_group.py create mode 100644 docs/examples/vlan_translation_policy.py create mode 100644 docs/examples/vlan_translation_rule.py create mode 100644 docs/examples/vm_interface.py create mode 100644 docs/examples/vrf.py create mode 100644 docs/examples/wireless_lan.py create mode 100644 docs/examples/wireless_lan_group.py create mode 100644 docs/examples/wireless_link.py diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..5146bc7 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,163 @@ +# Diode Python SDK - Entity Examples + +// Source: NetBox v4.5.0 +Generated: 2026-02-02 21:20:55Z + +## Prerequisites + +- Python 3.9 or later +- Diode SDK for Python + +## Installation + +```bash +pip install netboxlabs-diode-sdk +``` + +## Configuration + +Each example uses constants for configuration. You can modify these in the example code: + +```python +TARGET = "grpc://localhost:8080/diode" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" +``` + +## Quick Start + +Each entity example is a standalone Python file. To run an example: + +```bash +python examples/device.py +``` + +## Example Patterns + +Each example module includes three pattern functions: + +- **minimal**: Only required fields (using flat string references) +- **extended**: Required fields plus common optional fields +- **explicit**: Fully nested objects with all common fields + +Switch between patterns by uncommenting the desired function call in `main()`. + +## Available Entity Examples + +### Circuits + +- [Circuit](examples/circuit.py) +- [CircuitGroup](examples/circuit_group.py) +- [CircuitGroupAssignment](examples/circuit_group_assignment.py) +- [CircuitTermination](examples/circuit_termination.py) +- [CircuitType](examples/circuit_type.py) +- [Provider](examples/provider.py) +- [ProviderAccount](examples/provider_account.py) +- [ProviderNetwork](examples/provider_network.py) +- [VirtualCircuit](examples/virtual_circuit.py) +- [VirtualCircuitTermination](examples/virtual_circuit_termination.py) +- [VirtualCircuitType](examples/virtual_circuit_type.py) + +### DCIM + +- [Cable](examples/cable.py) +- [CablePath](examples/cable_path.py) +- [ConsolePort](examples/console_port.py) +- [ConsoleServerPort](examples/console_server_port.py) +- [Device](examples/device.py) +- [DeviceBay](examples/device_bay.py) +- [DeviceRole](examples/device_role.py) +- [DeviceType](examples/device_type.py) +- [FrontPort](examples/front_port.py) +- [Interface](examples/interface_example.py) +- [InventoryItem](examples/inventory_item.py) +- [InventoryItemRole](examples/inventory_item_role.py) +- [Location](examples/location.py) +- [Manufacturer](examples/manufacturer.py) +- [Module](examples/module.py) +- [ModuleBay](examples/module_bay.py) +- [ModuleType](examples/module_type.py) +- [ModuleTypeProfile](examples/module_type_profile.py) +- [Platform](examples/platform.py) +- [PowerFeed](examples/power_feed.py) +- [PowerOutlet](examples/power_outlet.py) +- [PowerPanel](examples/power_panel.py) +- [PowerPort](examples/power_port.py) +- [Rack](examples/rack.py) +- [RackReservation](examples/rack_reservation.py) +- [RackRole](examples/rack_role.py) +- [RackType](examples/rack_type.py) +- [RearPort](examples/rear_port.py) +- [Region](examples/region.py) +- [Site](examples/site.py) +- [SiteGroup](examples/site_group.py) +- [VirtualChassis](examples/virtual_chassis.py) +- [VirtualDeviceContext](examples/virtual_device_context.py) + +### Extras + +- [CustomField](examples/custom_field.py) +- [CustomFieldChoiceSet](examples/custom_field_choice_set.py) +- [CustomLink](examples/custom_link.py) +- [JournalEntry](examples/journal_entry.py) +- [Tag](examples/tag.py) + +### IPAM + +- [ASN](examples/asn.py) +- [ASNRange](examples/asn_range.py) +- [Aggregate](examples/aggregate.py) +- [FHRPGroup](examples/fhrp_group.py) +- [FHRPGroupAssignment](examples/fhrp_group_assignment.py) +- [IPAddress](examples/ip_address.py) +- [IPRange](examples/ip_range.py) +- [MACAddress](examples/mac_address.py) +- [Prefix](examples/prefix.py) +- [RIR](examples/rir.py) +- [Role](examples/role.py) +- [RouteTarget](examples/route_target.py) +- [Service](examples/service.py) +- [VLAN](examples/vlan.py) +- [VLANGroup](examples/vlan_group.py) +- [VLANTranslationPolicy](examples/vlan_translation_policy.py) +- [VLANTranslationRule](examples/vlan_translation_rule.py) +- [VRF](examples/vrf.py) + +### Tenancy + +- [Contact](examples/contact.py) +- [ContactAssignment](examples/contact_assignment.py) +- [ContactGroup](examples/contact_group.py) +- [ContactRole](examples/contact_role.py) +- [Owner](examples/owner.py) +- [OwnerGroup](examples/owner_group.py) +- [Tenant](examples/tenant.py) +- [TenantGroup](examples/tenant_group.py) + +### VPN + +- [IKEPolicy](examples/ike_policy.py) +- [IKEProposal](examples/ike_proposal.py) +- [IPSecPolicy](examples/ip_sec_policy.py) +- [IPSecProfile](examples/ip_sec_profile.py) +- [IPSecProposal](examples/ip_sec_proposal.py) +- [L2VPN](examples/l2vpn.py) +- [L2VPNTermination](examples/l2vpn_termination.py) +- [Tunnel](examples/tunnel.py) +- [TunnelGroup](examples/tunnel_group.py) +- [TunnelTermination](examples/tunnel_termination.py) + +### Virtualization + +- [Cluster](examples/cluster.py) +- [ClusterGroup](examples/cluster_group.py) +- [ClusterType](examples/cluster_type.py) +- [VMInterface](examples/vm_interface.py) +- [VirtualDisk](examples/virtual_disk.py) +- [VirtualMachine](examples/virtual_machine.py) + +### Wireless + +- [WirelessLAN](examples/wireless_lan.py) +- [WirelessLANGroup](examples/wireless_lan_group.py) +- [WirelessLink](examples/wireless_link.py) diff --git a/docs/entities.md b/docs/entities.md index d320391..5e8e655 100644 --- a/docs/entities.md +++ b/docs/entities.md @@ -1,1412 +1,3 @@ -# Supported Entities +# Diode Supported Entities -## Device - -Attributes: - -* `name` (str) - device name -* `device_type` (str, [DeviceType](#device-type)) - device type name or DeviceType entity -* `platform` (str, [Platform](#platform)) - platform name or Platform entity -* `manufacturer` (str, [Manufacturer](#manufacturer)) - manufacturer name or Manufacturer entity -* `site` (str, [Site](#site)) - site name or Site entity -* `role` (str, [Role](#role)) - role name or Role entity -* `serial` (str) - serial number -* `asset_tag` (str) - asset tag -* `status` (str) - status (e.g. `active`, `planned`, `staged`, `failed`, `inventory`, `decommissioning`, `offine`) -* `comments` (str) - comments -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Device, - DeviceType, - Entity, - Manufacturer, - Platform, - Role, - Site, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - Device entity with only a name provided will attempt to create or update a device with - the given name and placeholders (i.e. "undefined") for other nested objects types - (e.g. DeviceType, Platform, Site, Role) required by NetBox. - """ - - device = Device(name="Device A") - - entities.append(Entity(device=device)) - - """ - Device entity using flat data structure. - """ - - device_flat = Device( - name="Device A", - device_type="Device Type A", - platform="Platform A", - manufacturer="Manufacturer A", - site="Site ABC", - role="Role ABC", - serial="123456", - asset_tag="123456", - status="active", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(device=device_flat)) - - """ - Device entity using explicit data structure. - """ - - device_explicit = Device( - name="Device A", - device_type=DeviceType( - model="Device Type A", manufacturer=Manufacturer(name="Manufacturer A") - ), - platform=Platform( - name="Platform A", manufacturer=Manufacturer(name="Manufacturer A") - ), - site=Site(name="Site ABC"), - role=Role(name="Role ABC", tags=["tag 1", "tag 3"]), - serial="123456", - asset_tag="123456", - status="active", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(device=device_explicit)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() -``` - -## Interface - -Attributes: - -* `name` (str) - interface name -* `device` (str, [Device](#device)) - device name or Device entity -* `device_type` (str, [DeviceType](#device-type)) - device type name or DeviceType entity -* `role` (str, [Role](#role)) - role name or Role entity -* `platform` (str, [Platform](#platform)) - platform name or Platform entity -* `manufacturer` (str, [Manufacturer](#manufacturer)) - manufacturer name or Manufacturer entity -* `site` (str, [Site](#site)) - site name or Site entity -* `type` (str) - interface type (e.g. `virtual`, `other`, etc.) -* `enabled` (bool) - is the interface enabled -* `mtu` (int) - maximum transmission unit -* `mac_address` (str) - MAC address -* `speed` (int) - speed -* `wwn` (str) - world wide name -* `mgmt_only` (bool) - is the interface for management only -* `description` (str) - description -* `mark_connected` (bool) - mark connected -* `mode` (str) - mode (`access`, `tagged`, `tagged-all`) -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Device, - DeviceType, - Entity, - Interface, - Manufacturer, - Platform, - Role, - Site, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - Interface entity with only a name provided will attempt to create or update an interface with - the given name and placeholders (i.e. "undefined") for other nested objects types - (e.g. Device, DeviceType, Platform, Site, Role) required by NetBox. - """ - - interface = Interface(name="Interface A") - - entities.append(Entity(interface=interface)) - - """ - Interface entity using flat data structure. - """ - - interface_flat = Interface( - name="Interface A", - device="Device A", - device_type="Device Type A", - role="Role ABC", - platform="Platform A", - site="Site ABC", - type="virtual", - enabled=True, - mtu=1500, - mac_address="00:00:00:00:00:00", - description="Interface A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(interface=interface_flat)) - - """ - Interface entity using explicit data structure. - """ - - interface_explicit = Interface( - name="Interface A", - device=Device( - name="Device A", - device_type=DeviceType( - model="Device Type A", - manufacturer=Manufacturer(name="Manufacturer A"), - ), - platform=Platform( - name="Platform A", manufacturer=Manufacturer(name="Manufacturer A") - ), - site=Site(name="Site ABC"), - role=Role(name="Role ABC", tags=["tag 1", "tag 3"]), - ), - type="virtual", - enabled=True, - mtu=1500, - mac_address="00:00:00:00:00:00", - description="Interface A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(interface=interface_explicit)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## Device Type - -Attributes: - -* `model` (str) - device type model -* `slug` (str) - slug -* `manufacturer` (str, [Manufacturer](#manufacturer)) - manufacturer name or Manufacturer entity -* `description` (str) - description -* `comments` (str) - comments -* `part_number` (str) - part number -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - DeviceType, - Entity, - Manufacturer, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - DeviceType entity with only a name provided will attempt to create or update a device type with - the given name and placeholder (i.e. "undefined") for nested Manufacturer object type - required by NetBox. - """ - - device_type = DeviceType(model="Device Type A") - - entities.append(Entity(device_type=device_type)) - - """ - DeviceType entity using flat data structure. - """ - - device_type_flat = DeviceType( - model="Device Type A", - manufacturer="Manufacturer A", - part_number="123456", - description="Device Type A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(device_type=device_type_flat)) - - """ - DeviceType entity using explicit data structure. - """ - - device_type_explicit = DeviceType( - model="Device Type A", - manufacturer=Manufacturer( - name="Manufacturer A", - description="Manufacturer A description", - tags=["tag 1", "tag 2"], - ), - part_number="123456", - description="Device Type A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(device_type=device_type_explicit)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## Platform - -Attributes: - -* `name` (str) - platform name -* `slug` (str) - slug -* `manufacturer` (str, [Manufacturer](#manufacturer)) - manufacturer name or Manufacturer entity -* `description` (str) - description -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - Manufacturer, - Platform, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - Platform entity with only a name provided will attempt to create or update a platform with - the given name and placeholders (i.e. "undefined") for other nested objects types (e.g. Manufacturer) - required by NetBox. - """ - - platform = Platform( - name="Platform A", - ) - - entities.append(Entity(platform=platform)) - - """ - Platform entity using flat data structure. - """ - - platform_flat = Platform( - name="Platform A", - manufacturer="Manufacturer A", - description="Platform A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(platform=platform_flat)) - - """ - Platform entity using explicit data structure. - """ - - platform_explicit = Platform( - name="Platform A", - manufacturer=Manufacturer(name="Manufacturer A", tags=["tag 1", "tag 3"]), - description="Platform A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(platform=platform_explicit)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## Manufacturer - -Attributes: - -* `name` (str) - manufacturer name -* `slug` (str) - slug -* `description` (str) - description -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - Manufacturer, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - Manufacturer entity. - """ - - manufacturer = Manufacturer( - name="Manufacturer A", - description="Manufacturer A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(manufacturer=manufacturer)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## Site - -Attributes: - -* `name` (str) - site name -* `slug` (str) - slug -* `status` (str) - status (`active`, `planned`, `retired`, `staging`, `decommissioning`) -* `facility` (str) - facility -* `time_zone` (str) - time zone -* `description` (str) - description -* `comments` (str) - comments -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - Site, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - Site entity. - """ - - site = Site( - name="Site A", - status="active", - facility="Data Center 1", - time_zone="UTC", - description="Site A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(site=site)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## Role - -Attributes: - -* `name` (str) - role name -* `slug` (str) - slug -* `color` (str) - color -* `description` (str) - description -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - Role, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - Role entity. - """ - - role = Role( - name="Role A", - slug="role-a", - color="ffffff", - description="Role A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(device_role=role)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## IP Address - -Attributes: - -* `address` (str) - IP address -* `interface` (str, [Interface](#interface)) - interface name or Interface entity -* `device` (str, [Device](#device)) - device name or Device entity -* `device_type` (str, [DeviceType](#device-type)) - device type name or DeviceType entity -* `device_role` (str, [Role](#role)) - device role name or Role entity -* `platform` (str, [Platform](#platform)) - platform name or Platform entity -* `manufacturer` (str, [Manufacturer](#manufacturer)) - manufacturer name or Manufacturer entity -* `site` (str, Site) - site name or Site entity -* `status` (str) - status (`active`, `reserved`, `deprecated`, `dhcp`, `slaac`) -* `role` (str) - role (`loopback`, `secondary`, `anycast`, `vip`, `vrrp`, `hsrp`, `glbp`, `carp`) -* `dns_name` (str) - DNS name -* `description` (str) - description -* `comments` (str) - comments -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Device, - DeviceType, - Entity, - Interface, - IPAddress, - Manufacturer, - Platform, - Role, - Site, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - IPAddress entity with only an address provided will attempt to create or update an IP address with - the given address and placeholders (i.e. "undefined") for other nested objects types - (e.g. Interface, Device, DeviceType, Platform, Site, Role) required by NetBox. - """ - - ip_address = IPAddress( - address="192.168.0.1/24", - ) - - entities.append(Entity(ip_address=ip_address)) - - """ - IPAddress entity using flat data structure. - """ - - ip_address_flat = IPAddress( - address="192.168.0.1/24", - interface="Interface ABC", - device="Device ABC", - device_type="Device Type ABC", - device_role="Role ABC", - platform="Platform ABC", - manufacturer="Cisco", - site="Site ABC", - status="active", - role="Role ABC", - description="IP Address A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag1", "tag2"], - ) - - entities.append(Entity(ip_address=ip_address_flat)) - - """ - IPAddress entity using explicit data structure. - """ - - ip_address_explicit = IPAddress( - address="192.168.0.1/24", - interface=Interface( - name="Interface ABC", - device=Device( - name="Device ABC", - device_type=DeviceType( - model="Device Type ABC", manufacturer=Manufacturer(name="Cisco") - ), - platform=Platform( - name="Platform ABC", manufacturer=Manufacturer(name="Cisco") - ), - site=Site(name="Site ABC"), - role=Role(name="Role ABC", tags=["tag1", "tag3"]), - ), - ), - status="active", - role="Role ABC", - description="IP Address A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag1", "tag2"], - ) - - entities.append(Entity(ip_address=ip_address_explicit)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## Prefix - -Attributes: - -* `prefix` (str) - prefix -* `site` (str, [Site](#site)) - site name or Site entity -* `status` (str) - status (`active`, `reserved`, `deprecated`, `container`) -* `is_pool` (bool) - is pool -* `mark_utilized` (bool) - mark utilized -* `description` (str) - description -* `comments` (str) - comments -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - Prefix, - Site, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - Prefix entity with only a prefix provided will attempt to create or update a prefix with - the given prefix and placeholders (i.e. "undefined") for other nested objects types (e.g. Site) - required by NetBox. - """ - - prefix = Prefix( - prefix="192.168.0.0/32", - ) - - entities.append(Entity(prefix=prefix)) - - """ - Prefix entity using flat data structure. - """ - - prefix_flat = Prefix( - prefix="192.168.0.0/32", - site="Site ABC", - status="active", - is_pool=True, - mark_utilized=True, - description="Prefix A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(prefix=prefix_flat)) - - """ - Prefix entity using explicit data structure. - """ - - prefix_explicit = Prefix( - prefix="192.168.0.0/32", - site=Site( - name="Site ABC", - status="active", - facility="Data Center 1", - time_zone="UTC", - description="Site A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - is_pool=True, - mark_utilized=True, - description="Prefix A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(prefix=prefix_explicit)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## Cluster Type - -Attributes: - -* `name` (str) - cluster type name -* `slug` (str) - slug -* `description` (str) - description -* `tags` (list) - tags - - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - ClusterType, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - ClusterType entity. - """ - - cluster_type = ClusterType( - name="Cluster Type A", - description="Cluster Type A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(cluster_type=cluster_type)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## Cluster Group - -Attributes: - -* `name` (str) - cluster group name -* `slug` (str) - slug -* `description` (str) - description -* `tags` (list) - tags - - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - ClusterGroup, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - ClusterGroup entity. - """ - - cluster_group = ClusterGroup( - name="Cluster Group A", - description="Cluster Group A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(cluster_group=cluster_group)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## Cluster - -Attributes: - -* `name` (str) - cluster name -* `type` (str, [ClusterType](#cluster-type)) - cluster type name or ClusterType entity -* `group` (str, [ClusterGroup](#cluster-group)) - cluster group name or ClusterGroup entity -* `site` (str, [Site](#site)) - site name or Site entity -* `status` (str) - status (`offline`, `active`, `planned`, `staged`, `failed`, `decommissioning`) -* `description` (str) - description -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - Cluster, - ClusterGroup, - ClusterType, - Site, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - Cluster entity with only a name provided will attempt to create or update a cluster with - the given name and placeholders (i.e. "undefined") for other nested objects types - (e.g. ClusterGroup, ClusterType, Site) required by NetBox. - """ - - cluster = Cluster(name="Cluster A") - - entities.append(Entity(cluster=cluster)) - - """ - Cluster entity using flat data structure. - """ - - cluster_flat = Cluster( - name="Cluster A", - type="Cluster Type", - group="Cluster Group", - site="Site ABC", - status="active", - description="Cluster A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(cluster=cluster_flat)) - - """ - Cluster entity using explicit data structure. - """ - - cluster_explicit = Cluster( - name="Cluster A", - type = ClusterType( - name="Cluster Type A", - description="Cluster Type description", - tags=["tag 1", "tag 2"], - ), - group = ClusterGroup( - name="Cluster Group A", - description="Cluster Group description", - tags=["tag 1", "tag 2"], - ), - site=Site( - name="Site ABC", - status="active", - facility="Data Center 1", - time_zone="UTC", - description="Site A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - description="Cluster A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(cluster=cluster_explicit)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## Virtual Machine - -Attributes: - -* `name` (str) - virtual machine name -* `status` (str) - status (`offline`, `active`, `planned`, `staged`, `failed`, `decommissioning`) -* `site` (str, [Site](#site)) - site name or Site entity -* `cluster` (str, [Cluster](#cluster)) - cluster name or Cluster entity -* `role` (str, [Role](#role)) - role name or Role entity -* `device` (str, [Device](#device)) - device name or Device entity -* `platform` (str, [Platform](#platform)) - platform name or Platform entity -* `vcpus` (int) - virtual machine CPU number -* `memory` (int) - virtual machine memory -* `disk` (int) - virtual machine disk size -* `description` (str) - description -* `comments` (str) - comments -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - VirtualMachine, - Cluster, - ClusterGroup, - ClusterType, - Device, - DeviceType, - Manufacturer, - Platform, - Role, - Site, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - VirtualMachine entity with only a name provided will attempt to create or update a name with - the given name and placeholders (i.e. "undefined") for other nested objects types (e.g. Site, - Role, Cluster, Platform, Device) required by NetBox. - """ - - virtual_machine = VirtualMachine(name="VM A") - - entities.append(Entity(virtual_machine=virtual_machine)) - - """ - VirtualMachine entity using flat data structure. - """ - - virtual_machine_flat = VirtualMachine( - name="VM A", - status="active", - cluster="Cluster Type A", - site="Site ABC", - role="Role ABC", - device="Device A", - platform="Platform A", - vcpus=8, - memory=12128, - disk=16786, - description="Virtual Machine A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(virtual_machine=virtual_machine_flat)) - - """ - VirtualMachine entity using explicit data structure. - """ - - virtual_machine_explicit = VirtualMachine( - name="VM A", - status="active", - cluster=Cluster( - name="Cluster A", - type=ClusterType( - name="Cluster Type A", - description="Cluster Type description", - tags=["tag 1", "tag 2"], - ), - group=ClusterGroup( - name="Cluster Group", - description="Cluster Group description", - tags=["tag 1", "tag 2"], - ), - site=Site( - name="Site ABC", - status="active", - facility="Data Center 1", - time_zone="UTC", - description="Site A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - description="Cluster A description", - tags=["tag 1", "tag 2"], - ), - site=Site( - name="Site ABC", - status="active", - facility="Data Center 1", - time_zone="UTC", - description="Site A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - role=Role(name="Role ABC", tags=["tag 1", "tag 3"]), - device=Device( - name="Device A", - device_type=DeviceType( - model="Device Type A", - manufacturer=Manufacturer(name="Manufacturer A"), - ), - platform=Platform( - name="Platform A", manufacturer=Manufacturer(name="Manufacturer A") - ), - site=Site(name="Site ABC"), - role=Role(name="Role ABC", tags=["tag 1", "tag 3"]), - serial="123456", - asset_tag="123456", - status="active", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - platform=Platform( - name="Platform A", manufacturer=Manufacturer(name="Manufacturer A") - ), - vcpus=8, - memory=12128, - disk=16786, - description="Virtual Machine A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(virtual_machine=virtual_machine_explicit)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## Virtual Disk - -Attributes: - -* `name` (str) - virtual disk name -* `virtual_machine` (str, [VirtualMachine](#virtual-machine)) - virtual machine name or VirtualMachine entity -* `size` (int) - disk size -* `description` (str) - description -* `tags` (list) - tags - -### Example -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - VirtualDisk, - VirtualMachine, - Cluster, - ClusterGroup, - ClusterType, - Device, - DeviceType, - Manufacturer, - Platform, - Role, - Site, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - VirtualDisk entity with only a name provided will attempt to create or update a name - with the given name and placeholders (i.e. "undefined") for other nested objects types (e.g. - VirtualMachine) required by NetBox. - """ - - virtual_disk = VirtualDisk(name="Disk A", size=16480) - - entities.append(Entity(virtual_disk=virtual_disk)) - - """ - VirtualDisk entity using flat data structure. - """ - - virtual_disk_flat = VirtualDisk( - name="Disk A", - virtual_machine="VM A", - size=16480, - description="Disk A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(virtual_disk=virtual_disk_flat)) - - """ - VirtualDisk entity using explicit data structure. - """ - - virtual_disk_explicit = VirtualDisk( - name="Disk A", - virtual_machine=VirtualMachine( - name="VM A", - status="active", - cluster=Cluster( - name="Cluster A", - type=ClusterType( - name="Cluster Type A", - description="Cluster Type description", - tags=["tag 1", "tag 2"], - ), - group=ClusterGroup( - name="Cluster Group", - description="Cluster Group description", - tags=["tag 1", "tag 2"], - ), - site=Site( - name="Site ABC", - status="active", - facility="Data Center 1", - time_zone="UTC", - description="Site A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - description="Cluster A description", - tags=["tag 1", "tag 2"], - ), - site=Site( - name="Site ABC", - status="active", - facility="Data Center 1", - time_zone="UTC", - description="Site A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - role=Role(name="Role ABC", tags=["tag 1", "tag 3"]), - device=Device( - name="Device A", - device_type=DeviceType( - model="Device Type A", - manufacturer=Manufacturer(name="Manufacturer A"), - ), - platform=Platform( - name="Platform A", - manufacturer=Manufacturer(name="Manufacturer A"), - ), - site=Site(name="Site ABC"), - role=Role(name="Role ABC", tags=["tag 1", "tag 3"]), - serial="123456", - asset_tag="123456", - status="active", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - platform=Platform( - name="Platform A", manufacturer=Manufacturer(name="Manufacturer A") - ), - vcpus=8, - memory=12128, - disk=16480, - description="Virtual Machine A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - size=16480, - description="Disk A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(virtual_disk=virtual_disk_explicit)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` - -## VM Interface - -Attributes: - -* `name` (str) - virtual interface name -* `virtual_machine` (str, [VirtualMachine](#virtual-machine)) - virtual machine name or VirtualMachine entity -* `enabled` (bool) - is the interface enabled -* `mtu` (int) - maximum transmission unit -* `mac_address` (str) - MAC address -* `description` (str) - description -* `tags` (list) - tags - -### Example - -```python -from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - VMInterface, - VirtualMachine, - Cluster, - ClusterGroup, - ClusterType, - Device, - DeviceType, - Manufacturer, - Platform, - Role, - Site, -) - - -def main(): - with DiodeClient( - target="grpc://localhost:8080/diode", - app_name="my-test-app", - app_version="0.0.1", - ) as client: - entities = [] - - """ - VMInterface entity with only a name provided will attempt to create or update a name - with the given name and placeholders (i.e. "undefined") for other nested objects types (e.g. - VirtualMachine) required by NetBox. - """ - - vminterface = VMInterface(name="Interface A") - - entities.append(Entity(vminterface=vminterface)) - - """ - VMInterface entity using flat data structure. - """ - - vminterface_flat = VMInterface( - name="Interface A", - virtual_machine="VM A", - enabled=True, - mtu=1500, - mac_address="00:00:00:00:00:00", - description="Interface A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(vminterface=vminterface_flat)) - - """ - VMInterface entity using explicit data structure. - """ - - vminterface_explicit = VMInterface( - name="Interface A", - virtual_machine=VirtualMachine( - name="VM A", - status="active", - cluster=Cluster( - name="Cluster A", - type=ClusterType( - name="Cluster Type A", - description="Cluster Type description", - tags=["tag 1", "tag 2"], - ), - group=ClusterGroup( - name="Cluster Group", - description="Cluster Group description", - tags=["tag 1", "tag 2"], - ), - site=Site( - name="Site ABC", - status="active", - facility="Data Center 1", - time_zone="UTC", - description="Site A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - description="Cluster A description", - tags=["tag 1", "tag 2"], - ), - site=Site( - name="Site ABC", - status="active", - facility="Data Center 1", - time_zone="UTC", - description="Site A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - role=Role(name="Role ABC", tags=["tag 1", "tag 3"]), - device=Device( - name="Device A", - device_type=DeviceType( - model="Device Type A", - manufacturer=Manufacturer(name="Manufacturer A"), - ), - platform=Platform( - name="Platform A", - manufacturer=Manufacturer(name="Manufacturer A"), - ), - site=Site(name="Site ABC"), - role=Role(name="Role ABC", tags=["tag 1", "tag 3"]), - serial="123456", - asset_tag="123456", - status="active", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - platform=Platform( - name="Platform A", manufacturer=Manufacturer(name="Manufacturer A") - ), - vcpus=8, - memory=12128, - disk=16480, - description="Virtual Machine A description", - comments="Lorem ipsum dolor sit amet", - tags=["tag 1", "tag 2"], - ), - enabled=True, - mtu=1500, - mac_address="00:00:00:00:00:00", - description="Interface A description", - tags=["tag 1", "tag 2"], - ) - - entities.append(Entity(vminterface=vminterface_explicit)) - - response = client.ingest(entities=entities) - if response.errors: - print(f"Errors: {response.errors}") - - -if __name__ == "__main__": - main() - -``` \ No newline at end of file +See updated docs in [README](README.md) diff --git a/docs/examples/aggregate.py b/docs/examples/aggregate.py new file mode 100644 index 0000000..c2ae030 --- /dev/null +++ b/docs/examples/aggregate.py @@ -0,0 +1,84 @@ +""" +Aggregate entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Aggregate entities: +- aggregate_minimal: Required fields only +- aggregate_extended: Common optional fields +- aggregate_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Aggregate, + Entity, + RIR, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "aggregate-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Aggregate entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + aggregate = aggregate_minimal() + # aggregate = aggregate_extended() + # aggregate = aggregate_explicit() + + response = client.ingest(entities=[Entity(aggregate=aggregate)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Aggregate ingested successfully") + + +def aggregate_minimal() -> Aggregate: + """Create a Aggregate with only required fields using flat strings.""" + return Aggregate( + prefix="192.0.2.0/24", + rir="Example RIR", # flat string -> RIR + metadata={"source": "example"}, + ) + + +def aggregate_extended() -> Aggregate: + """Create a Aggregate with common optional fields.""" + return Aggregate( + prefix="192.0.2.0/24", + rir="Example RIR", + metadata={"source": "example"}, + description="Example description", + ) + + +def aggregate_explicit() -> Aggregate: + """Create a Aggregate with fully nested objects and all common fields.""" + return Aggregate( + prefix="192.0.2.0/24", + rir=RIR( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/asn.py b/docs/examples/asn.py new file mode 100644 index 0000000..698cce7 --- /dev/null +++ b/docs/examples/asn.py @@ -0,0 +1,78 @@ +""" +ASN entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ASN entities: +- asn_minimal: Required fields only +- asn_extended: Common optional fields +- asn_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + ASN, + Entity, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "asn-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ASN entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + asn = asn_minimal() + # asn = asn_extended() + # asn = asn_explicit() + + response = client.ingest(entities=[Entity(asn=asn)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ASN ingested successfully") + + +def asn_minimal() -> ASN: + """Create a ASN with only required fields using flat strings.""" + return ASN( + asn=64512, + metadata={"source": "example"}, + ) + + +def asn_extended() -> ASN: + """Create a ASN with common optional fields.""" + return ASN( + asn=64512, + metadata={"source": "example"}, + description="Example description", + ) + + +def asn_explicit() -> ASN: + """Create a ASN with fully nested objects and all common fields.""" + return ASN( + asn=64512, + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/asn_range.py b/docs/examples/asn_range.py new file mode 100644 index 0000000..492504e --- /dev/null +++ b/docs/examples/asn_range.py @@ -0,0 +1,93 @@ +""" +ASNRange entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ASNRange entities: +- asn_range_minimal: Required fields only +- asn_range_extended: Common optional fields +- asn_range_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + ASNRange, + Entity, + RIR, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "asn_range-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ASNRange entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + asn_range = asn_range_minimal() + # asn_range = asn_range_extended() + # asn_range = asn_range_explicit() + + response = client.ingest(entities=[Entity(asn_range=asn_range)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ASNRange ingested successfully") + + +def asn_range_minimal() -> ASNRange: + """Create a ASNRange with only required fields using flat strings.""" + return ASNRange( + name="Example Name", + slug="example-slug", + rir="Example RIR", # flat string -> RIR + start=1, + end=1, + metadata={"source": "example"}, + ) + + +def asn_range_extended() -> ASNRange: + """Create a ASNRange with common optional fields.""" + return ASNRange( + name="Example Name", + slug="example-slug", + rir="Example RIR", + start=1, + end=1, + metadata={"source": "example"}, + description="Example description", + ) + + +def asn_range_explicit() -> ASNRange: + """Create a ASNRange with fully nested objects and all common fields.""" + return ASNRange( + name="Example Name", + slug="example-slug", + rir=RIR( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + start=1, + end=1, + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/cable.py b/docs/examples/cable.py new file mode 100644 index 0000000..c3bc9c3 --- /dev/null +++ b/docs/examples/cable.py @@ -0,0 +1,79 @@ +""" +Cable entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Cable entities: +- cable_minimal: Required fields only +- cable_extended: Common optional fields +- cable_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Cable, + Entity, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "cable-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Cable entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + cable = cable_minimal() + # cable = cable_extended() + # cable = cable_explicit() + + response = client.ingest(entities=[Entity(cable=cable)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Cable ingested successfully") + + +def cable_minimal() -> Cable: + """Create a Cable with only required fields using flat strings.""" + return Cable( + metadata={"source": "example"}, + ) + + +def cable_extended() -> Cable: + """Create a Cable with common optional fields.""" + return Cable( + metadata={"source": "example"}, + status="connected", + color="0000ff", + description="Example description", + ) + + +def cable_explicit() -> Cable: + """Create a Cable with fully nested objects and all common fields.""" + return Cable( + metadata={"source": "example"}, + status="connected", + color="0000ff", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/cable_path.py b/docs/examples/cable_path.py new file mode 100644 index 0000000..4bdd078 --- /dev/null +++ b/docs/examples/cable_path.py @@ -0,0 +1,62 @@ +""" +CablePath entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting CablePath entities: +- cable_path_minimal: Required fields only +- cable_path_extended: Common optional fields +- cable_path_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "cable_path-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a CablePath entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + cable_path = cable_path_minimal() + # cable_path = cable_path_extended() + # cable_path = cable_path_explicit() + + response = client.ingest(entities=[Entity(cable_path=cable_path)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("CablePath ingested successfully") + + +def cable_path_minimal() -> CablePath: + """Create a CablePath with only required fields using flat strings.""" + return CablePath( + metadata={"source": "example"}, + ) + + +def cable_path_extended() -> CablePath: + """Create a CablePath with common optional fields.""" + return CablePath( + metadata={"source": "example"}, + ) + + +def cable_path_explicit() -> CablePath: + """Create a CablePath with fully nested objects and all common fields.""" + return CablePath( + metadata={"source": "example"}, + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/circuit.py b/docs/examples/circuit.py new file mode 100644 index 0000000..7364e6c --- /dev/null +++ b/docs/examples/circuit.py @@ -0,0 +1,95 @@ +""" +Circuit entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Circuit entities: +- circuit_minimal: Required fields only +- circuit_extended: Common optional fields +- circuit_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Circuit, + CircuitType, + Entity, + Provider, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "circuit-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Circuit entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + circuit = circuit_minimal() + # circuit = circuit_extended() + # circuit = circuit_explicit() + + response = client.ingest(entities=[Entity(circuit=circuit)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Circuit ingested successfully") + + +def circuit_minimal() -> Circuit: + """Create a Circuit with only required fields using flat strings.""" + return Circuit( + cid="CID-001", + provider="Example Provider", # flat string -> Provider + type="Example Type", # flat string -> CircuitType + metadata={"source": "example"}, + ) + + +def circuit_extended() -> Circuit: + """Create a Circuit with common optional fields.""" + return Circuit( + cid="CID-001", + provider="Example Provider", + type="Example Type", + metadata={"source": "example"}, + status="active", + description="Example description", + ) + + +def circuit_explicit() -> Circuit: + """Create a Circuit with fully nested objects and all common fields.""" + return Circuit( + cid="CID-001", + provider=Provider( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + type=CircuitType( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + metadata={"source": "example"}, + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/circuit_group.py b/docs/examples/circuit_group.py new file mode 100644 index 0000000..02520ed --- /dev/null +++ b/docs/examples/circuit_group.py @@ -0,0 +1,81 @@ +""" +CircuitGroup entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting CircuitGroup entities: +- circuit_group_minimal: Required fields only +- circuit_group_extended: Common optional fields +- circuit_group_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + CircuitGroup, + Entity, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "circuit_group-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a CircuitGroup entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + circuit_group = circuit_group_minimal() + # circuit_group = circuit_group_extended() + # circuit_group = circuit_group_explicit() + + response = client.ingest(entities=[Entity(circuit_group=circuit_group)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("CircuitGroup ingested successfully") + + +def circuit_group_minimal() -> CircuitGroup: + """Create a CircuitGroup with only required fields using flat strings.""" + return CircuitGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def circuit_group_extended() -> CircuitGroup: + """Create a CircuitGroup with common optional fields.""" + return CircuitGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def circuit_group_explicit() -> CircuitGroup: + """Create a CircuitGroup with fully nested objects and all common fields.""" + return CircuitGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/circuit_group_assignment.py b/docs/examples/circuit_group_assignment.py new file mode 100644 index 0000000..31fcd2a --- /dev/null +++ b/docs/examples/circuit_group_assignment.py @@ -0,0 +1,76 @@ +""" +CircuitGroupAssignment entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting CircuitGroupAssignment entities: +- circuit_group_assignment_minimal: Required fields only +- circuit_group_assignment_extended: Common optional fields +- circuit_group_assignment_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + CircuitGroup, + CircuitGroupAssignment, + Entity, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "circuit_group_assignment-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a CircuitGroupAssignment entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + circuit_group_assignment = circuit_group_assignment_minimal() + # circuit_group_assignment = circuit_group_assignment_extended() + # circuit_group_assignment = circuit_group_assignment_explicit() + + response = client.ingest( + entities=[Entity(circuit_group_assignment=circuit_group_assignment)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("CircuitGroupAssignment ingested successfully") + + +def circuit_group_assignment_minimal() -> CircuitGroupAssignment: + """Create a CircuitGroupAssignment with only required fields using flat strings.""" + return CircuitGroupAssignment( + group="Example Group", # flat string -> CircuitGroup + metadata={"source": "example"}, + ) + + +def circuit_group_assignment_extended() -> CircuitGroupAssignment: + """Create a CircuitGroupAssignment with common optional fields.""" + return CircuitGroupAssignment( + group="Example Group", + metadata={"source": "example"}, + ) + + +def circuit_group_assignment_explicit() -> CircuitGroupAssignment: + """Create a CircuitGroupAssignment with fully nested objects and all common fields.""" + return CircuitGroupAssignment( + group=CircuitGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + metadata={"source": "example"}, + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/circuit_termination.py b/docs/examples/circuit_termination.py new file mode 100644 index 0000000..ebf841b --- /dev/null +++ b/docs/examples/circuit_termination.py @@ -0,0 +1,94 @@ +""" +CircuitTermination entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting CircuitTermination entities: +- circuit_termination_minimal: Required fields only +- circuit_termination_extended: Common optional fields +- circuit_termination_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Circuit, + CircuitTermination, + CircuitType, + Entity, + Provider, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "circuit_termination-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a CircuitTermination entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + circuit_termination = circuit_termination_minimal() + # circuit_termination = circuit_termination_extended() + # circuit_termination = circuit_termination_explicit() + + response = client.ingest( + entities=[Entity(circuit_termination=circuit_termination)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("CircuitTermination ingested successfully") + + +def circuit_termination_minimal() -> CircuitTermination: + """Create a CircuitTermination with only required fields using flat strings.""" + return CircuitTermination( + circuit="Example Circuit", # flat string -> Circuit + term_side="A", + metadata={"source": "example"}, + ) + + +def circuit_termination_extended() -> CircuitTermination: + """Create a CircuitTermination with common optional fields.""" + return CircuitTermination( + circuit="Example Circuit", + term_side="A", + metadata={"source": "example"}, + description="Example description", + ) + + +def circuit_termination_explicit() -> CircuitTermination: + """Create a CircuitTermination with fully nested objects and all common fields.""" + return CircuitTermination( + circuit=Circuit( + cid="CID-001", + provider=Provider( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + type=CircuitType( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + term_side="A", + metadata={"source": "example"}, + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/circuit_type.py b/docs/examples/circuit_type.py new file mode 100644 index 0000000..98fea08 --- /dev/null +++ b/docs/examples/circuit_type.py @@ -0,0 +1,79 @@ +""" +CircuitType entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting CircuitType entities: +- circuit_type_minimal: Required fields only +- circuit_type_extended: Common optional fields +- circuit_type_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + CircuitType, + Entity, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "circuit_type-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a CircuitType entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + circuit_type = circuit_type_minimal() + # circuit_type = circuit_type_extended() + # circuit_type = circuit_type_explicit() + + response = client.ingest(entities=[Entity(circuit_type=circuit_type)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("CircuitType ingested successfully") + + +def circuit_type_minimal() -> CircuitType: + """Create a CircuitType with only required fields using flat strings.""" + return CircuitType( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def circuit_type_extended() -> CircuitType: + """Create a CircuitType with common optional fields.""" + return CircuitType( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + ) + + +def circuit_type_explicit() -> CircuitType: + """Create a CircuitType with fully nested objects and all common fields.""" + return CircuitType( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/cluster.py b/docs/examples/cluster.py new file mode 100644 index 0000000..6b37003 --- /dev/null +++ b/docs/examples/cluster.py @@ -0,0 +1,86 @@ +""" +Cluster entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Cluster entities: +- cluster_minimal: Required fields only +- cluster_extended: Common optional fields +- cluster_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Cluster, + ClusterType, + Entity, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "cluster-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Cluster entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + cluster = cluster_minimal() + # cluster = cluster_extended() + # cluster = cluster_explicit() + + response = client.ingest(entities=[Entity(cluster=cluster)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Cluster ingested successfully") + + +def cluster_minimal() -> Cluster: + """Create a Cluster with only required fields using flat strings.""" + return Cluster( + name="Example Name", + type="Example Type", # flat string -> ClusterType + metadata={"source": "example"}, + ) + + +def cluster_extended() -> Cluster: + """Create a Cluster with common optional fields.""" + return Cluster( + name="Example Name", + type="Example Type", + metadata={"source": "example"}, + status="active", + description="Example description", + ) + + +def cluster_explicit() -> Cluster: + """Create a Cluster with fully nested objects and all common fields.""" + return Cluster( + name="Example Name", + type=ClusterType( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + metadata={"source": "example"}, + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/cluster_group.py b/docs/examples/cluster_group.py new file mode 100644 index 0000000..9d48651 --- /dev/null +++ b/docs/examples/cluster_group.py @@ -0,0 +1,77 @@ +""" +ClusterGroup entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ClusterGroup entities: +- cluster_group_minimal: Required fields only +- cluster_group_extended: Common optional fields +- cluster_group_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + ClusterGroup, + Entity, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "cluster_group-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ClusterGroup entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + cluster_group = cluster_group_minimal() + # cluster_group = cluster_group_extended() + # cluster_group = cluster_group_explicit() + + response = client.ingest(entities=[Entity(cluster_group=cluster_group)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ClusterGroup ingested successfully") + + +def cluster_group_minimal() -> ClusterGroup: + """Create a ClusterGroup with only required fields using flat strings.""" + return ClusterGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def cluster_group_extended() -> ClusterGroup: + """Create a ClusterGroup with common optional fields.""" + return ClusterGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def cluster_group_explicit() -> ClusterGroup: + """Create a ClusterGroup with fully nested objects and all common fields.""" + return ClusterGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/cluster_type.py b/docs/examples/cluster_type.py new file mode 100644 index 0000000..f03b059 --- /dev/null +++ b/docs/examples/cluster_type.py @@ -0,0 +1,77 @@ +""" +ClusterType entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ClusterType entities: +- cluster_type_minimal: Required fields only +- cluster_type_extended: Common optional fields +- cluster_type_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + ClusterType, + Entity, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "cluster_type-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ClusterType entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + cluster_type = cluster_type_minimal() + # cluster_type = cluster_type_extended() + # cluster_type = cluster_type_explicit() + + response = client.ingest(entities=[Entity(cluster_type=cluster_type)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ClusterType ingested successfully") + + +def cluster_type_minimal() -> ClusterType: + """Create a ClusterType with only required fields using flat strings.""" + return ClusterType( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def cluster_type_extended() -> ClusterType: + """Create a ClusterType with common optional fields.""" + return ClusterType( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def cluster_type_explicit() -> ClusterType: + """Create a ClusterType with fully nested objects and all common fields.""" + return ClusterType( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/console_port.py b/docs/examples/console_port.py new file mode 100644 index 0000000..2be7044 --- /dev/null +++ b/docs/examples/console_port.py @@ -0,0 +1,106 @@ +""" +ConsolePort entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ConsolePort entities: +- console_port_minimal: Required fields only +- console_port_extended: Common optional fields +- console_port_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + ConsolePort, + Device, + DeviceRole, + DeviceType, + Entity, + Manufacturer, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "console_port-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ConsolePort entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + console_port = console_port_minimal() + # console_port = console_port_extended() + # console_port = console_port_explicit() + + response = client.ingest(entities=[Entity(console_port=console_port)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ConsolePort ingested successfully") + + +def console_port_minimal() -> ConsolePort: + """Create a ConsolePort with only required fields using flat strings.""" + return ConsolePort( + device="Example Device", # flat string -> Device + name="Example Name", + metadata={"source": "example"}, + ) + + +def console_port_extended() -> ConsolePort: + """Create a ConsolePort with common optional fields.""" + return ConsolePort( + device="Example Device", + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def console_port_explicit() -> ConsolePort: + """Create a ConsolePort with fully nested objects and all common fields.""" + return ConsolePort( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/console_server_port.py b/docs/examples/console_server_port.py new file mode 100644 index 0000000..5b349d9 --- /dev/null +++ b/docs/examples/console_server_port.py @@ -0,0 +1,108 @@ +""" +ConsoleServerPort entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ConsoleServerPort entities: +- console_server_port_minimal: Required fields only +- console_server_port_extended: Common optional fields +- console_server_port_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + ConsoleServerPort, + Device, + DeviceRole, + DeviceType, + Entity, + Manufacturer, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "console_server_port-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ConsoleServerPort entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + console_server_port = console_server_port_minimal() + # console_server_port = console_server_port_extended() + # console_server_port = console_server_port_explicit() + + response = client.ingest( + entities=[Entity(console_server_port=console_server_port)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ConsoleServerPort ingested successfully") + + +def console_server_port_minimal() -> ConsoleServerPort: + """Create a ConsoleServerPort with only required fields using flat strings.""" + return ConsoleServerPort( + device="Example Device", # flat string -> Device + name="Example Name", + metadata={"source": "example"}, + ) + + +def console_server_port_extended() -> ConsoleServerPort: + """Create a ConsoleServerPort with common optional fields.""" + return ConsoleServerPort( + device="Example Device", + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def console_server_port_explicit() -> ConsoleServerPort: + """Create a ConsoleServerPort with fully nested objects and all common fields.""" + return ConsoleServerPort( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/contact.py b/docs/examples/contact.py new file mode 100644 index 0000000..ec0380a --- /dev/null +++ b/docs/examples/contact.py @@ -0,0 +1,74 @@ +""" +Contact entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Contact entities: +- contact_minimal: Required fields only +- contact_extended: Common optional fields +- contact_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Contact, + Entity, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "contact-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Contact entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + contact = contact_minimal() + # contact = contact_extended() + # contact = contact_explicit() + + response = client.ingest(entities=[Entity(contact=contact)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Contact ingested successfully") + + +def contact_minimal() -> Contact: + """Create a Contact with only required fields using flat strings.""" + return Contact( + name="Example Name", + metadata={"source": "example"}, + ) + + +def contact_extended() -> Contact: + """Create a Contact with common optional fields.""" + return Contact( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def contact_explicit() -> Contact: + """Create a Contact with fully nested objects and all common fields.""" + return Contact( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/contact_assignment.py b/docs/examples/contact_assignment.py new file mode 100644 index 0000000..b527fc7 --- /dev/null +++ b/docs/examples/contact_assignment.py @@ -0,0 +1,74 @@ +""" +ContactAssignment entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ContactAssignment entities: +- contact_assignment_minimal: Required fields only +- contact_assignment_extended: Common optional fields +- contact_assignment_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Contact, + ContactAssignment, + Entity, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "contact_assignment-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ContactAssignment entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + contact_assignment = contact_assignment_minimal() + # contact_assignment = contact_assignment_extended() + # contact_assignment = contact_assignment_explicit() + + response = client.ingest( + entities=[Entity(contact_assignment=contact_assignment)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ContactAssignment ingested successfully") + + +def contact_assignment_minimal() -> ContactAssignment: + """Create a ContactAssignment with only required fields using flat strings.""" + return ContactAssignment( + contact="Example Contact", # flat string -> Contact + metadata={"source": "example"}, + ) + + +def contact_assignment_extended() -> ContactAssignment: + """Create a ContactAssignment with common optional fields.""" + return ContactAssignment( + contact="Example Contact", + metadata={"source": "example"}, + ) + + +def contact_assignment_explicit() -> ContactAssignment: + """Create a ContactAssignment with fully nested objects and all common fields.""" + return ContactAssignment( + contact=Contact(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/contact_group.py b/docs/examples/contact_group.py new file mode 100644 index 0000000..4038984 --- /dev/null +++ b/docs/examples/contact_group.py @@ -0,0 +1,77 @@ +""" +ContactGroup entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ContactGroup entities: +- contact_group_minimal: Required fields only +- contact_group_extended: Common optional fields +- contact_group_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + ContactGroup, + Entity, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "contact_group-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ContactGroup entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + contact_group = contact_group_minimal() + # contact_group = contact_group_extended() + # contact_group = contact_group_explicit() + + response = client.ingest(entities=[Entity(contact_group=contact_group)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ContactGroup ingested successfully") + + +def contact_group_minimal() -> ContactGroup: + """Create a ContactGroup with only required fields using flat strings.""" + return ContactGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def contact_group_extended() -> ContactGroup: + """Create a ContactGroup with common optional fields.""" + return ContactGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def contact_group_explicit() -> ContactGroup: + """Create a ContactGroup with fully nested objects and all common fields.""" + return ContactGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/contact_role.py b/docs/examples/contact_role.py new file mode 100644 index 0000000..2bfa99a --- /dev/null +++ b/docs/examples/contact_role.py @@ -0,0 +1,77 @@ +""" +ContactRole entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ContactRole entities: +- contact_role_minimal: Required fields only +- contact_role_extended: Common optional fields +- contact_role_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + ContactRole, + Entity, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "contact_role-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ContactRole entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + contact_role = contact_role_minimal() + # contact_role = contact_role_extended() + # contact_role = contact_role_explicit() + + response = client.ingest(entities=[Entity(contact_role=contact_role)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ContactRole ingested successfully") + + +def contact_role_minimal() -> ContactRole: + """Create a ContactRole with only required fields using flat strings.""" + return ContactRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def contact_role_extended() -> ContactRole: + """Create a ContactRole with common optional fields.""" + return ContactRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def contact_role_explicit() -> ContactRole: + """Create a ContactRole with fully nested objects and all common fields.""" + return ContactRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/custom_field.py b/docs/examples/custom_field.py new file mode 100644 index 0000000..77d61e1 --- /dev/null +++ b/docs/examples/custom_field.py @@ -0,0 +1,71 @@ +""" +CustomField entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting CustomField entities: +- custom_field_minimal: Required fields only +- custom_field_extended: Common optional fields +- custom_field_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "custom_field-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a CustomField entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + custom_field = custom_field_minimal() + # custom_field = custom_field_extended() + # custom_field = custom_field_explicit() + + response = client.ingest(entities=[Entity(custom_field=custom_field)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("CustomField ingested successfully") + + +def custom_field_minimal() -> CustomField: + """Create a CustomField with only required fields using flat strings.""" + return CustomField( + type="boolean", + name="Example Name", + metadata={"source": "example"}, + ) + + +def custom_field_extended() -> CustomField: + """Create a CustomField with common optional fields.""" + return CustomField( + type="boolean", + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def custom_field_explicit() -> CustomField: + """Create a CustomField with fully nested objects and all common fields.""" + return CustomField( + type="boolean", + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/custom_field_choice_set.py b/docs/examples/custom_field_choice_set.py new file mode 100644 index 0000000..80cf659 --- /dev/null +++ b/docs/examples/custom_field_choice_set.py @@ -0,0 +1,69 @@ +""" +CustomFieldChoiceSet entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting CustomFieldChoiceSet entities: +- custom_field_choice_set_minimal: Required fields only +- custom_field_choice_set_extended: Common optional fields +- custom_field_choice_set_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "custom_field_choice_set-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a CustomFieldChoiceSet entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + custom_field_choice_set = custom_field_choice_set_minimal() + # custom_field_choice_set = custom_field_choice_set_extended() + # custom_field_choice_set = custom_field_choice_set_explicit() + + response = client.ingest( + entities=[Entity(custom_field_choice_set=custom_field_choice_set)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("CustomFieldChoiceSet ingested successfully") + + +def custom_field_choice_set_minimal() -> CustomFieldChoiceSet: + """Create a CustomFieldChoiceSet with only required fields using flat strings.""" + return CustomFieldChoiceSet( + name="Example Name", + metadata={"source": "example"}, + ) + + +def custom_field_choice_set_extended() -> CustomFieldChoiceSet: + """Create a CustomFieldChoiceSet with common optional fields.""" + return CustomFieldChoiceSet( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def custom_field_choice_set_explicit() -> CustomFieldChoiceSet: + """Create a CustomFieldChoiceSet with fully nested objects and all common fields.""" + return CustomFieldChoiceSet( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/custom_link.py b/docs/examples/custom_link.py new file mode 100644 index 0000000..e920a42 --- /dev/null +++ b/docs/examples/custom_link.py @@ -0,0 +1,71 @@ +""" +CustomLink entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting CustomLink entities: +- custom_link_minimal: Required fields only +- custom_link_extended: Common optional fields +- custom_link_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "custom_link-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a CustomLink entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + custom_link = custom_link_minimal() + # custom_link = custom_link_extended() + # custom_link = custom_link_explicit() + + response = client.ingest(entities=[Entity(custom_link=custom_link)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("CustomLink ingested successfully") + + +def custom_link_minimal() -> CustomLink: + """Create a CustomLink with only required fields using flat strings.""" + return CustomLink( + name="Example Name", + link_text="Example Link Text", + link_url="Example Link Url", + metadata={"source": "example"}, + ) + + +def custom_link_extended() -> CustomLink: + """Create a CustomLink with common optional fields.""" + return CustomLink( + name="Example Name", + link_text="Example Link Text", + link_url="Example Link Url", + metadata={"source": "example"}, + ) + + +def custom_link_explicit() -> CustomLink: + """Create a CustomLink with fully nested objects and all common fields.""" + return CustomLink( + name="Example Name", + link_text="Example Link Text", + link_url="Example Link Url", + metadata={"source": "example"}, + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/device.py b/docs/examples/device.py new file mode 100644 index 0000000..08350ef --- /dev/null +++ b/docs/examples/device.py @@ -0,0 +1,114 @@ +""" +Device entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Device entities: +- device_minimal: Required fields only +- device_extended: Common optional fields +- device_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + Manufacturer, + Platform, + Site, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "device-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Device entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + device = device_minimal() + # device = device_extended() + # device = device_explicit() + + response = client.ingest(entities=[Entity(device=device)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Device ingested successfully") + + +def device_minimal() -> Device: + """Create a Device with only required fields using flat strings.""" + return Device( + device_type="Model X", # flat string -> DeviceType + role="Example Role", # flat string -> DeviceRole + site="Example Site", # flat string -> Site + metadata={"source": "example"}, + ) + + +def device_extended() -> Device: + """Create a Device with common optional fields.""" + return Device( + device_type="Model X", + role="Example Role", + site="Example Site", + metadata={"source": "example"}, + serial="SN-001234", + status="active", + description="Example description", + ) + + +def device_explicit() -> Device: + """Create a Device with fully nested objects and all common fields.""" + return Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + metadata={"source": "example"}, + serial="SN-001234", + asset_tag="ASSET-001", + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + platform=Platform( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/device_bay.py b/docs/examples/device_bay.py new file mode 100644 index 0000000..5fc92db --- /dev/null +++ b/docs/examples/device_bay.py @@ -0,0 +1,106 @@ +""" +DeviceBay entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting DeviceBay entities: +- device_bay_minimal: Required fields only +- device_bay_extended: Common optional fields +- device_bay_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceBay, + DeviceRole, + DeviceType, + Entity, + Manufacturer, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "device_bay-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a DeviceBay entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + device_bay = device_bay_minimal() + # device_bay = device_bay_extended() + # device_bay = device_bay_explicit() + + response = client.ingest(entities=[Entity(device_bay=device_bay)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("DeviceBay ingested successfully") + + +def device_bay_minimal() -> DeviceBay: + """Create a DeviceBay with only required fields using flat strings.""" + return DeviceBay( + device="Example Device", # flat string -> Device + name="Example Name", + metadata={"source": "example"}, + ) + + +def device_bay_extended() -> DeviceBay: + """Create a DeviceBay with common optional fields.""" + return DeviceBay( + device="Example Device", + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def device_bay_explicit() -> DeviceBay: + """Create a DeviceBay with fully nested objects and all common fields.""" + return DeviceBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/device_role.py b/docs/examples/device_role.py new file mode 100644 index 0000000..df11336 --- /dev/null +++ b/docs/examples/device_role.py @@ -0,0 +1,79 @@ +""" +DeviceRole entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting DeviceRole entities: +- device_role_minimal: Required fields only +- device_role_extended: Common optional fields +- device_role_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + DeviceRole, + Entity, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "device_role-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a DeviceRole entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + device_role = device_role_minimal() + # device_role = device_role_extended() + # device_role = device_role_explicit() + + response = client.ingest(entities=[Entity(device_role=device_role)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("DeviceRole ingested successfully") + + +def device_role_minimal() -> DeviceRole: + """Create a DeviceRole with only required fields using flat strings.""" + return DeviceRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def device_role_extended() -> DeviceRole: + """Create a DeviceRole with common optional fields.""" + return DeviceRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + ) + + +def device_role_explicit() -> DeviceRole: + """Create a DeviceRole with fully nested objects and all common fields.""" + return DeviceRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/device_type.py b/docs/examples/device_type.py new file mode 100644 index 0000000..a98e754 --- /dev/null +++ b/docs/examples/device_type.py @@ -0,0 +1,83 @@ +""" +DeviceType entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting DeviceType entities: +- device_type_minimal: Required fields only +- device_type_extended: Common optional fields +- device_type_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + DeviceType, + Entity, + Manufacturer, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "device_type-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a DeviceType entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + device_type = device_type_minimal() + # device_type = device_type_extended() + # device_type = device_type_explicit() + + response = client.ingest(entities=[Entity(device_type=device_type)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("DeviceType ingested successfully") + + +def device_type_minimal() -> DeviceType: + """Create a DeviceType with only required fields using flat strings.""" + return DeviceType( + manufacturer="Example Manufacturer", # flat string -> Manufacturer + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def device_type_extended() -> DeviceType: + """Create a DeviceType with common optional fields.""" + return DeviceType( + manufacturer="Example Manufacturer", + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def device_type_explicit() -> DeviceType: + """Create a DeviceType with fully nested objects and all common fields.""" + return DeviceType( + manufacturer=Manufacturer( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/fhrp_group.py b/docs/examples/fhrp_group.py new file mode 100644 index 0000000..6367166 --- /dev/null +++ b/docs/examples/fhrp_group.py @@ -0,0 +1,77 @@ +""" +FHRPGroup entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting FHRPGroup entities: +- fhrp_group_minimal: Required fields only +- fhrp_group_extended: Common optional fields +- fhrp_group_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + FHRPGroup, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "fhrp_group-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a FHRPGroup entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + fhrp_group = fhrp_group_minimal() + # fhrp_group = fhrp_group_extended() + # fhrp_group = fhrp_group_explicit() + + response = client.ingest(entities=[Entity(fhrp_group=fhrp_group)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("FHRPGroup ingested successfully") + + +def fhrp_group_minimal() -> FHRPGroup: + """Create a FHRPGroup with only required fields using flat strings.""" + return FHRPGroup( + protocol="carp", + group_id=1, + metadata={"source": "example"}, + ) + + +def fhrp_group_extended() -> FHRPGroup: + """Create a FHRPGroup with common optional fields.""" + return FHRPGroup( + protocol="carp", + group_id=1, + metadata={"source": "example"}, + description="Example description", + ) + + +def fhrp_group_explicit() -> FHRPGroup: + """Create a FHRPGroup with fully nested objects and all common fields.""" + return FHRPGroup( + protocol="carp", + group_id=1, + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/fhrp_group_assignment.py b/docs/examples/fhrp_group_assignment.py new file mode 100644 index 0000000..9ea731b --- /dev/null +++ b/docs/examples/fhrp_group_assignment.py @@ -0,0 +1,77 @@ +""" +FHRPGroupAssignment entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting FHRPGroupAssignment entities: +- fhrp_group_assignment_minimal: Required fields only +- fhrp_group_assignment_extended: Common optional fields +- fhrp_group_assignment_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + FHRPGroup, + FHRPGroupAssignment, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "fhrp_group_assignment-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a FHRPGroupAssignment entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + fhrp_group_assignment = fhrp_group_assignment_minimal() + # fhrp_group_assignment = fhrp_group_assignment_extended() + # fhrp_group_assignment = fhrp_group_assignment_explicit() + + response = client.ingest( + entities=[Entity(fhrp_group_assignment=fhrp_group_assignment)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("FHRPGroupAssignment ingested successfully") + + +def fhrp_group_assignment_minimal() -> FHRPGroupAssignment: + """Create a FHRPGroupAssignment with only required fields using flat strings.""" + return FHRPGroupAssignment( + group="Example Group", # flat string -> FHRPGroup + priority=1, + metadata={"source": "example"}, + ) + + +def fhrp_group_assignment_extended() -> FHRPGroupAssignment: + """Create a FHRPGroupAssignment with common optional fields.""" + return FHRPGroupAssignment( + group="Example Group", + priority=1, + metadata={"source": "example"}, + ) + + +def fhrp_group_assignment_explicit() -> FHRPGroupAssignment: + """Create a FHRPGroupAssignment with fully nested objects and all common fields.""" + return FHRPGroupAssignment( + group=FHRPGroup( + protocol="Example Protocol", group_id=1, metadata={"source": "example"} + ), + priority=1, + metadata={"source": "example"}, + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/front_port.py b/docs/examples/front_port.py new file mode 100644 index 0000000..8e7b456 --- /dev/null +++ b/docs/examples/front_port.py @@ -0,0 +1,111 @@ +""" +FrontPort entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting FrontPort entities: +- front_port_minimal: Required fields only +- front_port_extended: Common optional fields +- front_port_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + FrontPort, + Manufacturer, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "front_port-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a FrontPort entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + front_port = front_port_minimal() + # front_port = front_port_extended() + # front_port = front_port_explicit() + + response = client.ingest(entities=[Entity(front_port=front_port)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("FrontPort ingested successfully") + + +def front_port_minimal() -> FrontPort: + """Create a FrontPort with only required fields using flat strings.""" + return FrontPort( + device="Example Device", # flat string -> Device + name="Example Name", + type="110-punch", + metadata={"source": "example"}, + ) + + +def front_port_extended() -> FrontPort: + """Create a FrontPort with common optional fields.""" + return FrontPort( + device="Example Device", + name="Example Name", + type="110-punch", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + ) + + +def front_port_explicit() -> FrontPort: + """Create a FrontPort with fully nested objects and all common fields.""" + return FrontPort( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + type="110-punch", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/ike_policy.py b/docs/examples/ike_policy.py new file mode 100644 index 0000000..dcb89bc --- /dev/null +++ b/docs/examples/ike_policy.py @@ -0,0 +1,77 @@ +""" +IKEPolicy entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting IKEPolicy entities: +- ike_policy_minimal: Required fields only +- ike_policy_extended: Common optional fields +- ike_policy_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + IKEPolicy, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "ike_policy-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a IKEPolicy entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + ike_policy = ike_policy_minimal() + # ike_policy = ike_policy_extended() + # ike_policy = ike_policy_explicit() + + response = client.ingest(entities=[Entity(ike_policy=ike_policy)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("IKEPolicy ingested successfully") + + +def ike_policy_minimal() -> IKEPolicy: + """Create a IKEPolicy with only required fields using flat strings.""" + return IKEPolicy( + name="Example Name", + version=1, + metadata={"source": "example"}, + ) + + +def ike_policy_extended() -> IKEPolicy: + """Create a IKEPolicy with common optional fields.""" + return IKEPolicy( + name="Example Name", + version=1, + metadata={"source": "example"}, + description="Example description", + ) + + +def ike_policy_explicit() -> IKEPolicy: + """Create a IKEPolicy with fully nested objects and all common fields.""" + return IKEPolicy( + name="Example Name", + version=1, + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/ike_proposal.py b/docs/examples/ike_proposal.py new file mode 100644 index 0000000..24c1764 --- /dev/null +++ b/docs/examples/ike_proposal.py @@ -0,0 +1,83 @@ +""" +IKEProposal entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting IKEProposal entities: +- ike_proposal_minimal: Required fields only +- ike_proposal_extended: Common optional fields +- ike_proposal_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + IKEProposal, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "ike_proposal-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a IKEProposal entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + ike_proposal = ike_proposal_minimal() + # ike_proposal = ike_proposal_extended() + # ike_proposal = ike_proposal_explicit() + + response = client.ingest(entities=[Entity(ike_proposal=ike_proposal)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("IKEProposal ingested successfully") + + +def ike_proposal_minimal() -> IKEProposal: + """Create a IKEProposal with only required fields using flat strings.""" + return IKEProposal( + name="Example Name", + authentication_method="certificates", + encryption_algorithm="3des-cbc", + group=1, + metadata={"source": "example"}, + ) + + +def ike_proposal_extended() -> IKEProposal: + """Create a IKEProposal with common optional fields.""" + return IKEProposal( + name="Example Name", + authentication_method="certificates", + encryption_algorithm="3des-cbc", + group=1, + metadata={"source": "example"}, + description="Example description", + ) + + +def ike_proposal_explicit() -> IKEProposal: + """Create a IKEProposal with fully nested objects and all common fields.""" + return IKEProposal( + name="Example Name", + authentication_method="certificates", + encryption_algorithm="3des-cbc", + group=1, + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/interface_example.py b/docs/examples/interface_example.py new file mode 100644 index 0000000..39256ba --- /dev/null +++ b/docs/examples/interface_example.py @@ -0,0 +1,109 @@ +""" +Interface entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Interface entities: +- interface_example_minimal: Required fields only +- interface_example_extended: Common optional fields +- interface_example_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + Interface, + Manufacturer, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "interface-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Interface entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + interface = interface_example_minimal() + # interface = interface_example_extended() + # interface = interface_example_explicit() + + response = client.ingest(entities=[Entity(interface=interface)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Interface ingested successfully") + + +def interface_example_minimal() -> Interface: + """Create a Interface with only required fields using flat strings.""" + return Interface( + device="Example Device", # flat string -> Device + name="Example Name", + type="1000base-bx10-d", + metadata={"source": "example"}, + ) + + +def interface_example_extended() -> Interface: + """Create a Interface with common optional fields.""" + return Interface( + device="Example Device", + name="Example Name", + type="1000base-bx10-d", + metadata={"source": "example"}, + description="Example description", + ) + + +def interface_example_explicit() -> Interface: + """Create a Interface with fully nested objects and all common fields.""" + return Interface( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + type="1000base-bx10-d", + metadata={"source": "example"}, + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/inventory_item.py b/docs/examples/inventory_item.py new file mode 100644 index 0000000..9f6137a --- /dev/null +++ b/docs/examples/inventory_item.py @@ -0,0 +1,111 @@ +""" +InventoryItem entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting InventoryItem entities: +- inventory_item_minimal: Required fields only +- inventory_item_extended: Common optional fields +- inventory_item_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + InventoryItem, + Manufacturer, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "inventory_item-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a InventoryItem entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + inventory_item = inventory_item_minimal() + # inventory_item = inventory_item_extended() + # inventory_item = inventory_item_explicit() + + response = client.ingest(entities=[Entity(inventory_item=inventory_item)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("InventoryItem ingested successfully") + + +def inventory_item_minimal() -> InventoryItem: + """Create a InventoryItem with only required fields using flat strings.""" + return InventoryItem( + device="Example Device", # flat string -> Device + name="Example Name", + metadata={"source": "example"}, + ) + + +def inventory_item_extended() -> InventoryItem: + """Create a InventoryItem with common optional fields.""" + return InventoryItem( + device="Example Device", + name="Example Name", + metadata={"source": "example"}, + status="active", + serial="SN-001234", + description="Example description", + ) + + +def inventory_item_explicit() -> InventoryItem: + """Create a InventoryItem with fully nested objects and all common fields.""" + return InventoryItem( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + status="active", + serial="SN-001234", + asset_tag="ASSET-001", + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/inventory_item_role.py b/docs/examples/inventory_item_role.py new file mode 100644 index 0000000..51442b2 --- /dev/null +++ b/docs/examples/inventory_item_role.py @@ -0,0 +1,81 @@ +""" +InventoryItemRole entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting InventoryItemRole entities: +- inventory_item_role_minimal: Required fields only +- inventory_item_role_extended: Common optional fields +- inventory_item_role_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + InventoryItemRole, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "inventory_item_role-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a InventoryItemRole entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + inventory_item_role = inventory_item_role_minimal() + # inventory_item_role = inventory_item_role_extended() + # inventory_item_role = inventory_item_role_explicit() + + response = client.ingest( + entities=[Entity(inventory_item_role=inventory_item_role)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("InventoryItemRole ingested successfully") + + +def inventory_item_role_minimal() -> InventoryItemRole: + """Create a InventoryItemRole with only required fields using flat strings.""" + return InventoryItemRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def inventory_item_role_extended() -> InventoryItemRole: + """Create a InventoryItemRole with common optional fields.""" + return InventoryItemRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + ) + + +def inventory_item_role_explicit() -> InventoryItemRole: + """Create a InventoryItemRole with fully nested objects and all common fields.""" + return InventoryItemRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/ip_address.py b/docs/examples/ip_address.py new file mode 100644 index 0000000..d085f8a --- /dev/null +++ b/docs/examples/ip_address.py @@ -0,0 +1,80 @@ +""" +IPAddress entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting IPAddress entities: +- ip_address_minimal: Required fields only +- ip_address_extended: Common optional fields +- ip_address_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + IPAddress, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "ip_address-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a IPAddress entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + ip_address = ip_address_minimal() + # ip_address = ip_address_extended() + # ip_address = ip_address_explicit() + + response = client.ingest(entities=[Entity(ip_address=ip_address)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("IPAddress ingested successfully") + + +def ip_address_minimal() -> IPAddress: + """Create a IPAddress with only required fields using flat strings.""" + return IPAddress( + address="192.0.2.1/32", + metadata={"source": "example"}, + ) + + +def ip_address_extended() -> IPAddress: + """Create a IPAddress with common optional fields.""" + return IPAddress( + address="192.0.2.1/32", + metadata={"source": "example"}, + status="active", + description="Example description", + ) + + +def ip_address_explicit() -> IPAddress: + """Create a IPAddress with fully nested objects and all common fields.""" + return IPAddress( + address="192.0.2.1/32", + metadata={"source": "example"}, + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/ip_range.py b/docs/examples/ip_range.py new file mode 100644 index 0000000..8abbf40 --- /dev/null +++ b/docs/examples/ip_range.py @@ -0,0 +1,83 @@ +""" +IPRange entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting IPRange entities: +- ip_range_minimal: Required fields only +- ip_range_extended: Common optional fields +- ip_range_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + IPRange, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "ip_range-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a IPRange entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + ip_range = ip_range_minimal() + # ip_range = ip_range_extended() + # ip_range = ip_range_explicit() + + response = client.ingest(entities=[Entity(ip_range=ip_range)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("IPRange ingested successfully") + + +def ip_range_minimal() -> IPRange: + """Create a IPRange with only required fields using flat strings.""" + return IPRange( + start_address="Example Start Address", + end_address="Example End Address", + metadata={"source": "example"}, + ) + + +def ip_range_extended() -> IPRange: + """Create a IPRange with common optional fields.""" + return IPRange( + start_address="Example Start Address", + end_address="Example End Address", + metadata={"source": "example"}, + status="active", + description="Example description", + ) + + +def ip_range_explicit() -> IPRange: + """Create a IPRange with fully nested objects and all common fields.""" + return IPRange( + start_address="Example Start Address", + end_address="Example End Address", + metadata={"source": "example"}, + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/ip_sec_policy.py b/docs/examples/ip_sec_policy.py new file mode 100644 index 0000000..9240318 --- /dev/null +++ b/docs/examples/ip_sec_policy.py @@ -0,0 +1,74 @@ +""" +IPSecPolicy entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting IPSecPolicy entities: +- ip_sec_policy_minimal: Required fields only +- ip_sec_policy_extended: Common optional fields +- ip_sec_policy_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + IPSecPolicy, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "ip_sec_policy-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a IPSecPolicy entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + ip_sec_policy = ip_sec_policy_minimal() + # ip_sec_policy = ip_sec_policy_extended() + # ip_sec_policy = ip_sec_policy_explicit() + + response = client.ingest(entities=[Entity(ip_sec_policy=ip_sec_policy)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("IPSecPolicy ingested successfully") + + +def ip_sec_policy_minimal() -> IPSecPolicy: + """Create a IPSecPolicy with only required fields using flat strings.""" + return IPSecPolicy( + name="Example Name", + metadata={"source": "example"}, + ) + + +def ip_sec_policy_extended() -> IPSecPolicy: + """Create a IPSecPolicy with common optional fields.""" + return IPSecPolicy( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def ip_sec_policy_explicit() -> IPSecPolicy: + """Create a IPSecPolicy with fully nested objects and all common fields.""" + return IPSecPolicy( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/ip_sec_profile.py b/docs/examples/ip_sec_profile.py new file mode 100644 index 0000000..0db78b4 --- /dev/null +++ b/docs/examples/ip_sec_profile.py @@ -0,0 +1,87 @@ +""" +IPSecProfile entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting IPSecProfile entities: +- ip_sec_profile_minimal: Required fields only +- ip_sec_profile_extended: Common optional fields +- ip_sec_profile_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + IKEPolicy, + IPSecPolicy, + IPSecProfile, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "ip_sec_profile-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a IPSecProfile entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + ip_sec_profile = ip_sec_profile_minimal() + # ip_sec_profile = ip_sec_profile_extended() + # ip_sec_profile = ip_sec_profile_explicit() + + response = client.ingest(entities=[Entity(ip_sec_profile=ip_sec_profile)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("IPSecProfile ingested successfully") + + +def ip_sec_profile_minimal() -> IPSecProfile: + """Create a IPSecProfile with only required fields using flat strings.""" + return IPSecProfile( + name="Example Name", + mode="ah", + ike_policy="Example Ike Policy", # flat string -> IKEPolicy + ipsec_policy="Example Ipsec Policy", # flat string -> IPSecPolicy + metadata={"source": "example"}, + ) + + +def ip_sec_profile_extended() -> IPSecProfile: + """Create a IPSecProfile with common optional fields.""" + return IPSecProfile( + name="Example Name", + mode="ah", + ike_policy="Example Ike Policy", + ipsec_policy="Example Ipsec Policy", + metadata={"source": "example"}, + description="Example description", + ) + + +def ip_sec_profile_explicit() -> IPSecProfile: + """Create a IPSecProfile with fully nested objects and all common fields.""" + return IPSecProfile( + name="Example Name", + mode="ah", + ike_policy=IKEPolicy( + name="Example Name", version=1, metadata={"source": "example"} + ), + ipsec_policy=IPSecPolicy(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/ip_sec_proposal.py b/docs/examples/ip_sec_proposal.py new file mode 100644 index 0000000..5e722f6 --- /dev/null +++ b/docs/examples/ip_sec_proposal.py @@ -0,0 +1,74 @@ +""" +IPSecProposal entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting IPSecProposal entities: +- ip_sec_proposal_minimal: Required fields only +- ip_sec_proposal_extended: Common optional fields +- ip_sec_proposal_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + IPSecProposal, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "ip_sec_proposal-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a IPSecProposal entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + ip_sec_proposal = ip_sec_proposal_minimal() + # ip_sec_proposal = ip_sec_proposal_extended() + # ip_sec_proposal = ip_sec_proposal_explicit() + + response = client.ingest(entities=[Entity(ip_sec_proposal=ip_sec_proposal)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("IPSecProposal ingested successfully") + + +def ip_sec_proposal_minimal() -> IPSecProposal: + """Create a IPSecProposal with only required fields using flat strings.""" + return IPSecProposal( + name="Example Name", + metadata={"source": "example"}, + ) + + +def ip_sec_proposal_extended() -> IPSecProposal: + """Create a IPSecProposal with common optional fields.""" + return IPSecProposal( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def ip_sec_proposal_explicit() -> IPSecProposal: + """Create a IPSecProposal with fully nested objects and all common fields.""" + return IPSecProposal( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/journal_entry.py b/docs/examples/journal_entry.py new file mode 100644 index 0000000..770ff5b --- /dev/null +++ b/docs/examples/journal_entry.py @@ -0,0 +1,71 @@ +""" +JournalEntry entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting JournalEntry entities: +- journal_entry_minimal: Required fields only +- journal_entry_extended: Common optional fields +- journal_entry_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + JournalEntry, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "journal_entry-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a JournalEntry entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + journal_entry = journal_entry_minimal() + # journal_entry = journal_entry_extended() + # journal_entry = journal_entry_explicit() + + response = client.ingest(entities=[Entity(journal_entry=journal_entry)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("JournalEntry ingested successfully") + + +def journal_entry_minimal() -> JournalEntry: + """Create a JournalEntry with only required fields using flat strings.""" + return JournalEntry( + comments="Example comments", + metadata={"source": "example"}, + ) + + +def journal_entry_extended() -> JournalEntry: + """Create a JournalEntry with common optional fields.""" + return JournalEntry( + comments="Example comments", + metadata={"source": "example"}, + ) + + +def journal_entry_explicit() -> JournalEntry: + """Create a JournalEntry with fully nested objects and all common fields.""" + return JournalEntry( + comments="Example comments", + metadata={"source": "example"}, + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/l2vpn.py b/docs/examples/l2vpn.py new file mode 100644 index 0000000..69d899d --- /dev/null +++ b/docs/examples/l2vpn.py @@ -0,0 +1,83 @@ +""" +L2VPN entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting L2VPN entities: +- l2vpn_minimal: Required fields only +- l2vpn_extended: Common optional fields +- l2vpn_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + L2VPN, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "l2vpn-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a L2VPN entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + l2vpn = l2vpn_minimal() + # l2vpn = l2vpn_extended() + # l2vpn = l2vpn_explicit() + + response = client.ingest(entities=[Entity(l2vpn=l2vpn)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("L2VPN ingested successfully") + + +def l2vpn_minimal() -> L2VPN: + """Create a L2VPN with only required fields using flat strings.""" + return L2VPN( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def l2vpn_extended() -> L2VPN: + """Create a L2VPN with common optional fields.""" + return L2VPN( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + status="active", + description="Example description", + ) + + +def l2vpn_explicit() -> L2VPN: + """Create a L2VPN with fully nested objects and all common fields.""" + return L2VPN( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/l2vpn_termination.py b/docs/examples/l2vpn_termination.py new file mode 100644 index 0000000..2eb22e6 --- /dev/null +++ b/docs/examples/l2vpn_termination.py @@ -0,0 +1,77 @@ +""" +L2VPNTermination entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting L2VPNTermination entities: +- l2vpn_termination_minimal: Required fields only +- l2vpn_termination_extended: Common optional fields +- l2vpn_termination_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + L2VPN, + L2VPNTermination, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "l2vpn_termination-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a L2VPNTermination entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + l2vpn_termination = l2vpn_termination_minimal() + # l2vpn_termination = l2vpn_termination_extended() + # l2vpn_termination = l2vpn_termination_explicit() + + response = client.ingest(entities=[Entity(l2vpn_termination=l2vpn_termination)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("L2VPNTermination ingested successfully") + + +def l2vpn_termination_minimal() -> L2VPNTermination: + """Create a L2VPNTermination with only required fields using flat strings.""" + return L2VPNTermination( + l2vpn="Example L2Vpn", # flat string -> L2VPN + metadata={"source": "example"}, + ) + + +def l2vpn_termination_extended() -> L2VPNTermination: + """Create a L2VPNTermination with common optional fields.""" + return L2VPNTermination( + l2vpn="Example L2Vpn", + metadata={"source": "example"}, + ) + + +def l2vpn_termination_explicit() -> L2VPNTermination: + """Create a L2VPNTermination with fully nested objects and all common fields.""" + return L2VPNTermination( + l2vpn=L2VPN( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + metadata={"source": "example"}, + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/location.py b/docs/examples/location.py new file mode 100644 index 0000000..9ec90e2 --- /dev/null +++ b/docs/examples/location.py @@ -0,0 +1,92 @@ +""" +Location entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Location entities: +- location_minimal: Required fields only +- location_extended: Common optional fields +- location_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Location, + Site, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "location-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Location entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + location = location_minimal() + # location = location_extended() + # location = location_explicit() + + response = client.ingest(entities=[Entity(location=location)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Location ingested successfully") + + +def location_minimal() -> Location: + """Create a Location with only required fields using flat strings.""" + return Location( + name="Example Name", + slug="example-slug", + site="Example Site", # flat string -> Site + metadata={"source": "example"}, + ) + + +def location_extended() -> Location: + """Create a Location with common optional fields.""" + return Location( + name="Example Name", + slug="example-slug", + site="Example Site", + metadata={"source": "example"}, + status="active", + description="Example description", + ) + + +def location_explicit() -> Location: + """Create a Location with fully nested objects and all common fields.""" + return Location( + name="Example Name", + slug="example-slug", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + metadata={"source": "example"}, + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/mac_address.py b/docs/examples/mac_address.py new file mode 100644 index 0000000..992fcc9 --- /dev/null +++ b/docs/examples/mac_address.py @@ -0,0 +1,74 @@ +""" +MACAddress entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting MACAddress entities: +- mac_address_minimal: Required fields only +- mac_address_extended: Common optional fields +- mac_address_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + MACAddress, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "mac_address-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a MACAddress entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + mac_address = mac_address_minimal() + # mac_address = mac_address_extended() + # mac_address = mac_address_explicit() + + response = client.ingest(entities=[Entity(mac_address=mac_address)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("MACAddress ingested successfully") + + +def mac_address_minimal() -> MACAddress: + """Create a MACAddress with only required fields using flat strings.""" + return MACAddress( + mac_address="00:11:22:33:44:55", + metadata={"source": "example"}, + ) + + +def mac_address_extended() -> MACAddress: + """Create a MACAddress with common optional fields.""" + return MACAddress( + mac_address="00:11:22:33:44:55", + metadata={"source": "example"}, + description="Example description", + ) + + +def mac_address_explicit() -> MACAddress: + """Create a MACAddress with fully nested objects and all common fields.""" + return MACAddress( + mac_address="00:11:22:33:44:55", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/manufacturer.py b/docs/examples/manufacturer.py new file mode 100644 index 0000000..3195d15 --- /dev/null +++ b/docs/examples/manufacturer.py @@ -0,0 +1,77 @@ +""" +Manufacturer entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Manufacturer entities: +- manufacturer_minimal: Required fields only +- manufacturer_extended: Common optional fields +- manufacturer_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Manufacturer, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "manufacturer-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Manufacturer entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + manufacturer = manufacturer_minimal() + # manufacturer = manufacturer_extended() + # manufacturer = manufacturer_explicit() + + response = client.ingest(entities=[Entity(manufacturer=manufacturer)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Manufacturer ingested successfully") + + +def manufacturer_minimal() -> Manufacturer: + """Create a Manufacturer with only required fields using flat strings.""" + return Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def manufacturer_extended() -> Manufacturer: + """Create a Manufacturer with common optional fields.""" + return Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def manufacturer_explicit() -> Manufacturer: + """Create a Manufacturer with fully nested objects and all common fields.""" + return Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/module.py b/docs/examples/module.py new file mode 100644 index 0000000..51095e3 --- /dev/null +++ b/docs/examples/module.py @@ -0,0 +1,152 @@ +""" +Module entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Module entities: +- module_minimal: Required fields only +- module_extended: Common optional fields +- module_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + Manufacturer, + Module, + ModuleBay, + ModuleType, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "module-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Module entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + module = module_minimal() + # module = module_extended() + # module = module_explicit() + + response = client.ingest(entities=[Entity(module=module)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Module ingested successfully") + + +def module_minimal() -> Module: + """Create a Module with only required fields using flat strings.""" + return Module( + device="Example Device", # flat string -> Device + module_bay="Example Module Bay", # flat string -> ModuleBay + module_type="Example Module Type", # flat string -> ModuleType + metadata={"source": "example"}, + ) + + +def module_extended() -> Module: + """Create a Module with common optional fields.""" + return Module( + device="Example Device", + module_bay="Example Module Bay", + module_type="Example Module Type", + metadata={"source": "example"}, + status="active", + serial="SN-001234", + description="Example description", + ) + + +def module_explicit() -> Module: + """Create a Module with fully nested objects and all common fields.""" + return Module( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + module_bay=ModuleBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + module_type=ModuleType( + manufacturer=Manufacturer( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + model="Model X", + metadata={"source": "example"}, + ), + metadata={"source": "example"}, + status="active", + serial="SN-001234", + asset_tag="ASSET-001", + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/module_bay.py b/docs/examples/module_bay.py new file mode 100644 index 0000000..bcbcfba --- /dev/null +++ b/docs/examples/module_bay.py @@ -0,0 +1,106 @@ +""" +ModuleBay entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ModuleBay entities: +- module_bay_minimal: Required fields only +- module_bay_extended: Common optional fields +- module_bay_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + Manufacturer, + ModuleBay, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "module_bay-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ModuleBay entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + module_bay = module_bay_minimal() + # module_bay = module_bay_extended() + # module_bay = module_bay_explicit() + + response = client.ingest(entities=[Entity(module_bay=module_bay)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ModuleBay ingested successfully") + + +def module_bay_minimal() -> ModuleBay: + """Create a ModuleBay with only required fields using flat strings.""" + return ModuleBay( + device="Example Device", # flat string -> Device + name="Example Name", + metadata={"source": "example"}, + ) + + +def module_bay_extended() -> ModuleBay: + """Create a ModuleBay with common optional fields.""" + return ModuleBay( + device="Example Device", + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def module_bay_explicit() -> ModuleBay: + """Create a ModuleBay with fully nested objects and all common fields.""" + return ModuleBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/module_type.py b/docs/examples/module_type.py new file mode 100644 index 0000000..41f71ef --- /dev/null +++ b/docs/examples/module_type.py @@ -0,0 +1,80 @@ +""" +ModuleType entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ModuleType entities: +- module_type_minimal: Required fields only +- module_type_extended: Common optional fields +- module_type_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Manufacturer, + ModuleType, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "module_type-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ModuleType entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + module_type = module_type_minimal() + # module_type = module_type_extended() + # module_type = module_type_explicit() + + response = client.ingest(entities=[Entity(module_type=module_type)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ModuleType ingested successfully") + + +def module_type_minimal() -> ModuleType: + """Create a ModuleType with only required fields using flat strings.""" + return ModuleType( + manufacturer="Example Manufacturer", # flat string -> Manufacturer + model="Model X", + metadata={"source": "example"}, + ) + + +def module_type_extended() -> ModuleType: + """Create a ModuleType with common optional fields.""" + return ModuleType( + manufacturer="Example Manufacturer", + model="Model X", + metadata={"source": "example"}, + description="Example description", + ) + + +def module_type_explicit() -> ModuleType: + """Create a ModuleType with fully nested objects and all common fields.""" + return ModuleType( + manufacturer=Manufacturer( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + model="Model X", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/module_type_profile.py b/docs/examples/module_type_profile.py new file mode 100644 index 0000000..37e2fe1 --- /dev/null +++ b/docs/examples/module_type_profile.py @@ -0,0 +1,76 @@ +""" +ModuleTypeProfile entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ModuleTypeProfile entities: +- module_type_profile_minimal: Required fields only +- module_type_profile_extended: Common optional fields +- module_type_profile_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + ModuleTypeProfile, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "module_type_profile-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ModuleTypeProfile entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + module_type_profile = module_type_profile_minimal() + # module_type_profile = module_type_profile_extended() + # module_type_profile = module_type_profile_explicit() + + response = client.ingest( + entities=[Entity(module_type_profile=module_type_profile)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ModuleTypeProfile ingested successfully") + + +def module_type_profile_minimal() -> ModuleTypeProfile: + """Create a ModuleTypeProfile with only required fields using flat strings.""" + return ModuleTypeProfile( + name="Example Name", + metadata={"source": "example"}, + ) + + +def module_type_profile_extended() -> ModuleTypeProfile: + """Create a ModuleTypeProfile with common optional fields.""" + return ModuleTypeProfile( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def module_type_profile_explicit() -> ModuleTypeProfile: + """Create a ModuleTypeProfile with fully nested objects and all common fields.""" + return ModuleTypeProfile( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/owner.py b/docs/examples/owner.py new file mode 100644 index 0000000..42a9753 --- /dev/null +++ b/docs/examples/owner.py @@ -0,0 +1,75 @@ +""" +Owner entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Owner entities: +- owner_minimal: Required fields only +- owner_extended: Common optional fields +- owner_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Owner, + OwnerGroup, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "owner-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Owner entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + owner = owner_minimal() + # owner = owner_extended() + # owner = owner_explicit() + + response = client.ingest(entities=[Entity(owner=owner)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Owner ingested successfully") + + +def owner_minimal() -> Owner: + """Create a Owner with only required fields using flat strings.""" + return Owner( + name="Example Name", + group="Example Group", # flat string -> OwnerGroup + metadata={"source": "example"}, + ) + + +def owner_extended() -> Owner: + """Create a Owner with common optional fields.""" + return Owner( + name="Example Name", + group="Example Group", + metadata={"source": "example"}, + description="Example description", + ) + + +def owner_explicit() -> Owner: + """Create a Owner with fully nested objects and all common fields.""" + return Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + description="Example description", + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/owner_group.py b/docs/examples/owner_group.py new file mode 100644 index 0000000..4484758 --- /dev/null +++ b/docs/examples/owner_group.py @@ -0,0 +1,67 @@ +""" +OwnerGroup entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting OwnerGroup entities: +- owner_group_minimal: Required fields only +- owner_group_extended: Common optional fields +- owner_group_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "owner_group-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a OwnerGroup entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + owner_group = owner_group_minimal() + # owner_group = owner_group_extended() + # owner_group = owner_group_explicit() + + response = client.ingest(entities=[Entity(owner_group=owner_group)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("OwnerGroup ingested successfully") + + +def owner_group_minimal() -> OwnerGroup: + """Create a OwnerGroup with only required fields using flat strings.""" + return OwnerGroup( + name="Example Name", + metadata={"source": "example"}, + ) + + +def owner_group_extended() -> OwnerGroup: + """Create a OwnerGroup with common optional fields.""" + return OwnerGroup( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def owner_group_explicit() -> OwnerGroup: + """Create a OwnerGroup with fully nested objects and all common fields.""" + return OwnerGroup( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/platform.py b/docs/examples/platform.py new file mode 100644 index 0000000..7615f01 --- /dev/null +++ b/docs/examples/platform.py @@ -0,0 +1,77 @@ +""" +Platform entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Platform entities: +- platform_minimal: Required fields only +- platform_extended: Common optional fields +- platform_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Platform, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "platform-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Platform entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + platform = platform_minimal() + # platform = platform_extended() + # platform = platform_explicit() + + response = client.ingest(entities=[Entity(platform=platform)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Platform ingested successfully") + + +def platform_minimal() -> Platform: + """Create a Platform with only required fields using flat strings.""" + return Platform( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def platform_extended() -> Platform: + """Create a Platform with common optional fields.""" + return Platform( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def platform_explicit() -> Platform: + """Create a Platform with fully nested objects and all common fields.""" + return Platform( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/power_feed.py b/docs/examples/power_feed.py new file mode 100644 index 0000000..586624a --- /dev/null +++ b/docs/examples/power_feed.py @@ -0,0 +1,94 @@ +""" +PowerFeed entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting PowerFeed entities: +- power_feed_minimal: Required fields only +- power_feed_extended: Common optional fields +- power_feed_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + PowerFeed, + PowerPanel, + Site, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "power_feed-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a PowerFeed entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + power_feed = power_feed_minimal() + # power_feed = power_feed_extended() + # power_feed = power_feed_explicit() + + response = client.ingest(entities=[Entity(power_feed=power_feed)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("PowerFeed ingested successfully") + + +def power_feed_minimal() -> PowerFeed: + """Create a PowerFeed with only required fields using flat strings.""" + return PowerFeed( + power_panel="Example Power Panel", # flat string -> PowerPanel + name="Example Name", + metadata={"source": "example"}, + ) + + +def power_feed_extended() -> PowerFeed: + """Create a PowerFeed with common optional fields.""" + return PowerFeed( + power_panel="Example Power Panel", + name="Example Name", + metadata={"source": "example"}, + status="active", + description="Example description", + ) + + +def power_feed_explicit() -> PowerFeed: + """Create a PowerFeed with fully nested objects and all common fields.""" + return PowerFeed( + power_panel=PowerPanel( + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/power_outlet.py b/docs/examples/power_outlet.py new file mode 100644 index 0000000..e5ee4ae --- /dev/null +++ b/docs/examples/power_outlet.py @@ -0,0 +1,110 @@ +""" +PowerOutlet entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting PowerOutlet entities: +- power_outlet_minimal: Required fields only +- power_outlet_extended: Common optional fields +- power_outlet_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + Manufacturer, + PowerOutlet, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "power_outlet-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a PowerOutlet entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + power_outlet = power_outlet_minimal() + # power_outlet = power_outlet_extended() + # power_outlet = power_outlet_explicit() + + response = client.ingest(entities=[Entity(power_outlet=power_outlet)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("PowerOutlet ingested successfully") + + +def power_outlet_minimal() -> PowerOutlet: + """Create a PowerOutlet with only required fields using flat strings.""" + return PowerOutlet( + device="Example Device", # flat string -> Device + name="Example Name", + metadata={"source": "example"}, + ) + + +def power_outlet_extended() -> PowerOutlet: + """Create a PowerOutlet with common optional fields.""" + return PowerOutlet( + device="Example Device", + name="Example Name", + metadata={"source": "example"}, + status="disabled", + color="0000ff", + description="Example description", + ) + + +def power_outlet_explicit() -> PowerOutlet: + """Create a PowerOutlet with fully nested objects and all common fields.""" + return PowerOutlet( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + status="disabled", + color="0000ff", + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/power_panel.py b/docs/examples/power_panel.py new file mode 100644 index 0000000..c83a8ae --- /dev/null +++ b/docs/examples/power_panel.py @@ -0,0 +1,83 @@ +""" +PowerPanel entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting PowerPanel entities: +- power_panel_minimal: Required fields only +- power_panel_extended: Common optional fields +- power_panel_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + PowerPanel, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "power_panel-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a PowerPanel entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + power_panel = power_panel_minimal() + # power_panel = power_panel_extended() + # power_panel = power_panel_explicit() + + response = client.ingest(entities=[Entity(power_panel=power_panel)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("PowerPanel ingested successfully") + + +def power_panel_minimal() -> PowerPanel: + """Create a PowerPanel with only required fields using flat strings.""" + return PowerPanel( + site="Example Site", # flat string -> Site + name="Example Name", + metadata={"source": "example"}, + ) + + +def power_panel_extended() -> PowerPanel: + """Create a PowerPanel with common optional fields.""" + return PowerPanel( + site="Example Site", + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def power_panel_explicit() -> PowerPanel: + """Create a PowerPanel with fully nested objects and all common fields.""" + return PowerPanel( + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/power_port.py b/docs/examples/power_port.py new file mode 100644 index 0000000..6dcf618 --- /dev/null +++ b/docs/examples/power_port.py @@ -0,0 +1,106 @@ +""" +PowerPort entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting PowerPort entities: +- power_port_minimal: Required fields only +- power_port_extended: Common optional fields +- power_port_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + Manufacturer, + PowerPort, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "power_port-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a PowerPort entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + power_port = power_port_minimal() + # power_port = power_port_extended() + # power_port = power_port_explicit() + + response = client.ingest(entities=[Entity(power_port=power_port)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("PowerPort ingested successfully") + + +def power_port_minimal() -> PowerPort: + """Create a PowerPort with only required fields using flat strings.""" + return PowerPort( + device="Example Device", # flat string -> Device + name="Example Name", + metadata={"source": "example"}, + ) + + +def power_port_extended() -> PowerPort: + """Create a PowerPort with common optional fields.""" + return PowerPort( + device="Example Device", + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def power_port_explicit() -> PowerPort: + """Create a PowerPort with fully nested objects and all common fields.""" + return PowerPort( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/prefix.py b/docs/examples/prefix.py new file mode 100644 index 0000000..b3bd3ac --- /dev/null +++ b/docs/examples/prefix.py @@ -0,0 +1,80 @@ +""" +Prefix entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Prefix entities: +- prefix_minimal: Required fields only +- prefix_extended: Common optional fields +- prefix_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Prefix, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "prefix-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Prefix entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + prefix = prefix_minimal() + # prefix = prefix_extended() + # prefix = prefix_explicit() + + response = client.ingest(entities=[Entity(prefix=prefix)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Prefix ingested successfully") + + +def prefix_minimal() -> Prefix: + """Create a Prefix with only required fields using flat strings.""" + return Prefix( + prefix="192.0.2.0/24", + metadata={"source": "example"}, + ) + + +def prefix_extended() -> Prefix: + """Create a Prefix with common optional fields.""" + return Prefix( + prefix="192.0.2.0/24", + metadata={"source": "example"}, + status="active", + description="Example description", + ) + + +def prefix_explicit() -> Prefix: + """Create a Prefix with fully nested objects and all common fields.""" + return Prefix( + prefix="192.0.2.0/24", + metadata={"source": "example"}, + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/provider.py b/docs/examples/provider.py new file mode 100644 index 0000000..22ece7c --- /dev/null +++ b/docs/examples/provider.py @@ -0,0 +1,77 @@ +""" +Provider entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Provider entities: +- provider_minimal: Required fields only +- provider_extended: Common optional fields +- provider_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Provider, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "provider-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Provider entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + provider = provider_minimal() + # provider = provider_extended() + # provider = provider_explicit() + + response = client.ingest(entities=[Entity(provider=provider)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Provider ingested successfully") + + +def provider_minimal() -> Provider: + """Create a Provider with only required fields using flat strings.""" + return Provider( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def provider_extended() -> Provider: + """Create a Provider with common optional fields.""" + return Provider( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def provider_explicit() -> Provider: + """Create a Provider with fully nested objects and all common fields.""" + return Provider( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/provider_account.py b/docs/examples/provider_account.py new file mode 100644 index 0000000..021c13e --- /dev/null +++ b/docs/examples/provider_account.py @@ -0,0 +1,80 @@ +""" +ProviderAccount entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ProviderAccount entities: +- provider_account_minimal: Required fields only +- provider_account_extended: Common optional fields +- provider_account_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Provider, + ProviderAccount, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "provider_account-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ProviderAccount entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + provider_account = provider_account_minimal() + # provider_account = provider_account_extended() + # provider_account = provider_account_explicit() + + response = client.ingest(entities=[Entity(provider_account=provider_account)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ProviderAccount ingested successfully") + + +def provider_account_minimal() -> ProviderAccount: + """Create a ProviderAccount with only required fields using flat strings.""" + return ProviderAccount( + provider="Example Provider", # flat string -> Provider + account="Example Account", + metadata={"source": "example"}, + ) + + +def provider_account_extended() -> ProviderAccount: + """Create a ProviderAccount with common optional fields.""" + return ProviderAccount( + provider="Example Provider", + account="Example Account", + metadata={"source": "example"}, + description="Example description", + ) + + +def provider_account_explicit() -> ProviderAccount: + """Create a ProviderAccount with fully nested objects and all common fields.""" + return ProviderAccount( + provider=Provider( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + account="Example Account", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/provider_network.py b/docs/examples/provider_network.py new file mode 100644 index 0000000..0a411d2 --- /dev/null +++ b/docs/examples/provider_network.py @@ -0,0 +1,80 @@ +""" +ProviderNetwork entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting ProviderNetwork entities: +- provider_network_minimal: Required fields only +- provider_network_extended: Common optional fields +- provider_network_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Provider, + ProviderNetwork, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "provider_network-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a ProviderNetwork entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + provider_network = provider_network_minimal() + # provider_network = provider_network_extended() + # provider_network = provider_network_explicit() + + response = client.ingest(entities=[Entity(provider_network=provider_network)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("ProviderNetwork ingested successfully") + + +def provider_network_minimal() -> ProviderNetwork: + """Create a ProviderNetwork with only required fields using flat strings.""" + return ProviderNetwork( + provider="Example Provider", # flat string -> Provider + name="Example Name", + metadata={"source": "example"}, + ) + + +def provider_network_extended() -> ProviderNetwork: + """Create a ProviderNetwork with common optional fields.""" + return ProviderNetwork( + provider="Example Provider", + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def provider_network_explicit() -> ProviderNetwork: + """Create a ProviderNetwork with fully nested objects and all common fields.""" + return ProviderNetwork( + provider=Provider( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/rack.py b/docs/examples/rack.py new file mode 100644 index 0000000..dbaf88f --- /dev/null +++ b/docs/examples/rack.py @@ -0,0 +1,92 @@ +""" +Rack entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Rack entities: +- rack_minimal: Required fields only +- rack_extended: Common optional fields +- rack_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Rack, + Site, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "rack-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Rack entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + rack = rack_minimal() + # rack = rack_extended() + # rack = rack_explicit() + + response = client.ingest(entities=[Entity(rack=rack)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Rack ingested successfully") + + +def rack_minimal() -> Rack: + """Create a Rack with only required fields using flat strings.""" + return Rack( + name="Example Name", + site="Example Site", # flat string -> Site + metadata={"source": "example"}, + ) + + +def rack_extended() -> Rack: + """Create a Rack with common optional fields.""" + return Rack( + name="Example Name", + site="Example Site", + metadata={"source": "example"}, + status="active", + serial="SN-001234", + description="Example description", + ) + + +def rack_explicit() -> Rack: + """Create a Rack with fully nested objects and all common fields.""" + return Rack( + name="Example Name", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + metadata={"source": "example"}, + status="active", + serial="SN-001234", + asset_tag="ASSET-001", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/rack_reservation.py b/docs/examples/rack_reservation.py new file mode 100644 index 0000000..ff3b73f --- /dev/null +++ b/docs/examples/rack_reservation.py @@ -0,0 +1,93 @@ +""" +RackReservation entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting RackReservation entities: +- rack_reservation_minimal: Required fields only +- rack_reservation_extended: Common optional fields +- rack_reservation_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Rack, + RackReservation, + Site, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "rack_reservation-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a RackReservation entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + rack_reservation = rack_reservation_minimal() + # rack_reservation = rack_reservation_extended() + # rack_reservation = rack_reservation_explicit() + + response = client.ingest(entities=[Entity(rack_reservation=rack_reservation)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("RackReservation ingested successfully") + + +def rack_reservation_minimal() -> RackReservation: + """Create a RackReservation with only required fields using flat strings.""" + return RackReservation( + rack="Example Rack", # flat string -> Rack + description="Example description", + metadata={"source": "example"}, + ) + + +def rack_reservation_extended() -> RackReservation: + """Create a RackReservation with common optional fields.""" + return RackReservation( + rack="Example Rack", + description="Example description", + metadata={"source": "example"}, + status="active", + ) + + +def rack_reservation_explicit() -> RackReservation: + """Create a RackReservation with fully nested objects and all common fields.""" + return RackReservation( + rack=Rack( + name="Example Name", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + description="Example description", + metadata={"source": "example"}, + status="active", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/rack_role.py b/docs/examples/rack_role.py new file mode 100644 index 0000000..de333da --- /dev/null +++ b/docs/examples/rack_role.py @@ -0,0 +1,79 @@ +""" +RackRole entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting RackRole entities: +- rack_role_minimal: Required fields only +- rack_role_extended: Common optional fields +- rack_role_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + RackRole, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "rack_role-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a RackRole entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + rack_role = rack_role_minimal() + # rack_role = rack_role_extended() + # rack_role = rack_role_explicit() + + response = client.ingest(entities=[Entity(rack_role=rack_role)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("RackRole ingested successfully") + + +def rack_role_minimal() -> RackRole: + """Create a RackRole with only required fields using flat strings.""" + return RackRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def rack_role_extended() -> RackRole: + """Create a RackRole with common optional fields.""" + return RackRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + ) + + +def rack_role_explicit() -> RackRole: + """Create a RackRole with fully nested objects and all common fields.""" + return RackRole( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/rack_type.py b/docs/examples/rack_type.py new file mode 100644 index 0000000..a45fc87 --- /dev/null +++ b/docs/examples/rack_type.py @@ -0,0 +1,83 @@ +""" +RackType entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting RackType entities: +- rack_type_minimal: Required fields only +- rack_type_extended: Common optional fields +- rack_type_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Manufacturer, + RackType, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "rack_type-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a RackType entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + rack_type = rack_type_minimal() + # rack_type = rack_type_extended() + # rack_type = rack_type_explicit() + + response = client.ingest(entities=[Entity(rack_type=rack_type)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("RackType ingested successfully") + + +def rack_type_minimal() -> RackType: + """Create a RackType with only required fields using flat strings.""" + return RackType( + manufacturer="Example Manufacturer", # flat string -> Manufacturer + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def rack_type_extended() -> RackType: + """Create a RackType with common optional fields.""" + return RackType( + manufacturer="Example Manufacturer", + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def rack_type_explicit() -> RackType: + """Create a RackType with fully nested objects and all common fields.""" + return RackType( + manufacturer=Manufacturer( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/rear_port.py b/docs/examples/rear_port.py new file mode 100644 index 0000000..3060611 --- /dev/null +++ b/docs/examples/rear_port.py @@ -0,0 +1,111 @@ +""" +RearPort entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting RearPort entities: +- rear_port_minimal: Required fields only +- rear_port_extended: Common optional fields +- rear_port_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + Manufacturer, + RearPort, + Site, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "rear_port-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a RearPort entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + rear_port = rear_port_minimal() + # rear_port = rear_port_extended() + # rear_port = rear_port_explicit() + + response = client.ingest(entities=[Entity(rear_port=rear_port)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("RearPort ingested successfully") + + +def rear_port_minimal() -> RearPort: + """Create a RearPort with only required fields using flat strings.""" + return RearPort( + device="Example Device", # flat string -> Device + name="Example Name", + type="110-punch", + metadata={"source": "example"}, + ) + + +def rear_port_extended() -> RearPort: + """Create a RearPort with common optional fields.""" + return RearPort( + device="Example Device", + name="Example Name", + type="110-punch", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + ) + + +def rear_port_explicit() -> RearPort: + """Create a RearPort with fully nested objects and all common fields.""" + return RearPort( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + type="110-punch", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/region.py b/docs/examples/region.py new file mode 100644 index 0000000..d38de88 --- /dev/null +++ b/docs/examples/region.py @@ -0,0 +1,77 @@ +""" +Region entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Region entities: +- region_minimal: Required fields only +- region_extended: Common optional fields +- region_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Region, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "region-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Region entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + region = region_minimal() + # region = region_extended() + # region = region_explicit() + + response = client.ingest(entities=[Entity(region=region)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Region ingested successfully") + + +def region_minimal() -> Region: + """Create a Region with only required fields using flat strings.""" + return Region( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def region_extended() -> Region: + """Create a Region with common optional fields.""" + return Region( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def region_explicit() -> Region: + """Create a Region with fully nested objects and all common fields.""" + return Region( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/rir.py b/docs/examples/rir.py new file mode 100644 index 0000000..0a8e44f --- /dev/null +++ b/docs/examples/rir.py @@ -0,0 +1,77 @@ +""" +RIR entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting RIR entities: +- rir_minimal: Required fields only +- rir_extended: Common optional fields +- rir_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + RIR, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "rir-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a RIR entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + rir = rir_minimal() + # rir = rir_extended() + # rir = rir_explicit() + + response = client.ingest(entities=[Entity(rir=rir)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("RIR ingested successfully") + + +def rir_minimal() -> RIR: + """Create a RIR with only required fields using flat strings.""" + return RIR( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def rir_extended() -> RIR: + """Create a RIR with common optional fields.""" + return RIR( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def rir_explicit() -> RIR: + """Create a RIR with fully nested objects and all common fields.""" + return RIR( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/role.py b/docs/examples/role.py new file mode 100644 index 0000000..2a5ee6e --- /dev/null +++ b/docs/examples/role.py @@ -0,0 +1,77 @@ +""" +Role entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Role entities: +- role_minimal: Required fields only +- role_extended: Common optional fields +- role_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Role, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "role-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Role entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + role = role_minimal() + # role = role_extended() + # role = role_explicit() + + response = client.ingest(entities=[Entity(role=role)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Role ingested successfully") + + +def role_minimal() -> Role: + """Create a Role with only required fields using flat strings.""" + return Role( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def role_extended() -> Role: + """Create a Role with common optional fields.""" + return Role( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def role_explicit() -> Role: + """Create a Role with fully nested objects and all common fields.""" + return Role( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/route_target.py b/docs/examples/route_target.py new file mode 100644 index 0000000..3a75ffb --- /dev/null +++ b/docs/examples/route_target.py @@ -0,0 +1,78 @@ +""" +RouteTarget entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting RouteTarget entities: +- route_target_minimal: Required fields only +- route_target_extended: Common optional fields +- route_target_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + RouteTarget, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "route_target-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a RouteTarget entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + route_target = route_target_minimal() + # route_target = route_target_extended() + # route_target = route_target_explicit() + + response = client.ingest(entities=[Entity(route_target=route_target)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("RouteTarget ingested successfully") + + +def route_target_minimal() -> RouteTarget: + """Create a RouteTarget with only required fields using flat strings.""" + return RouteTarget( + name="Example Name", + metadata={"source": "example"}, + ) + + +def route_target_extended() -> RouteTarget: + """Create a RouteTarget with common optional fields.""" + return RouteTarget( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def route_target_explicit() -> RouteTarget: + """Create a RouteTarget with fully nested objects and all common fields.""" + return RouteTarget( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/service.py b/docs/examples/service.py new file mode 100644 index 0000000..e29bfe9 --- /dev/null +++ b/docs/examples/service.py @@ -0,0 +1,74 @@ +""" +Service entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Service entities: +- service_minimal: Required fields only +- service_extended: Common optional fields +- service_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Service, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "service-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Service entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + service = service_minimal() + # service = service_extended() + # service = service_explicit() + + response = client.ingest(entities=[Entity(service=service)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Service ingested successfully") + + +def service_minimal() -> Service: + """Create a Service with only required fields using flat strings.""" + return Service( + name="Example Name", + metadata={"source": "example"}, + ) + + +def service_extended() -> Service: + """Create a Service with common optional fields.""" + return Service( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def service_explicit() -> Service: + """Create a Service with fully nested objects and all common fields.""" + return Service( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/site.py b/docs/examples/site.py new file mode 100644 index 0000000..c4cd529 --- /dev/null +++ b/docs/examples/site.py @@ -0,0 +1,83 @@ +""" +Site entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Site entities: +- site_minimal: Required fields only +- site_extended: Common optional fields +- site_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Site, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "site-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Site entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + site = site_minimal() + # site = site_extended() + # site = site_explicit() + + response = client.ingest(entities=[Entity(site=site)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Site ingested successfully") + + +def site_minimal() -> Site: + """Create a Site with only required fields using flat strings.""" + return Site( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def site_extended() -> Site: + """Create a Site with common optional fields.""" + return Site( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + status="active", + description="Example description", + ) + + +def site_explicit() -> Site: + """Create a Site with fully nested objects and all common fields.""" + return Site( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/site_group.py b/docs/examples/site_group.py new file mode 100644 index 0000000..00eba4e --- /dev/null +++ b/docs/examples/site_group.py @@ -0,0 +1,77 @@ +""" +SiteGroup entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting SiteGroup entities: +- site_group_minimal: Required fields only +- site_group_extended: Common optional fields +- site_group_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + SiteGroup, + Tag, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "site_group-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a SiteGroup entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + site_group = site_group_minimal() + # site_group = site_group_extended() + # site_group = site_group_explicit() + + response = client.ingest(entities=[Entity(site_group=site_group)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("SiteGroup ingested successfully") + + +def site_group_minimal() -> SiteGroup: + """Create a SiteGroup with only required fields using flat strings.""" + return SiteGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def site_group_extended() -> SiteGroup: + """Create a SiteGroup with common optional fields.""" + return SiteGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def site_group_explicit() -> SiteGroup: + """Create a SiteGroup with fully nested objects and all common fields.""" + return SiteGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/tag.py b/docs/examples/tag.py new file mode 100644 index 0000000..573a575 --- /dev/null +++ b/docs/examples/tag.py @@ -0,0 +1,72 @@ +""" +Tag entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Tag entities: +- tag_minimal: Required fields only +- tag_extended: Common optional fields +- tag_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "tag-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Tag entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + tag = tag_minimal() + # tag = tag_extended() + # tag = tag_explicit() + + response = client.ingest(entities=[Entity(tag=tag)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Tag ingested successfully") + + +def tag_minimal() -> Tag: + """Create a Tag with only required fields using flat strings.""" + return Tag( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def tag_extended() -> Tag: + """Create a Tag with common optional fields.""" + return Tag( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + ) + + +def tag_explicit() -> Tag: + """Create a Tag with fully nested objects and all common fields.""" + return Tag( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/tenant.py b/docs/examples/tenant.py new file mode 100644 index 0000000..5164cd3 --- /dev/null +++ b/docs/examples/tenant.py @@ -0,0 +1,77 @@ +""" +Tenant entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Tenant entities: +- tenant_minimal: Required fields only +- tenant_extended: Common optional fields +- tenant_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + Tenant, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "tenant-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Tenant entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + tenant = tenant_minimal() + # tenant = tenant_extended() + # tenant = tenant_explicit() + + response = client.ingest(entities=[Entity(tenant=tenant)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Tenant ingested successfully") + + +def tenant_minimal() -> Tenant: + """Create a Tenant with only required fields using flat strings.""" + return Tenant( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def tenant_extended() -> Tenant: + """Create a Tenant with common optional fields.""" + return Tenant( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def tenant_explicit() -> Tenant: + """Create a Tenant with fully nested objects and all common fields.""" + return Tenant( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/tenant_group.py b/docs/examples/tenant_group.py new file mode 100644 index 0000000..d00eb1f --- /dev/null +++ b/docs/examples/tenant_group.py @@ -0,0 +1,77 @@ +""" +TenantGroup entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting TenantGroup entities: +- tenant_group_minimal: Required fields only +- tenant_group_extended: Common optional fields +- tenant_group_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + TenantGroup, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "tenant_group-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a TenantGroup entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + tenant_group = tenant_group_minimal() + # tenant_group = tenant_group_extended() + # tenant_group = tenant_group_explicit() + + response = client.ingest(entities=[Entity(tenant_group=tenant_group)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("TenantGroup ingested successfully") + + +def tenant_group_minimal() -> TenantGroup: + """Create a TenantGroup with only required fields using flat strings.""" + return TenantGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def tenant_group_extended() -> TenantGroup: + """Create a TenantGroup with common optional fields.""" + return TenantGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def tenant_group_explicit() -> TenantGroup: + """Create a TenantGroup with fully nested objects and all common fields.""" + return TenantGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/tunnel.py b/docs/examples/tunnel.py new file mode 100644 index 0000000..31cb4c2 --- /dev/null +++ b/docs/examples/tunnel.py @@ -0,0 +1,84 @@ +""" +Tunnel entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting Tunnel entities: +- tunnel_minimal: Required fields only +- tunnel_extended: Common optional fields +- tunnel_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + Tenant, + Tunnel, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "tunnel-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a Tunnel entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + tunnel = tunnel_minimal() + # tunnel = tunnel_extended() + # tunnel = tunnel_explicit() + + response = client.ingest(entities=[Entity(tunnel=tunnel)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("Tunnel ingested successfully") + + +def tunnel_minimal() -> Tunnel: + """Create a Tunnel with only required fields using flat strings.""" + return Tunnel( + name="Example Name", + status="active", + encapsulation="gre", + metadata={"source": "example"}, + ) + + +def tunnel_extended() -> Tunnel: + """Create a Tunnel with common optional fields.""" + return Tunnel( + name="Example Name", + status="active", + encapsulation="gre", + metadata={"source": "example"}, + description="Example description", + ) + + +def tunnel_explicit() -> Tunnel: + """Create a Tunnel with fully nested objects and all common fields.""" + return Tunnel( + name="Example Name", + status="active", + encapsulation="gre", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/tunnel_group.py b/docs/examples/tunnel_group.py new file mode 100644 index 0000000..a1018c6 --- /dev/null +++ b/docs/examples/tunnel_group.py @@ -0,0 +1,77 @@ +""" +TunnelGroup entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting TunnelGroup entities: +- tunnel_group_minimal: Required fields only +- tunnel_group_extended: Common optional fields +- tunnel_group_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + TunnelGroup, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "tunnel_group-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a TunnelGroup entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + tunnel_group = tunnel_group_minimal() + # tunnel_group = tunnel_group_extended() + # tunnel_group = tunnel_group_explicit() + + response = client.ingest(entities=[Entity(tunnel_group=tunnel_group)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("TunnelGroup ingested successfully") + + +def tunnel_group_minimal() -> TunnelGroup: + """Create a TunnelGroup with only required fields using flat strings.""" + return TunnelGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def tunnel_group_extended() -> TunnelGroup: + """Create a TunnelGroup with common optional fields.""" + return TunnelGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def tunnel_group_explicit() -> TunnelGroup: + """Create a TunnelGroup with fully nested objects and all common fields.""" + return TunnelGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/tunnel_termination.py b/docs/examples/tunnel_termination.py new file mode 100644 index 0000000..07c64e3 --- /dev/null +++ b/docs/examples/tunnel_termination.py @@ -0,0 +1,82 @@ +""" +TunnelTermination entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting TunnelTermination entities: +- tunnel_termination_minimal: Required fields only +- tunnel_termination_extended: Common optional fields +- tunnel_termination_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + Tunnel, + TunnelTermination, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "tunnel_termination-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a TunnelTermination entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + tunnel_termination = tunnel_termination_minimal() + # tunnel_termination = tunnel_termination_extended() + # tunnel_termination = tunnel_termination_explicit() + + response = client.ingest( + entities=[Entity(tunnel_termination=tunnel_termination)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("TunnelTermination ingested successfully") + + +def tunnel_termination_minimal() -> TunnelTermination: + """Create a TunnelTermination with only required fields using flat strings.""" + return TunnelTermination( + tunnel="Example Tunnel", # flat string -> Tunnel + role="hub", + metadata={"source": "example"}, + ) + + +def tunnel_termination_extended() -> TunnelTermination: + """Create a TunnelTermination with common optional fields.""" + return TunnelTermination( + tunnel="Example Tunnel", + role="hub", + metadata={"source": "example"}, + ) + + +def tunnel_termination_explicit() -> TunnelTermination: + """Create a TunnelTermination with fully nested objects and all common fields.""" + return TunnelTermination( + tunnel=Tunnel( + name="Example Name", + status="active", + encapsulation="Example Encapsulation", + metadata={"source": "example"}, + ), + role="hub", + metadata={"source": "example"}, + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/virtual_chassis.py b/docs/examples/virtual_chassis.py new file mode 100644 index 0000000..e3c09de --- /dev/null +++ b/docs/examples/virtual_chassis.py @@ -0,0 +1,74 @@ +""" +VirtualChassis entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VirtualChassis entities: +- virtual_chassis_minimal: Required fields only +- virtual_chassis_extended: Common optional fields +- virtual_chassis_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + VirtualChassis, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "virtual_chassis-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VirtualChassis entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + virtual_chassis = virtual_chassis_minimal() + # virtual_chassis = virtual_chassis_extended() + # virtual_chassis = virtual_chassis_explicit() + + response = client.ingest(entities=[Entity(virtual_chassis=virtual_chassis)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VirtualChassis ingested successfully") + + +def virtual_chassis_minimal() -> VirtualChassis: + """Create a VirtualChassis with only required fields using flat strings.""" + return VirtualChassis( + name="Example Name", + metadata={"source": "example"}, + ) + + +def virtual_chassis_extended() -> VirtualChassis: + """Create a VirtualChassis with common optional fields.""" + return VirtualChassis( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def virtual_chassis_explicit() -> VirtualChassis: + """Create a VirtualChassis with fully nested objects and all common fields.""" + return VirtualChassis( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/virtual_circuit.py b/docs/examples/virtual_circuit.py new file mode 100644 index 0000000..b7fa678 --- /dev/null +++ b/docs/examples/virtual_circuit.py @@ -0,0 +1,100 @@ +""" +VirtualCircuit entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VirtualCircuit entities: +- virtual_circuit_minimal: Required fields only +- virtual_circuit_extended: Common optional fields +- virtual_circuit_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Provider, + ProviderNetwork, + Tag, + Tenant, + VirtualCircuit, + VirtualCircuitType, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "virtual_circuit-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VirtualCircuit entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + virtual_circuit = virtual_circuit_minimal() + # virtual_circuit = virtual_circuit_extended() + # virtual_circuit = virtual_circuit_explicit() + + response = client.ingest(entities=[Entity(virtual_circuit=virtual_circuit)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VirtualCircuit ingested successfully") + + +def virtual_circuit_minimal() -> VirtualCircuit: + """Create a VirtualCircuit with only required fields using flat strings.""" + return VirtualCircuit( + cid="CID-001", + provider_network="Example Provider Network", # flat string -> ProviderNetwork + type="Example Type", # flat string -> VirtualCircuitType + metadata={"source": "example"}, + ) + + +def virtual_circuit_extended() -> VirtualCircuit: + """Create a VirtualCircuit with common optional fields.""" + return VirtualCircuit( + cid="CID-001", + provider_network="Example Provider Network", + type="Example Type", + metadata={"source": "example"}, + status="active", + description="Example description", + ) + + +def virtual_circuit_explicit() -> VirtualCircuit: + """Create a VirtualCircuit with fully nested objects and all common fields.""" + return VirtualCircuit( + cid="CID-001", + provider_network=ProviderNetwork( + provider=Provider( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + name="Example Name", + metadata={"source": "example"}, + ), + type=VirtualCircuitType( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + metadata={"source": "example"}, + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/virtual_circuit_termination.py b/docs/examples/virtual_circuit_termination.py new file mode 100644 index 0000000..e4ac270 --- /dev/null +++ b/docs/examples/virtual_circuit_termination.py @@ -0,0 +1,137 @@ +""" +VirtualCircuitTermination entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VirtualCircuitTermination entities: +- virtual_circuit_termination_minimal: Required fields only +- virtual_circuit_termination_extended: Common optional fields +- virtual_circuit_termination_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + Interface, + Manufacturer, + Provider, + ProviderNetwork, + Site, + Tag, + VirtualCircuit, + VirtualCircuitTermination, + VirtualCircuitType, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "virtual_circuit_termination-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VirtualCircuitTermination entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + virtual_circuit_termination = virtual_circuit_termination_minimal() + # virtual_circuit_termination = virtual_circuit_termination_extended() + # virtual_circuit_termination = virtual_circuit_termination_explicit() + + response = client.ingest( + entities=[Entity(virtual_circuit_termination=virtual_circuit_termination)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VirtualCircuitTermination ingested successfully") + + +def virtual_circuit_termination_minimal() -> VirtualCircuitTermination: + """Create a VirtualCircuitTermination with only required fields using flat strings.""" + return VirtualCircuitTermination( + virtual_circuit="Example Virtual Circuit", # flat string -> VirtualCircuit + interface="Example Interface", # flat string -> Interface + metadata={"source": "example"}, + ) + + +def virtual_circuit_termination_extended() -> VirtualCircuitTermination: + """Create a VirtualCircuitTermination with common optional fields.""" + return VirtualCircuitTermination( + virtual_circuit="Example Virtual Circuit", + interface="Example Interface", + metadata={"source": "example"}, + description="Example description", + ) + + +def virtual_circuit_termination_explicit() -> VirtualCircuitTermination: + """Create a VirtualCircuitTermination with fully nested objects and all common fields.""" + return VirtualCircuitTermination( + virtual_circuit=VirtualCircuit( + cid="CID-001", + provider_network=ProviderNetwork( + provider=Provider( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + type=VirtualCircuitType( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + interface=Interface( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + type="Example Type", + metadata={"source": "example"}, + ), + metadata={"source": "example"}, + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/virtual_circuit_type.py b/docs/examples/virtual_circuit_type.py new file mode 100644 index 0000000..e5495b2 --- /dev/null +++ b/docs/examples/virtual_circuit_type.py @@ -0,0 +1,81 @@ +""" +VirtualCircuitType entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VirtualCircuitType entities: +- virtual_circuit_type_minimal: Required fields only +- virtual_circuit_type_extended: Common optional fields +- virtual_circuit_type_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + VirtualCircuitType, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "virtual_circuit_type-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VirtualCircuitType entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + virtual_circuit_type = virtual_circuit_type_minimal() + # virtual_circuit_type = virtual_circuit_type_extended() + # virtual_circuit_type = virtual_circuit_type_explicit() + + response = client.ingest( + entities=[Entity(virtual_circuit_type=virtual_circuit_type)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VirtualCircuitType ingested successfully") + + +def virtual_circuit_type_minimal() -> VirtualCircuitType: + """Create a VirtualCircuitType with only required fields using flat strings.""" + return VirtualCircuitType( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def virtual_circuit_type_extended() -> VirtualCircuitType: + """Create a VirtualCircuitType with common optional fields.""" + return VirtualCircuitType( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + ) + + +def virtual_circuit_type_explicit() -> VirtualCircuitType: + """Create a VirtualCircuitType with fully nested objects and all common fields.""" + return VirtualCircuitType( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + color="0000ff", + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/virtual_device_context.py b/docs/examples/virtual_device_context.py new file mode 100644 index 0000000..3b82671 --- /dev/null +++ b/docs/examples/virtual_device_context.py @@ -0,0 +1,116 @@ +""" +VirtualDeviceContext entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VirtualDeviceContext entities: +- virtual_device_context_minimal: Required fields only +- virtual_device_context_extended: Common optional fields +- virtual_device_context_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + Manufacturer, + Site, + Tag, + Tenant, + VirtualDeviceContext, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "virtual_device_context-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VirtualDeviceContext entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + virtual_device_context = virtual_device_context_minimal() + # virtual_device_context = virtual_device_context_extended() + # virtual_device_context = virtual_device_context_explicit() + + response = client.ingest( + entities=[Entity(virtual_device_context=virtual_device_context)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VirtualDeviceContext ingested successfully") + + +def virtual_device_context_minimal() -> VirtualDeviceContext: + """Create a VirtualDeviceContext with only required fields using flat strings.""" + return VirtualDeviceContext( + name="Example Name", + device="Example Device", # flat string -> Device + status="active", + metadata={"source": "example"}, + ) + + +def virtual_device_context_extended() -> VirtualDeviceContext: + """Create a VirtualDeviceContext with common optional fields.""" + return VirtualDeviceContext( + name="Example Name", + device="Example Device", + status="active", + metadata={"source": "example"}, + description="Example description", + ) + + +def virtual_device_context_explicit() -> VirtualDeviceContext: + """Create a VirtualDeviceContext with fully nested objects and all common fields.""" + return VirtualDeviceContext( + name="Example Name", + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/virtual_disk.py b/docs/examples/virtual_disk.py new file mode 100644 index 0000000..525bc61 --- /dev/null +++ b/docs/examples/virtual_disk.py @@ -0,0 +1,82 @@ +""" +VirtualDisk entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VirtualDisk entities: +- virtual_disk_minimal: Required fields only +- virtual_disk_extended: Common optional fields +- virtual_disk_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + VirtualDisk, + VirtualMachine, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "virtual_disk-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VirtualDisk entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + virtual_disk = virtual_disk_minimal() + # virtual_disk = virtual_disk_extended() + # virtual_disk = virtual_disk_explicit() + + response = client.ingest(entities=[Entity(virtual_disk=virtual_disk)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VirtualDisk ingested successfully") + + +def virtual_disk_minimal() -> VirtualDisk: + """Create a VirtualDisk with only required fields using flat strings.""" + return VirtualDisk( + virtual_machine="Example Virtual Machine", # flat string -> VirtualMachine + name="Example Name", + size=1, + metadata={"source": "example"}, + ) + + +def virtual_disk_extended() -> VirtualDisk: + """Create a VirtualDisk with common optional fields.""" + return VirtualDisk( + virtual_machine="Example Virtual Machine", + name="Example Name", + size=1, + metadata={"source": "example"}, + description="Example description", + ) + + +def virtual_disk_explicit() -> VirtualDisk: + """Create a VirtualDisk with fully nested objects and all common fields.""" + return VirtualDisk( + virtual_machine=VirtualMachine( + name="Example Name", status="active", metadata={"source": "example"} + ), + name="Example Name", + size=1, + metadata={"source": "example"}, + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/virtual_machine.py b/docs/examples/virtual_machine.py new file mode 100644 index 0000000..e542549 --- /dev/null +++ b/docs/examples/virtual_machine.py @@ -0,0 +1,86 @@ +""" +VirtualMachine entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VirtualMachine entities: +- virtual_machine_minimal: Required fields only +- virtual_machine_extended: Common optional fields +- virtual_machine_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Platform, + Tag, + Tenant, + VirtualMachine, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "virtual_machine-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VirtualMachine entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + virtual_machine = virtual_machine_minimal() + # virtual_machine = virtual_machine_extended() + # virtual_machine = virtual_machine_explicit() + + response = client.ingest(entities=[Entity(virtual_machine=virtual_machine)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VirtualMachine ingested successfully") + + +def virtual_machine_minimal() -> VirtualMachine: + """Create a VirtualMachine with only required fields using flat strings.""" + return VirtualMachine( + name="Example Name", + metadata={"source": "example"}, + ) + + +def virtual_machine_extended() -> VirtualMachine: + """Create a VirtualMachine with common optional fields.""" + return VirtualMachine( + name="Example Name", + metadata={"source": "example"}, + status="active", + serial="SN-001234", + description="Example description", + ) + + +def virtual_machine_explicit() -> VirtualMachine: + """Create a VirtualMachine with fully nested objects and all common fields.""" + return VirtualMachine( + name="Example Name", + metadata={"source": "example"}, + status="active", + serial="SN-001234", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + platform=Platform( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/vlan.py b/docs/examples/vlan.py new file mode 100644 index 0000000..dca0942 --- /dev/null +++ b/docs/examples/vlan.py @@ -0,0 +1,83 @@ +""" +VLAN entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VLAN entities: +- vlan_minimal: Required fields only +- vlan_extended: Common optional fields +- vlan_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + Tenant, + VLAN, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "vlan-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VLAN entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + vlan = vlan_minimal() + # vlan = vlan_extended() + # vlan = vlan_explicit() + + response = client.ingest(entities=[Entity(vlan=vlan)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VLAN ingested successfully") + + +def vlan_minimal() -> VLAN: + """Create a VLAN with only required fields using flat strings.""" + return VLAN( + vid=1, + name="Example Name", + metadata={"source": "example"}, + ) + + +def vlan_extended() -> VLAN: + """Create a VLAN with common optional fields.""" + return VLAN( + vid=1, + name="Example Name", + metadata={"source": "example"}, + status="active", + description="Example description", + ) + + +def vlan_explicit() -> VLAN: + """Create a VLAN with fully nested objects and all common fields.""" + return VLAN( + vid=1, + name="Example Name", + metadata={"source": "example"}, + status="active", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/vlan_group.py b/docs/examples/vlan_group.py new file mode 100644 index 0000000..29b681a --- /dev/null +++ b/docs/examples/vlan_group.py @@ -0,0 +1,81 @@ +""" +VLANGroup entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VLANGroup entities: +- vlan_group_minimal: Required fields only +- vlan_group_extended: Common optional fields +- vlan_group_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + Tenant, + VLANGroup, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "vlan_group-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VLANGroup entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + vlan_group = vlan_group_minimal() + # vlan_group = vlan_group_extended() + # vlan_group = vlan_group_explicit() + + response = client.ingest(entities=[Entity(vlan_group=vlan_group)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VLANGroup ingested successfully") + + +def vlan_group_minimal() -> VLANGroup: + """Create a VLANGroup with only required fields using flat strings.""" + return VLANGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def vlan_group_extended() -> VLANGroup: + """Create a VLANGroup with common optional fields.""" + return VLANGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def vlan_group_explicit() -> VLANGroup: + """Create a VLANGroup with fully nested objects and all common fields.""" + return VLANGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/vlan_translation_policy.py b/docs/examples/vlan_translation_policy.py new file mode 100644 index 0000000..805c88e --- /dev/null +++ b/docs/examples/vlan_translation_policy.py @@ -0,0 +1,70 @@ +""" +VLANTranslationPolicy entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VLANTranslationPolicy entities: +- vlan_translation_policy_minimal: Required fields only +- vlan_translation_policy_extended: Common optional fields +- vlan_translation_policy_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "vlan_translation_policy-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VLANTranslationPolicy entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + vlan_translation_policy = vlan_translation_policy_minimal() + # vlan_translation_policy = vlan_translation_policy_extended() + # vlan_translation_policy = vlan_translation_policy_explicit() + + response = client.ingest( + entities=[Entity(vlan_translation_policy=vlan_translation_policy)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VLANTranslationPolicy ingested successfully") + + +def vlan_translation_policy_minimal() -> VLANTranslationPolicy: + """Create a VLANTranslationPolicy with only required fields using flat strings.""" + return VLANTranslationPolicy( + name="Example Name", + metadata={"source": "example"}, + ) + + +def vlan_translation_policy_extended() -> VLANTranslationPolicy: + """Create a VLANTranslationPolicy with common optional fields.""" + return VLANTranslationPolicy( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def vlan_translation_policy_explicit() -> VLANTranslationPolicy: + """Create a VLANTranslationPolicy with fully nested objects and all common fields.""" + return VLANTranslationPolicy( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/vlan_translation_rule.py b/docs/examples/vlan_translation_rule.py new file mode 100644 index 0000000..c4a2a8e --- /dev/null +++ b/docs/examples/vlan_translation_rule.py @@ -0,0 +1,82 @@ +""" +VLANTranslationRule entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VLANTranslationRule entities: +- vlan_translation_rule_minimal: Required fields only +- vlan_translation_rule_extended: Common optional fields +- vlan_translation_rule_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + VLANTranslationPolicy, + VLANTranslationRule, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "vlan_translation_rule-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VLANTranslationRule entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + vlan_translation_rule = vlan_translation_rule_minimal() + # vlan_translation_rule = vlan_translation_rule_extended() + # vlan_translation_rule = vlan_translation_rule_explicit() + + response = client.ingest( + entities=[Entity(vlan_translation_rule=vlan_translation_rule)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VLANTranslationRule ingested successfully") + + +def vlan_translation_rule_minimal() -> VLANTranslationRule: + """Create a VLANTranslationRule with only required fields using flat strings.""" + return VLANTranslationRule( + policy="Example Policy", # flat string -> VLANTranslationPolicy + local_vid=1, + remote_vid=1, + metadata={"source": "example"}, + ) + + +def vlan_translation_rule_extended() -> VLANTranslationRule: + """Create a VLANTranslationRule with common optional fields.""" + return VLANTranslationRule( + policy="Example Policy", + local_vid=1, + remote_vid=1, + metadata={"source": "example"}, + description="Example description", + ) + + +def vlan_translation_rule_explicit() -> VLANTranslationRule: + """Create a VLANTranslationRule with fully nested objects and all common fields.""" + return VLANTranslationRule( + policy=VLANTranslationPolicy( + name="Example Name", metadata={"source": "example"} + ), + local_vid=1, + remote_vid=1, + metadata={"source": "example"}, + description="Example description", + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/vm_interface.py b/docs/examples/vm_interface.py new file mode 100644 index 0000000..ab4952a --- /dev/null +++ b/docs/examples/vm_interface.py @@ -0,0 +1,79 @@ +""" +VMInterface entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VMInterface entities: +- vm_interface_minimal: Required fields only +- vm_interface_extended: Common optional fields +- vm_interface_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + VMInterface, + VirtualMachine, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "vm_interface-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VMInterface entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + vm_interface = vm_interface_minimal() + # vm_interface = vm_interface_extended() + # vm_interface = vm_interface_explicit() + + response = client.ingest(entities=[Entity(vm_interface=vm_interface)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VMInterface ingested successfully") + + +def vm_interface_minimal() -> VMInterface: + """Create a VMInterface with only required fields using flat strings.""" + return VMInterface( + virtual_machine="Example Virtual Machine", # flat string -> VirtualMachine + name="Example Name", + metadata={"source": "example"}, + ) + + +def vm_interface_extended() -> VMInterface: + """Create a VMInterface with common optional fields.""" + return VMInterface( + virtual_machine="Example Virtual Machine", + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def vm_interface_explicit() -> VMInterface: + """Create a VMInterface with fully nested objects and all common fields.""" + return VMInterface( + virtual_machine=VirtualMachine( + name="Example Name", status="active", metadata={"source": "example"} + ), + name="Example Name", + metadata={"source": "example"}, + description="Example description", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/vrf.py b/docs/examples/vrf.py new file mode 100644 index 0000000..08ed95b --- /dev/null +++ b/docs/examples/vrf.py @@ -0,0 +1,78 @@ +""" +VRF entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting VRF entities: +- vrf_minimal: Required fields only +- vrf_extended: Common optional fields +- vrf_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + Tenant, + VRF, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "vrf-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a VRF entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + vrf = vrf_minimal() + # vrf = vrf_extended() + # vrf = vrf_explicit() + + response = client.ingest(entities=[Entity(vrf=vrf)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("VRF ingested successfully") + + +def vrf_minimal() -> VRF: + """Create a VRF with only required fields using flat strings.""" + return VRF( + name="Example Name", + metadata={"source": "example"}, + ) + + +def vrf_extended() -> VRF: + """Create a VRF with common optional fields.""" + return VRF( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + ) + + +def vrf_explicit() -> VRF: + """Create a VRF with fully nested objects and all common fields.""" + return VRF( + name="Example Name", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/wireless_lan.py b/docs/examples/wireless_lan.py new file mode 100644 index 0000000..be7bfba --- /dev/null +++ b/docs/examples/wireless_lan.py @@ -0,0 +1,80 @@ +""" +WirelessLAN entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting WirelessLAN entities: +- wireless_lan_minimal: Required fields only +- wireless_lan_extended: Common optional fields +- wireless_lan_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + Tenant, + WirelessLAN, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "wireless_lan-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a WirelessLAN entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + wireless_lan = wireless_lan_minimal() + # wireless_lan = wireless_lan_extended() + # wireless_lan = wireless_lan_explicit() + + response = client.ingest(entities=[Entity(wireless_lan=wireless_lan)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("WirelessLAN ingested successfully") + + +def wireless_lan_minimal() -> WirelessLAN: + """Create a WirelessLAN with only required fields using flat strings.""" + return WirelessLAN( + ssid="ExampleSSID", + metadata={"source": "example"}, + ) + + +def wireless_lan_extended() -> WirelessLAN: + """Create a WirelessLAN with common optional fields.""" + return WirelessLAN( + ssid="ExampleSSID", + metadata={"source": "example"}, + description="Example description", + status="active", + ) + + +def wireless_lan_explicit() -> WirelessLAN: + """Create a WirelessLAN with fully nested objects and all common fields.""" + return WirelessLAN( + ssid="ExampleSSID", + metadata={"source": "example"}, + description="Example description", + status="active", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/wireless_lan_group.py b/docs/examples/wireless_lan_group.py new file mode 100644 index 0000000..f92b290 --- /dev/null +++ b/docs/examples/wireless_lan_group.py @@ -0,0 +1,79 @@ +""" +WirelessLANGroup entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting WirelessLANGroup entities: +- wireless_lan_group_minimal: Required fields only +- wireless_lan_group_extended: Common optional fields +- wireless_lan_group_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, + WirelessLANGroup, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "wireless_lan_group-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a WirelessLANGroup entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + wireless_lan_group = wireless_lan_group_minimal() + # wireless_lan_group = wireless_lan_group_extended() + # wireless_lan_group = wireless_lan_group_explicit() + + response = client.ingest( + entities=[Entity(wireless_lan_group=wireless_lan_group)] + ) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("WirelessLANGroup ingested successfully") + + +def wireless_lan_group_minimal() -> WirelessLANGroup: + """Create a WirelessLANGroup with only required fields using flat strings.""" + return WirelessLANGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ) + + +def wireless_lan_group_extended() -> WirelessLANGroup: + """Create a WirelessLANGroup with common optional fields.""" + return WirelessLANGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + ) + + +def wireless_lan_group_explicit() -> WirelessLANGroup: + """Create a WirelessLANGroup with fully nested objects and all common fields.""" + return WirelessLANGroup( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + description="Example description", + comments="Example comments", + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/wireless_link.py b/docs/examples/wireless_link.py new file mode 100644 index 0000000..e9ff4d3 --- /dev/null +++ b/docs/examples/wireless_link.py @@ -0,0 +1,149 @@ +""" +WirelessLink entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting WirelessLink entities: +- wireless_link_minimal: Required fields only +- wireless_link_extended: Common optional fields +- wireless_link_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, + Entity, + Interface, + Manufacturer, + Site, + Tag, + Tenant, + WirelessLink, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "wireless_link-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a WirelessLink entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + wireless_link = wireless_link_minimal() + # wireless_link = wireless_link_extended() + # wireless_link = wireless_link_explicit() + + response = client.ingest(entities=[Entity(wireless_link=wireless_link)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("WirelessLink ingested successfully") + + +def wireless_link_minimal() -> WirelessLink: + """Create a WirelessLink with only required fields using flat strings.""" + return WirelessLink( + interface_a="Example Interface A", # flat string -> Interface + interface_b="Example Interface B", # flat string -> Interface + metadata={"source": "example"}, + ) + + +def wireless_link_extended() -> WirelessLink: + """Create a WirelessLink with common optional fields.""" + return WirelessLink( + interface_a="Example Interface A", + interface_b="Example Interface B", + metadata={"source": "example"}, + status="connected", + description="Example description", + ) + + +def wireless_link_explicit() -> WirelessLink: + """Create a WirelessLink with fully nested objects and all common fields.""" + return WirelessLink( + interface_a=Interface( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + type="Example Type", + metadata={"source": "example"}, + ), + interface_b=Interface( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + type="Example Type", + metadata={"source": "example"}, + ), + metadata={"source": "example"}, + status="connected", + description="Example description", + comments="Example comments", + tenant=Tenant( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + tags=[Tag(name="production")], + ) + + +if __name__ == "__main__": + main() From 446632a1ba20aa56ce489fc5779ea364b67cad15 Mon Sep 17 00:00:00 2001 From: Paul Stuart Date: Wed, 4 Feb 2026 08:47:15 -0800 Subject: [PATCH 2/8] fix PR feedback --- docs/README.md | 6 +- netboxlabs/diode/sdk/ingester.py | 6258 +++++++++++++++--------------- 2 files changed, 3081 insertions(+), 3183 deletions(-) diff --git a/docs/README.md b/docs/README.md index 5146bc7..0ababd3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,11 +1,11 @@ # Diode Python SDK - Entity Examples -// Source: NetBox v4.5.0 -Generated: 2026-02-02 21:20:55Z +Source: NetBox v4.5.0 +Generated: 2026-02-04 16:45:30Z ## Prerequisites -- Python 3.9 or later +- Python 3.10 or later - Diode SDK for Python ## Installation diff --git a/netboxlabs/diode/sdk/ingester.py b/netboxlabs/diode/sdk/ingester.py index b6376c2..8a474eb 100644 --- a/netboxlabs/diode/sdk/ingester.py +++ b/netboxlabs/diode/sdk/ingester.py @@ -2,7 +2,8 @@ # # Generated code. DO NOT EDIT. -# Timestamp: 2026-01-12 10:39:06Z +# Source: NetBox v4.5.0 +# Timestamp: 2026-02-04 16:45:26Z # # ruff: noqa: C901 @@ -31,6 +32,9 @@ "Contact": "name", "ContactGroup": "name", "ContactRole": "name", + "CustomField": "name", + "CustomFieldChoiceSet": "name", + "CustomLink": "name", "Device": "name", "DeviceBay": "name", "DeviceRole": "name", @@ -52,6 +56,9 @@ "Manufacturer": "name", "ModuleBay": "name", "ModuleType": "model", + "ModuleTypeProfile": "name", + "Owner": "name", + "OwnerGroup": "name", "Platform": "name", "PowerFeed": "name", "PowerOutlet": "name", @@ -90,12 +97,6 @@ "VirtualMachine": "name", "WirelessLAN": "ssid", "WirelessLANGroup": "name", - "CustomField": "name", - "CustomFieldChoiceSet": "name", - "ModuleTypeProfile": "name", - "CustomLink": "name", - "Owner": "name", - "OwnerGroup": "name", } @@ -165,7 +166,6 @@ def __new__( aggregate: str | Aggregate | pb.Aggregate | None = None, cable: str | Cable | pb.Cable | None = None, cable_path: str | CablePath | pb.CablePath | None = None, - cable_termination: str | CableTermination | pb.CableTermination | None = None, circuit: str | Circuit | pb.Circuit | None = None, circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, circuit_group_assignment: ( @@ -188,6 +188,11 @@ def __new__( ) = None, contact_group: str | ContactGroup | pb.ContactGroup | None = None, contact_role: str | ContactRole | pb.ContactRole | None = None, + custom_field: str | CustomField | pb.CustomField | None = None, + custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + custom_link: str | CustomLink | pb.CustomLink | None = None, device: str | Device | pb.Device | None = None, device_bay: str | DeviceBay | pb.DeviceBay | None = None, device_role: str | DeviceRole | pb.DeviceRole | None = None, @@ -209,6 +214,7 @@ def __new__( inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, + journal_entry: str | JournalEntry | pb.JournalEntry | None = None, l2vpn: str | L2VPN | pb.L2VPN | None = None, l2vpn_termination: str | L2VPNTermination | pb.L2VPNTermination | None = None, location: str | Location | pb.Location | None = None, @@ -217,6 +223,11 @@ def __new__( module: str | Module | pb.Module | None = None, module_bay: str | ModuleBay | pb.ModuleBay | None = None, module_type: str | ModuleType | pb.ModuleType | None = None, + module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + owner: str | Owner | pb.Owner | None = None, + owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, platform: str | Platform | pb.Platform | None = None, power_feed: str | PowerFeed | pb.PowerFeed | None = None, power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -272,17 +283,6 @@ def __new__( wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, wireless_lan_group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, wireless_link: str | WirelessLink | pb.WirelessLink | None = None, - custom_field: str | CustomField | pb.CustomField | None = None, - custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - journal_entry: str | JournalEntry | pb.JournalEntry | None = None, - module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - custom_link: str | CustomLink | pb.CustomLink | None = None, - owner: str | Owner | pb.Owner | None = None, - owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, ) -> pb.Entity: """Create a new Entity.""" asn = convert_to_protobuf(asn, pb.ASN) @@ -290,7 +290,6 @@ def __new__( aggregate = convert_to_protobuf(aggregate, pb.Aggregate) cable = convert_to_protobuf(cable, pb.Cable) cable_path = convert_to_protobuf(cable_path, pb.CablePath) - cable_termination = convert_to_protobuf(cable_termination, pb.CableTermination) circuit = convert_to_protobuf(circuit, pb.Circuit) circuit_group = convert_to_protobuf(circuit_group, pb.CircuitGroup) circuit_group_assignment = convert_to_protobuf( @@ -313,6 +312,11 @@ def __new__( ) contact_group = convert_to_protobuf(contact_group, pb.ContactGroup) contact_role = convert_to_protobuf(contact_role, pb.ContactRole) + custom_field = convert_to_protobuf(custom_field, pb.CustomField) + custom_field_choice_set = convert_to_protobuf( + custom_field_choice_set, pb.CustomFieldChoiceSet + ) + custom_link = convert_to_protobuf(custom_link, pb.CustomLink) device = convert_to_protobuf(device, pb.Device) device_bay = convert_to_protobuf(device_bay, pb.DeviceBay) device_role = convert_to_protobuf(device_role, pb.DeviceRole) @@ -334,6 +338,7 @@ def __new__( inventory_item_role = convert_to_protobuf( inventory_item_role, pb.InventoryItemRole ) + journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) l2vpn_termination = convert_to_protobuf(l2vpn_termination, pb.L2VPNTermination) location = convert_to_protobuf(location, pb.Location) @@ -342,6 +347,11 @@ def __new__( module = convert_to_protobuf(module, pb.Module) module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) module_type = convert_to_protobuf(module_type, pb.ModuleType) + module_type_profile = convert_to_protobuf( + module_type_profile, pb.ModuleTypeProfile + ) + owner = convert_to_protobuf(owner, pb.Owner) + owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) platform = convert_to_protobuf(platform, pb.Platform) power_feed = convert_to_protobuf(power_feed, pb.PowerFeed) power_outlet = convert_to_protobuf(power_outlet, pb.PowerOutlet) @@ -399,17 +409,6 @@ def __new__( wireless_lan_group, pb.WirelessLANGroup ) wireless_link = convert_to_protobuf(wireless_link, pb.WirelessLink) - custom_field = convert_to_protobuf(custom_field, pb.CustomField) - custom_field_choice_set = convert_to_protobuf( - custom_field_choice_set, pb.CustomFieldChoiceSet - ) - journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) - module_type_profile = convert_to_protobuf( - module_type_profile, pb.ModuleTypeProfile - ) - custom_link = convert_to_protobuf(custom_link, pb.CustomLink) - owner = convert_to_protobuf(owner, pb.Owner) - owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) if timestamp is None: ts = _timestamp_pb2.Timestamp() ts.GetCurrentTime() @@ -421,7 +420,6 @@ def __new__( aggregate=aggregate, cable=cable, cable_path=cable_path, - cable_termination=cable_termination, circuit=circuit, circuit_group=circuit_group, circuit_group_assignment=circuit_group_assignment, @@ -436,6 +434,9 @@ def __new__( contact_assignment=contact_assignment, contact_group=contact_group, contact_role=contact_role, + custom_field=custom_field, + custom_field_choice_set=custom_field_choice_set, + custom_link=custom_link, device=device, device_bay=device_bay, device_role=device_role, @@ -453,6 +454,7 @@ def __new__( interface=interface, inventory_item=inventory_item, inventory_item_role=inventory_item_role, + journal_entry=journal_entry, l2vpn=l2vpn, l2vpn_termination=l2vpn_termination, location=location, @@ -461,6 +463,9 @@ def __new__( module=module, module_bay=module_bay, module_type=module_type, + module_type_profile=module_type_profile, + owner=owner, + owner_group=owner_group, platform=platform, power_feed=power_feed, power_outlet=power_outlet, @@ -504,13 +509,6 @@ def __new__( wireless_lan=wireless_lan, wireless_lan_group=wireless_lan_group, wireless_link=wireless_link, - custom_field=custom_field, - custom_field_choice_set=custom_field_choice_set, - journal_entry=journal_entry, - module_type_profile=module_type_profile, - custom_link=custom_link, - owner=owner, - owner_group=owner_group, ) return result @@ -524,34 +522,34 @@ def __new__( rir: str | RIR | pb.RIR | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, + sites: list[str | Site | pb.Site] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - sites: list[str | Site | pb.Site] | None = None, ) -> pb.ASN: """Create a new ASN.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) + sites = convert_to_protobuf_list(sites, pb.Site) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - sites = convert_to_protobuf_list(sites, pb.Site) result = pb.ASN( asn=asn, rir=rir, tenant=tenant, description=description, + owner=owner, comments=comments, tags=tags, + sites=sites, custom_fields=custom_fields, metadata=metadata, - owner=owner, - sites=sites, ) return result @@ -568,21 +566,21 @@ def __new__( end: int | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, ) -> pb.ASNRange: """Create a new ASNRange.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ASNRange( name=name, slug=slug, @@ -591,11 +589,11 @@ def __new__( end=end, tenant=tenant, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - comments=comments, ) return result @@ -610,32 +608,32 @@ def __new__( tenant: str | Tenant | pb.Tenant | None = None, date_added: datetime.datetime | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.Aggregate: """Create a new Aggregate.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.Aggregate( prefix=prefix, rir=rir, tenant=tenant, date_added=date_added, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -649,46 +647,46 @@ def __new__( a_terminations: list[str | GenericObject | pb.GenericObject] | None = None, b_terminations: list[str | GenericObject | pb.GenericObject] | None = None, status: str | None = None, + profile: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, label: str | None = None, color: str | None = None, length: float | None = None, length_unit: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - profile: str | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.Cable: """Create a new Cable.""" a_terminations = convert_to_protobuf_list(a_terminations, pb.GenericObject) b_terminations = convert_to_protobuf_list(b_terminations, pb.GenericObject) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.Cable( type=type, a_terminations=a_terminations, b_terminations=b_terminations, status=status, + profile=profile, tenant=tenant, label=label, color=color, length=length, length_unit=length_unit, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - profile=profile, - owner=owner, ) return result @@ -714,71 +712,6 @@ def __new__( return result -class CableTermination: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CableTermination.""" - - def __new__( - cls, - cable: str | Cable | pb.Cable | None = None, - cable_end: str | None = None, - termination_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None - ) = None, - termination_console_port: str | ConsolePort | pb.ConsolePort | None = None, - termination_console_server_port: ( - str | ConsoleServerPort | pb.ConsoleServerPort | None - ) = None, - termination_front_port: str | FrontPort | pb.FrontPort | None = None, - termination_interface: str | Interface | pb.Interface | None = None, - termination_power_feed: str | PowerFeed | pb.PowerFeed | None = None, - termination_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, - termination_power_port: str | PowerPort | pb.PowerPort | None = None, - termination_rear_port: str | RearPort | pb.RearPort | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.CableTermination: - """Create a new CableTermination.""" - cable = convert_to_protobuf(cable, pb.Cable) - termination_circuit_termination = convert_to_protobuf( - termination_circuit_termination, pb.CircuitTermination - ) - termination_console_port = convert_to_protobuf( - termination_console_port, pb.ConsolePort - ) - termination_console_server_port = convert_to_protobuf( - termination_console_server_port, pb.ConsoleServerPort - ) - termination_front_port = convert_to_protobuf( - termination_front_port, pb.FrontPort - ) - termination_interface = convert_to_protobuf(termination_interface, pb.Interface) - termination_power_feed = convert_to_protobuf( - termination_power_feed, pb.PowerFeed - ) - termination_power_outlet = convert_to_protobuf( - termination_power_outlet, pb.PowerOutlet - ) - termination_power_port = convert_to_protobuf( - termination_power_port, pb.PowerPort - ) - termination_rear_port = convert_to_protobuf(termination_rear_port, pb.RearPort) - metadata = convert_dict_to_struct(metadata) - result = pb.CableTermination( - cable=cable, - cable_end=cable_end, - termination_circuit_termination=termination_circuit_termination, - termination_console_port=termination_console_port, - termination_console_server_port=termination_console_server_port, - termination_front_port=termination_front_port, - termination_interface=termination_interface, - termination_power_feed=termination_power_feed, - termination_power_outlet=termination_power_outlet, - termination_power_port=termination_power_port, - termination_rear_port=termination_rear_port, - metadata=metadata, - ) - return result - - class Circuit: """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Circuit.""" @@ -796,6 +729,7 @@ def __new__( description: str | None = None, distance: float | None = None, distance_unit: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, assignments: ( @@ -805,18 +739,17 @@ def __new__( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.Circuit: """Create a new Circuit.""" provider = convert_to_protobuf(provider, pb.Provider) provider_account = convert_to_protobuf(provider_account, pb.ProviderAccount) type = convert_to_protobuf(type, pb.CircuitType) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) assignments = convert_to_protobuf_list(assignments, pb.CircuitGroupAssignment) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.Circuit( cid=cid, provider=provider, @@ -830,12 +763,12 @@ def __new__( description=description, distance=distance, distance_unit=distance_unit, + owner=owner, comments=comments, tags=tags, assignments=assignments, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -849,30 +782,30 @@ def __new__( slug: str | None = None, description: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, ) -> pb.CircuitGroup: """Create a new CircuitGroup.""" tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.CircuitGroup( name=name, slug=slug, description=description, tenant=tenant, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - comments=comments, ) return result @@ -978,29 +911,29 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, ) -> pb.CircuitType: """Create a new CircuitType.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.CircuitType( name=name, slug=slug, color=color, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - comments=comments, ) return result @@ -1020,13 +953,13 @@ def __new__( scope_site: str | Site | pb.Site | None = None, scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.Cluster: """Create a new Cluster.""" type = convert_to_protobuf(type, pb.ClusterType) @@ -1036,10 +969,10 @@ def __new__( scope_region = convert_to_protobuf(scope_region, pb.Region) scope_site = convert_to_protobuf(scope_site, pb.Site) scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.Cluster( name=name, type=type, @@ -1051,11 +984,11 @@ def __new__( scope_site=scope_site, scope_site_group=scope_site_group, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -1068,28 +1001,28 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, ) -> pb.ClusterGroup: """Create a new ClusterGroup.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ClusterGroup( name=name, slug=slug, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - comments=comments, ) return result @@ -1102,28 +1035,28 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, ) -> pb.ClusterType: """Create a new ClusterType.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ClusterType( name=name, slug=slug, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - comments=comments, ) return result @@ -1141,20 +1074,20 @@ def __new__( speed: int | None = None, description: str | None = None, mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.ConsolePort: """Create a new ConsolePort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ConsolePort( device=device, module=module, @@ -1164,10 +1097,10 @@ def __new__( speed=speed, description=description, mark_connected=mark_connected, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -1185,20 +1118,20 @@ def __new__( speed: int | None = None, description: str | None = None, mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.ConsoleServerPort: """Create a new ConsoleServerPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ConsoleServerPort( device=device, module=module, @@ -1208,10 +1141,10 @@ def __new__( speed=speed, description=description, mark_connected=mark_connected, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -1221,7 +1154,7 @@ class Contact: def __new__( cls, - group: str | ContactGroup | pb.ContactGroup | None = None, + groups: list[str | ContactGroup | pb.ContactGroup] | None = None, name: str | None = None, title: str | None = None, phone: str | None = None, @@ -1229,24 +1162,22 @@ def __new__( address: str | None = None, link: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - groups: list[str | ContactGroup | pb.ContactGroup] | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.Contact: """Create a new Contact.""" - group = convert_to_protobuf(group, pb.ContactGroup) + groups = convert_to_protobuf_list(groups, pb.ContactGroup) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - groups = convert_to_protobuf_list(groups, pb.ContactGroup) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.Contact( - group=group, + groups=groups, name=name, title=title, phone=phone, @@ -1254,12 +1185,11 @@ def __new__( address=address, link=link, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, - groups=groups, metadata=metadata, - owner=owner, ) return result @@ -1299,6 +1229,11 @@ def __new__( ) = None, object_contact_group: str | ContactGroup | pb.ContactGroup | None = None, object_contact_role: str | ContactRole | pb.ContactRole | None = None, + object_custom_field: str | CustomField | pb.CustomField | None = None, + object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + object_custom_link: str | CustomLink | pb.CustomLink | None = None, object_device: str | Device | pb.Device | None = None, object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, object_device_role: str | DeviceRole | pb.DeviceRole | None = None, @@ -1320,6 +1255,7 @@ def __new__( object_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, + object_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, object_l2vpn: str | L2VPN | pb.L2VPN | None = None, object_l2vpn_termination: ( str | L2VPNTermination | pb.L2VPNTermination | None @@ -1330,6 +1266,11 @@ def __new__( object_module: str | Module | pb.Module | None = None, object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, object_module_type: str | ModuleType | pb.ModuleType | None = None, + object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + object_owner: str | Owner | pb.Owner | None = None, + object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, object_platform: str | Platform | pb.Platform | None = None, object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -1393,17 +1334,6 @@ def __new__( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, object_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, - object_custom_field: str | CustomField | pb.CustomField | None = None, - object_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - object_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, - object_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - object_custom_link: str | CustomLink | pb.CustomLink | None = None, - object_owner: str | Owner | pb.Owner | None = None, - object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, contact: str | Contact | pb.Contact | None = None, role: str | ContactRole | pb.ContactRole | None = None, priority: str | None = None, @@ -1419,9 +1349,6 @@ def __new__( object_aggregate = convert_to_protobuf(object_aggregate, pb.Aggregate) object_cable = convert_to_protobuf(object_cable, pb.Cable) object_cable_path = convert_to_protobuf(object_cable_path, pb.CablePath) - object_cable_termination = convert_to_protobuf( - object_cable_termination, pb.CableTermination - ) object_circuit = convert_to_protobuf(object_circuit, pb.Circuit) object_circuit_group = convert_to_protobuf( object_circuit_group, pb.CircuitGroup @@ -1450,6 +1377,11 @@ def __new__( object_contact_group, pb.ContactGroup ) object_contact_role = convert_to_protobuf(object_contact_role, pb.ContactRole) + object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) + object_custom_field_choice_set = convert_to_protobuf( + object_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) object_device = convert_to_protobuf(object_device, pb.Device) object_device_bay = convert_to_protobuf(object_device_bay, pb.DeviceBay) object_device_role = convert_to_protobuf(object_device_role, pb.DeviceRole) @@ -1477,6 +1409,9 @@ def __new__( object_inventory_item_role = convert_to_protobuf( object_inventory_item_role, pb.InventoryItemRole ) + object_journal_entry = convert_to_protobuf( + object_journal_entry, pb.JournalEntry + ) object_l2vpn = convert_to_protobuf(object_l2vpn, pb.L2VPN) object_l2vpn_termination = convert_to_protobuf( object_l2vpn_termination, pb.L2VPNTermination @@ -1487,6 +1422,11 @@ def __new__( object_module = convert_to_protobuf(object_module, pb.Module) object_module_bay = convert_to_protobuf(object_module_bay, pb.ModuleBay) object_module_type = convert_to_protobuf(object_module_type, pb.ModuleType) + object_module_type_profile = convert_to_protobuf( + object_module_type_profile, pb.ModuleTypeProfile + ) + object_owner = convert_to_protobuf(object_owner, pb.Owner) + object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) object_platform = convert_to_protobuf(object_platform, pb.Platform) object_power_feed = convert_to_protobuf(object_power_feed, pb.PowerFeed) object_power_outlet = convert_to_protobuf(object_power_outlet, pb.PowerOutlet) @@ -1558,19 +1498,6 @@ def __new__( object_wireless_link = convert_to_protobuf( object_wireless_link, pb.WirelessLink ) - object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) - object_custom_field_choice_set = convert_to_protobuf( - object_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - object_journal_entry = convert_to_protobuf( - object_journal_entry, pb.JournalEntry - ) - object_module_type_profile = convert_to_protobuf( - object_module_type_profile, pb.ModuleTypeProfile - ) - object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) - object_owner = convert_to_protobuf(object_owner, pb.Owner) - object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) contact = convert_to_protobuf(contact, pb.Contact) role = convert_to_protobuf(role, pb.ContactRole) tags = convert_to_protobuf_list(tags, pb.Tag) @@ -1597,6 +1524,9 @@ def __new__( object_contact_assignment=object_contact_assignment, object_contact_group=object_contact_group, object_contact_role=object_contact_role, + object_custom_field=object_custom_field, + object_custom_field_choice_set=object_custom_field_choice_set, + object_custom_link=object_custom_link, object_device=object_device, object_device_bay=object_device_bay, object_device_role=object_device_role, @@ -1614,6 +1544,7 @@ def __new__( object_interface=object_interface, object_inventory_item=object_inventory_item, object_inventory_item_role=object_inventory_item_role, + object_journal_entry=object_journal_entry, object_l2vpn=object_l2vpn, object_l2vpn_termination=object_l2vpn_termination, object_location=object_location, @@ -1622,6 +1553,9 @@ def __new__( object_module=object_module, object_module_bay=object_module_bay, object_module_type=object_module_type, + object_module_type_profile=object_module_type_profile, + object_owner=object_owner, + object_owner_group=object_owner_group, object_platform=object_platform, object_power_feed=object_power_feed, object_power_outlet=object_power_outlet, @@ -1665,13 +1599,6 @@ def __new__( object_wireless_lan=object_wireless_lan, object_wireless_lan_group=object_wireless_lan_group, object_wireless_link=object_wireless_link, - object_custom_field=object_custom_field, - object_custom_field_choice_set=object_custom_field_choice_set, - object_journal_entry=object_journal_entry, - object_module_type_profile=object_module_type_profile, - object_custom_link=object_custom_link, - object_owner=object_owner, - object_owner_group=object_owner_group, contact=contact, role=role, priority=priority, @@ -1692,29 +1619,29 @@ def __new__( parent: str | ContactGroup | pb.ContactGroup | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - comments: str | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.ContactGroup: """Create a new ContactGroup.""" parent = convert_to_protobuf(parent, pb.ContactGroup) tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ContactGroup( name=name, slug=slug, parent=parent, description=description, tags=tags, - custom_fields=custom_fields, + owner=owner, comments=comments, + custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -1727,28 +1654,119 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, ) -> pb.ContactRole: """Create a new ContactRole.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ContactRole( name=name, slug=slug, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + ) + return result + + +class CustomField: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomField.""" + + def __new__( + cls, + object_types: list[str] | None = None, + type: str | None = None, + related_object_type: str | None = None, + name: str | None = None, + label: str | None = None, + group_name: str | None = None, + description: str | None = None, + required: bool | None = None, + unique: bool | None = None, + search_weight: int | None = None, + filter_logic: str | None = None, + ui_visible: str | None = None, + ui_editable: str | None = None, + is_cloneable: bool | None = None, + default: str | None = None, + related_object_filter: str | None = None, + weight: int | None = None, + validation_minimum: float | None = None, + validation_maximum: float | None = None, + validation_regex: str | None = None, + choice_set: str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.CustomField: + """Create a new CustomField.""" + choice_set = convert_to_protobuf(choice_set, pb.CustomFieldChoiceSet) + owner = convert_to_protobuf(owner, pb.Owner) + metadata = convert_dict_to_struct(metadata) + result = pb.CustomField( + object_types=object_types, + type=type, + related_object_type=related_object_type, + name=name, + label=label, + group_name=group_name, + description=description, + required=required, + unique=unique, + search_weight=search_weight, + filter_logic=filter_logic, + ui_visible=ui_visible, + ui_editable=ui_editable, + is_cloneable=is_cloneable, + default=default, + related_object_filter=related_object_filter, + weight=weight, + validation_minimum=validation_minimum, + validation_maximum=validation_maximum, + validation_regex=validation_regex, + choice_set=choice_set, owner=owner, comments=comments, + metadata=metadata, + ) + return result + + +class CustomFieldChoiceSet: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomFieldChoiceSet.""" + + def __new__( + cls, + name: str | None = None, + description: str | None = None, + base_choices: str | None = None, + extra_choices: list[str] | None = None, + order_alphabetically: bool | None = None, + owner: str | Owner | pb.Owner | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.CustomFieldChoiceSet: + """Create a new CustomFieldChoiceSet.""" + owner = convert_to_protobuf(owner, pb.Owner) + metadata = convert_dict_to_struct(metadata) + result = pb.CustomFieldChoiceSet( + name=name, + description=description, + base_choices=base_choices, + extra_choices=extra_choices, + order_alphabetically=order_alphabetically, + owner=owner, + metadata=metadata, ) return result @@ -1763,7 +1781,6 @@ def __new__( aggregate: str | Aggregate | pb.Aggregate | None = None, cable: str | Cable | pb.Cable | None = None, cable_path: str | CablePath | pb.CablePath | None = None, - cable_termination: str | CableTermination | pb.CableTermination | None = None, circuit: str | Circuit | pb.Circuit | None = None, circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, circuit_group_assignment: ( @@ -1786,6 +1803,11 @@ def __new__( ) = None, contact_group: str | ContactGroup | pb.ContactGroup | None = None, contact_role: str | ContactRole | pb.ContactRole | None = None, + custom_field: str | CustomField | pb.CustomField | None = None, + custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + custom_link: str | CustomLink | pb.CustomLink | None = None, device: str | Device | pb.Device | None = None, device_bay: str | DeviceBay | pb.DeviceBay | None = None, device_role: str | DeviceRole | pb.DeviceRole | None = None, @@ -1807,6 +1829,7 @@ def __new__( inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, + journal_entry: str | JournalEntry | pb.JournalEntry | None = None, l2vpn: str | L2VPN | pb.L2VPN | None = None, l2vpn_termination: str | L2VPNTermination | pb.L2VPNTermination | None = None, location: str | Location | pb.Location | None = None, @@ -1815,6 +1838,11 @@ def __new__( module: str | Module | pb.Module | None = None, module_bay: str | ModuleBay | pb.ModuleBay | None = None, module_type: str | ModuleType | pb.ModuleType | None = None, + module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + owner: str | Owner | pb.Owner | None = None, + owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, platform: str | Platform | pb.Platform | None = None, power_feed: str | PowerFeed | pb.PowerFeed | None = None, power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -1870,17 +1898,6 @@ def __new__( wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, wireless_lan_group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, wireless_link: str | WirelessLink | pb.WirelessLink | None = None, - custom_field: str | CustomField | pb.CustomField | None = None, - custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - journal_entry: str | JournalEntry | pb.JournalEntry | None = None, - module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - custom_link: str | CustomLink | pb.CustomLink | None = None, - owner: str | Owner | pb.Owner | None = None, - owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, ) -> pb.CustomFieldObjectReference: """Create a new CustomFieldObjectReference.""" asn = convert_to_protobuf(asn, pb.ASN) @@ -1888,7 +1905,6 @@ def __new__( aggregate = convert_to_protobuf(aggregate, pb.Aggregate) cable = convert_to_protobuf(cable, pb.Cable) cable_path = convert_to_protobuf(cable_path, pb.CablePath) - cable_termination = convert_to_protobuf(cable_termination, pb.CableTermination) circuit = convert_to_protobuf(circuit, pb.Circuit) circuit_group = convert_to_protobuf(circuit_group, pb.CircuitGroup) circuit_group_assignment = convert_to_protobuf( @@ -1911,6 +1927,11 @@ def __new__( ) contact_group = convert_to_protobuf(contact_group, pb.ContactGroup) contact_role = convert_to_protobuf(contact_role, pb.ContactRole) + custom_field = convert_to_protobuf(custom_field, pb.CustomField) + custom_field_choice_set = convert_to_protobuf( + custom_field_choice_set, pb.CustomFieldChoiceSet + ) + custom_link = convert_to_protobuf(custom_link, pb.CustomLink) device = convert_to_protobuf(device, pb.Device) device_bay = convert_to_protobuf(device_bay, pb.DeviceBay) device_role = convert_to_protobuf(device_role, pb.DeviceRole) @@ -1932,6 +1953,7 @@ def __new__( inventory_item_role = convert_to_protobuf( inventory_item_role, pb.InventoryItemRole ) + journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) l2vpn_termination = convert_to_protobuf(l2vpn_termination, pb.L2VPNTermination) location = convert_to_protobuf(location, pb.Location) @@ -1940,6 +1962,11 @@ def __new__( module = convert_to_protobuf(module, pb.Module) module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) module_type = convert_to_protobuf(module_type, pb.ModuleType) + module_type_profile = convert_to_protobuf( + module_type_profile, pb.ModuleTypeProfile + ) + owner = convert_to_protobuf(owner, pb.Owner) + owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) platform = convert_to_protobuf(platform, pb.Platform) power_feed = convert_to_protobuf(power_feed, pb.PowerFeed) power_outlet = convert_to_protobuf(power_outlet, pb.PowerOutlet) @@ -1997,24 +2024,12 @@ def __new__( wireless_lan_group, pb.WirelessLANGroup ) wireless_link = convert_to_protobuf(wireless_link, pb.WirelessLink) - custom_field = convert_to_protobuf(custom_field, pb.CustomField) - custom_field_choice_set = convert_to_protobuf( - custom_field_choice_set, pb.CustomFieldChoiceSet - ) - journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) - module_type_profile = convert_to_protobuf( - module_type_profile, pb.ModuleTypeProfile - ) - custom_link = convert_to_protobuf(custom_link, pb.CustomLink) - owner = convert_to_protobuf(owner, pb.Owner) - owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) result = pb.CustomFieldObjectReference( asn=asn, asn_range=asn_range, aggregate=aggregate, cable=cable, cable_path=cable_path, - cable_termination=cable_termination, circuit=circuit, circuit_group=circuit_group, circuit_group_assignment=circuit_group_assignment, @@ -2029,6 +2044,9 @@ def __new__( contact_assignment=contact_assignment, contact_group=contact_group, contact_role=contact_role, + custom_field=custom_field, + custom_field_choice_set=custom_field_choice_set, + custom_link=custom_link, device=device, device_bay=device_bay, device_role=device_role, @@ -2046,6 +2064,7 @@ def __new__( interface=interface, inventory_item=inventory_item, inventory_item_role=inventory_item_role, + journal_entry=journal_entry, l2vpn=l2vpn, l2vpn_termination=l2vpn_termination, location=location, @@ -2054,6 +2073,9 @@ def __new__( module=module, module_bay=module_bay, module_type=module_type, + module_type_profile=module_type_profile, + owner=owner, + owner_group=owner_group, platform=platform, power_feed=power_feed, power_outlet=power_outlet, @@ -2097,13 +2119,6 @@ def __new__( wireless_lan=wireless_lan, wireless_lan_group=wireless_lan_group, wireless_link=wireless_link, - custom_field=custom_field, - custom_field_choice_set=custom_field_choice_set, - journal_entry=journal_entry, - module_type_profile=module_type_profile, - custom_link=custom_link, - owner=owner, - owner_group=owner_group, ) return result @@ -2113,11 +2128,6 @@ class CustomFieldValue: def __new__( cls, - multiple_selection: list[str] | None = None, - multiple_objects: ( - list[str | CustomFieldObjectReference | pb.CustomFieldObjectReference] - | None - ) = None, text: str | None = None, long_text: str | None = None, integer: int | None = None, @@ -2131,15 +2141,18 @@ def __new__( object: ( str | CustomFieldObjectReference | pb.CustomFieldObjectReference | None ) = None, + multiple_selection: list[str] | None = None, + multiple_objects: ( + list[str | CustomFieldObjectReference | pb.CustomFieldObjectReference] + | None + ) = None, ) -> pb.CustomFieldValue: """Create a new CustomFieldValue.""" + object = convert_to_protobuf(object, pb.CustomFieldObjectReference) multiple_objects = convert_to_protobuf_list( multiple_objects, pb.CustomFieldObjectReference ) - object = convert_to_protobuf(object, pb.CustomFieldObjectReference) result = pb.CustomFieldValue( - multiple_selection=multiple_selection, - multiple_objects=multiple_objects, text=text, long_text=long_text, integer=integer, @@ -2151,46 +2164,84 @@ def __new__( json=json, selection=selection, object=object, + multiple_selection=multiple_selection, + multiple_objects=multiple_objects, ) return result -class Device: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Device.""" +class CustomLink: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomLink.""" def __new__( cls, + object_types: list[str] | None = None, name: str | None = None, - device_type: str | DeviceType | pb.DeviceType | None = None, - role: str | DeviceRole | pb.DeviceRole | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - platform: str | Platform | pb.Platform | None = None, - serial: str | None = None, - asset_tag: str | None = None, - site: str | Site | pb.Site | None = None, - location: str | Location | pb.Location | None = None, - rack: str | Rack | pb.Rack | None = None, - position: float | None = None, - face: str | None = None, - latitude: float | None = None, - longitude: float | None = None, - status: str | None = None, - airflow: str | None = None, - primary_ip4: str | IPAddress | pb.IPAddress | None = None, - primary_ip6: str | IPAddress | pb.IPAddress | None = None, - oob_ip: str | IPAddress | pb.IPAddress | None = None, - cluster: str | Cluster | pb.Cluster | None = None, - virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, + enabled: bool | None = None, + link_text: str | None = None, + link_url: str | None = None, + weight: int | None = None, + group_name: str | None = None, + button_class: str | None = None, + new_window: bool | None = None, + owner: str | Owner | pb.Owner | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.CustomLink: + """Create a new CustomLink.""" + owner = convert_to_protobuf(owner, pb.Owner) + metadata = convert_dict_to_struct(metadata) + result = pb.CustomLink( + object_types=object_types, + name=name, + enabled=enabled, + link_text=link_text, + link_url=link_url, + weight=weight, + group_name=group_name, + button_class=button_class, + new_window=new_window, + owner=owner, + metadata=metadata, + ) + return result + + +class Device: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Device.""" + + def __new__( + cls, + name: str | None = None, + device_type: str | DeviceType | pb.DeviceType | None = None, + role: str | DeviceRole | pb.DeviceRole | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + platform: str | Platform | pb.Platform | None = None, + serial: str | None = None, + asset_tag: str | None = None, + site: str | Site | pb.Site | None = None, + location: str | Location | pb.Location | None = None, + rack: str | Rack | pb.Rack | None = None, + position: float | None = None, + face: str | None = None, + latitude: float | None = None, + longitude: float | None = None, + status: str | None = None, + airflow: str | None = None, + primary_ip4: str | IPAddress | pb.IPAddress | None = None, + primary_ip6: str | IPAddress | pb.IPAddress | None = None, + oob_ip: str | IPAddress | pb.IPAddress | None = None, + cluster: str | Cluster | pb.Cluster | None = None, + virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, vc_position: int | None = None, vc_priority: int | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, ) -> pb.Device: @@ -2207,10 +2258,10 @@ def __new__( oob_ip = convert_to_protobuf(oob_ip, pb.IPAddress) cluster = convert_to_protobuf(cluster, pb.Cluster) virtual_chassis = convert_to_protobuf(virtual_chassis, pb.VirtualChassis) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -2246,11 +2297,11 @@ def __new__( vc_position=vc_position, vc_priority=vc_priority, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -2265,30 +2316,30 @@ def __new__( label: str | None = None, description: str | None = None, installed_device: str | Device | pb.Device | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceBay: """Create a new DeviceBay.""" device = convert_to_protobuf(device, pb.Device) installed_device = convert_to_protobuf(installed_device, pb.Device) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceBay( device=device, name=name, label=label, description=description, installed_device=installed_device, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -2302,34 +2353,34 @@ def __new__( slug: str | None = None, color: str | None = None, vm_role: bool | None = None, + parent: str | DeviceRole | pb.DeviceRole | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - parent: str | DeviceRole | pb.DeviceRole | None = None, - comments: str | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceRole: """Create a new DeviceRole.""" + parent = convert_to_protobuf(parent, pb.DeviceRole) tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - parent = convert_to_protobuf(parent, pb.DeviceRole) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceRole( name=name, slug=slug, color=color, vm_role=vm_role, + parent=parent, description=description, tags=tags, - custom_fields=custom_fields, - parent=parent, + owner=owner, comments=comments, + custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -2352,21 +2403,21 @@ def __new__( weight: float | None = None, weight_unit: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceType: """Create a new DeviceType.""" manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) default_platform = convert_to_protobuf(default_platform, pb.Platform) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceType( manufacturer=manufacturer, default_platform=default_platform, @@ -2381,11 +2432,11 @@ def __new__( weight=weight, weight_unit=weight_unit, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -2401,19 +2452,19 @@ def __new__( auth_type: str | None = None, auth_key: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.FHRPGroup: """Create a new FHRPGroup.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.FHRPGroup( name=name, protocol=protocol, @@ -2421,11 +2472,11 @@ def __new__( auth_type=auth_type, auth_key=auth_key, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -2466,6 +2517,11 @@ def __new__( ) = None, interface_contact_group: str | ContactGroup | pb.ContactGroup | None = None, interface_contact_role: str | ContactRole | pb.ContactRole | None = None, + interface_custom_field: str | CustomField | pb.CustomField | None = None, + interface_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + interface_custom_link: str | CustomLink | pb.CustomLink | None = None, interface_device: str | Device | pb.Device | None = None, interface_device_bay: str | DeviceBay | pb.DeviceBay | None = None, interface_device_role: str | DeviceRole | pb.DeviceRole | None = None, @@ -2487,6 +2543,7 @@ def __new__( interface_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, + interface_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, interface_l2vpn: str | L2VPN | pb.L2VPN | None = None, interface_l2vpn_termination: ( str | L2VPNTermination | pb.L2VPNTermination | None @@ -2497,6 +2554,11 @@ def __new__( interface_module: str | Module | pb.Module | None = None, interface_module_bay: str | ModuleBay | pb.ModuleBay | None = None, interface_module_type: str | ModuleType | pb.ModuleType | None = None, + interface_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + interface_owner: str | Owner | pb.Owner | None = None, + interface_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, interface_platform: str | Platform | pb.Platform | None = None, interface_power_feed: str | PowerFeed | pb.PowerFeed | None = None, interface_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -2566,17 +2628,6 @@ def __new__( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, interface_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, - interface_custom_field: str | CustomField | pb.CustomField | None = None, - interface_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - interface_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, - interface_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - interface_custom_link: str | CustomLink | pb.CustomLink | None = None, - interface_owner: str | Owner | pb.Owner | None = None, - interface_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, priority: int | None = None, metadata: dict[str, Any] | None = None, ) -> pb.FHRPGroupAssignment: @@ -2587,9 +2638,6 @@ def __new__( interface_aggregate = convert_to_protobuf(interface_aggregate, pb.Aggregate) interface_cable = convert_to_protobuf(interface_cable, pb.Cable) interface_cable_path = convert_to_protobuf(interface_cable_path, pb.CablePath) - interface_cable_termination = convert_to_protobuf( - interface_cable_termination, pb.CableTermination - ) interface_circuit = convert_to_protobuf(interface_circuit, pb.Circuit) interface_circuit_group = convert_to_protobuf( interface_circuit_group, pb.CircuitGroup @@ -2626,6 +2674,15 @@ def __new__( interface_contact_role = convert_to_protobuf( interface_contact_role, pb.ContactRole ) + interface_custom_field = convert_to_protobuf( + interface_custom_field, pb.CustomField + ) + interface_custom_field_choice_set = convert_to_protobuf( + interface_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + interface_custom_link = convert_to_protobuf( + interface_custom_link, pb.CustomLink + ) interface_device = convert_to_protobuf(interface_device, pb.Device) interface_device_bay = convert_to_protobuf(interface_device_bay, pb.DeviceBay) interface_device_role = convert_to_protobuf( @@ -2661,6 +2718,9 @@ def __new__( interface_inventory_item_role = convert_to_protobuf( interface_inventory_item_role, pb.InventoryItemRole ) + interface_journal_entry = convert_to_protobuf( + interface_journal_entry, pb.JournalEntry + ) interface_l2vpn = convert_to_protobuf(interface_l2vpn, pb.L2VPN) interface_l2vpn_termination = convert_to_protobuf( interface_l2vpn_termination, pb.L2VPNTermination @@ -2677,6 +2737,13 @@ def __new__( interface_module_type = convert_to_protobuf( interface_module_type, pb.ModuleType ) + interface_module_type_profile = convert_to_protobuf( + interface_module_type_profile, pb.ModuleTypeProfile + ) + interface_owner = convert_to_protobuf(interface_owner, pb.Owner) + interface_owner_group = convert_to_protobuf( + interface_owner_group, pb.OwnerGroup + ) interface_platform = convert_to_protobuf(interface_platform, pb.Platform) interface_power_feed = convert_to_protobuf(interface_power_feed, pb.PowerFeed) interface_power_outlet = convert_to_protobuf( @@ -2764,25 +2831,6 @@ def __new__( interface_wireless_link = convert_to_protobuf( interface_wireless_link, pb.WirelessLink ) - interface_custom_field = convert_to_protobuf( - interface_custom_field, pb.CustomField - ) - interface_custom_field_choice_set = convert_to_protobuf( - interface_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - interface_journal_entry = convert_to_protobuf( - interface_journal_entry, pb.JournalEntry - ) - interface_module_type_profile = convert_to_protobuf( - interface_module_type_profile, pb.ModuleTypeProfile - ) - interface_custom_link = convert_to_protobuf( - interface_custom_link, pb.CustomLink - ) - interface_owner = convert_to_protobuf(interface_owner, pb.Owner) - interface_owner_group = convert_to_protobuf( - interface_owner_group, pb.OwnerGroup - ) metadata = convert_dict_to_struct(metadata) result = pb.FHRPGroupAssignment( group=group, @@ -2806,6 +2854,9 @@ def __new__( interface_contact_assignment=interface_contact_assignment, interface_contact_group=interface_contact_group, interface_contact_role=interface_contact_role, + interface_custom_field=interface_custom_field, + interface_custom_field_choice_set=interface_custom_field_choice_set, + interface_custom_link=interface_custom_link, interface_device=interface_device, interface_device_bay=interface_device_bay, interface_device_role=interface_device_role, @@ -2823,6 +2874,7 @@ def __new__( interface_interface=interface_interface, interface_inventory_item=interface_inventory_item, interface_inventory_item_role=interface_inventory_item_role, + interface_journal_entry=interface_journal_entry, interface_l2vpn=interface_l2vpn, interface_l2vpn_termination=interface_l2vpn_termination, interface_location=interface_location, @@ -2831,6 +2883,9 @@ def __new__( interface_module=interface_module, interface_module_bay=interface_module_bay, interface_module_type=interface_module_type, + interface_module_type_profile=interface_module_type_profile, + interface_owner=interface_owner, + interface_owner_group=interface_owner_group, interface_platform=interface_platform, interface_power_feed=interface_power_feed, interface_power_outlet=interface_power_outlet, @@ -2874,13 +2929,6 @@ def __new__( interface_wireless_lan=interface_wireless_lan, interface_wireless_lan_group=interface_wireless_lan_group, interface_wireless_link=interface_wireless_link, - interface_custom_field=interface_custom_field, - interface_custom_field_choice_set=interface_custom_field_choice_set, - interface_journal_entry=interface_journal_entry, - interface_module_type_profile=interface_module_type_profile, - interface_custom_link=interface_custom_link, - interface_owner=interface_owner, - interface_owner_group=interface_owner_group, priority=priority, metadata=metadata, ) @@ -2898,26 +2946,23 @@ def __new__( label: str | None = None, type: str | None = None, color: str | None = None, - rear_port: str | RearPort | pb.RearPort | None = None, - rear_port_position: int | None = None, + positions: int | None = None, description: str | None = None, mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - positions: int | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.FrontPort: """Create a new FrontPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - rear_port = convert_to_protobuf(rear_port, pb.RearPort) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.FrontPort( device=device, module=module, @@ -2925,15 +2970,13 @@ def __new__( label=label, type=type, color=color, - rear_port=rear_port, - rear_port_position=rear_port_position, + positions=positions, description=description, mark_connected=mark_connected, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - positions=positions, - owner=owner, ) return result @@ -2973,6 +3016,11 @@ def __new__( ) = None, object_contact_group: str | ContactGroup | pb.ContactGroup | None = None, object_contact_role: str | ContactRole | pb.ContactRole | None = None, + object_custom_field: str | CustomField | pb.CustomField | None = None, + object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + object_custom_link: str | CustomLink | pb.CustomLink | None = None, object_device: str | Device | pb.Device | None = None, object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, object_device_role: str | DeviceRole | pb.DeviceRole | None = None, @@ -2994,6 +3042,7 @@ def __new__( object_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, + object_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, object_l2vpn: str | L2VPN | pb.L2VPN | None = None, object_l2vpn_termination: ( str | L2VPNTermination | pb.L2VPNTermination | None @@ -3004,6 +3053,11 @@ def __new__( object_module: str | Module | pb.Module | None = None, object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, object_module_type: str | ModuleType | pb.ModuleType | None = None, + object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + object_owner: str | Owner | pb.Owner | None = None, + object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, object_platform: str | Platform | pb.Platform | None = None, object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -3067,17 +3121,6 @@ def __new__( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, object_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, - object_custom_field: str | CustomField | pb.CustomField | None = None, - object_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - object_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, - object_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - object_custom_link: str | CustomLink | pb.CustomLink | None = None, - object_owner: str | Owner | pb.Owner | None = None, - object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, ) -> pb.GenericObject: """Create a new GenericObject.""" object_asn = convert_to_protobuf(object_asn, pb.ASN) @@ -3085,9 +3128,6 @@ def __new__( object_aggregate = convert_to_protobuf(object_aggregate, pb.Aggregate) object_cable = convert_to_protobuf(object_cable, pb.Cable) object_cable_path = convert_to_protobuf(object_cable_path, pb.CablePath) - object_cable_termination = convert_to_protobuf( - object_cable_termination, pb.CableTermination - ) object_circuit = convert_to_protobuf(object_circuit, pb.Circuit) object_circuit_group = convert_to_protobuf( object_circuit_group, pb.CircuitGroup @@ -3116,6 +3156,11 @@ def __new__( object_contact_group, pb.ContactGroup ) object_contact_role = convert_to_protobuf(object_contact_role, pb.ContactRole) + object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) + object_custom_field_choice_set = convert_to_protobuf( + object_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) object_device = convert_to_protobuf(object_device, pb.Device) object_device_bay = convert_to_protobuf(object_device_bay, pb.DeviceBay) object_device_role = convert_to_protobuf(object_device_role, pb.DeviceRole) @@ -3143,6 +3188,9 @@ def __new__( object_inventory_item_role = convert_to_protobuf( object_inventory_item_role, pb.InventoryItemRole ) + object_journal_entry = convert_to_protobuf( + object_journal_entry, pb.JournalEntry + ) object_l2vpn = convert_to_protobuf(object_l2vpn, pb.L2VPN) object_l2vpn_termination = convert_to_protobuf( object_l2vpn_termination, pb.L2VPNTermination @@ -3153,6 +3201,11 @@ def __new__( object_module = convert_to_protobuf(object_module, pb.Module) object_module_bay = convert_to_protobuf(object_module_bay, pb.ModuleBay) object_module_type = convert_to_protobuf(object_module_type, pb.ModuleType) + object_module_type_profile = convert_to_protobuf( + object_module_type_profile, pb.ModuleTypeProfile + ) + object_owner = convert_to_protobuf(object_owner, pb.Owner) + object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) object_platform = convert_to_protobuf(object_platform, pb.Platform) object_power_feed = convert_to_protobuf(object_power_feed, pb.PowerFeed) object_power_outlet = convert_to_protobuf(object_power_outlet, pb.PowerOutlet) @@ -3224,19 +3277,6 @@ def __new__( object_wireless_link = convert_to_protobuf( object_wireless_link, pb.WirelessLink ) - object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) - object_custom_field_choice_set = convert_to_protobuf( - object_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - object_journal_entry = convert_to_protobuf( - object_journal_entry, pb.JournalEntry - ) - object_module_type_profile = convert_to_protobuf( - object_module_type_profile, pb.ModuleTypeProfile - ) - object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) - object_owner = convert_to_protobuf(object_owner, pb.Owner) - object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) result = pb.GenericObject( object_asn=object_asn, object_asn_range=object_asn_range, @@ -3258,6 +3298,9 @@ def __new__( object_contact_assignment=object_contact_assignment, object_contact_group=object_contact_group, object_contact_role=object_contact_role, + object_custom_field=object_custom_field, + object_custom_field_choice_set=object_custom_field_choice_set, + object_custom_link=object_custom_link, object_device=object_device, object_device_bay=object_device_bay, object_device_role=object_device_role, @@ -3275,6 +3318,7 @@ def __new__( object_interface=object_interface, object_inventory_item=object_inventory_item, object_inventory_item_role=object_inventory_item_role, + object_journal_entry=object_journal_entry, object_l2vpn=object_l2vpn, object_l2vpn_termination=object_l2vpn_termination, object_location=object_location, @@ -3283,6 +3327,9 @@ def __new__( object_module=object_module, object_module_bay=object_module_bay, object_module_type=object_module_type, + object_module_type_profile=object_module_type_profile, + object_owner=object_owner, + object_owner_group=object_owner_group, object_platform=object_platform, object_power_feed=object_power_feed, object_power_outlet=object_power_outlet, @@ -3326,13 +3373,6 @@ def __new__( object_wireless_lan=object_wireless_lan, object_wireless_lan_group=object_wireless_lan_group, object_wireless_link=object_wireless_link, - object_custom_field=object_custom_field, - object_custom_field_choice_set=object_custom_field_choice_set, - object_journal_entry=object_journal_entry, - object_module_type_profile=object_module_type_profile, - object_custom_link=object_custom_link, - object_owner=object_owner, - object_owner_group=object_owner_group, ) return result @@ -3346,34 +3386,34 @@ def __new__( description: str | None = None, version: int | None = None, mode: str | None = None, + proposals: list[str | IKEProposal | pb.IKEProposal] | None = None, preshared_key: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - proposals: list[str | IKEProposal | pb.IKEProposal] | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IKEPolicy: """Create a new IKEPolicy.""" + proposals = convert_to_protobuf_list(proposals, pb.IKEProposal) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - proposals = convert_to_protobuf_list(proposals, pb.IKEProposal) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IKEPolicy( name=name, description=description, version=version, mode=mode, + proposals=proposals, preshared_key=preshared_key, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, - proposals=proposals, metadata=metadata, - owner=owner, ) return result @@ -3390,19 +3430,19 @@ def __new__( authentication_algorithm: str | None = None, group: int | None = None, sa_lifetime: int | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IKEProposal: """Create a new IKEProposal.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IKEProposal( name=name, description=description, @@ -3411,11 +3451,11 @@ def __new__( authentication_algorithm=authentication_algorithm, group=group, sa_lifetime=sa_lifetime, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -3436,13 +3476,13 @@ def __new__( nat_inside: str | IPAddress | pb.IPAddress | None = None, dns_name: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, device_type: str | DeviceType | pb.DeviceType = None, @@ -3464,10 +3504,10 @@ def __new__( assigned_object_vm_interface, pb.VMInterface ) nat_inside = convert_to_protobuf(nat_inside, pb.IPAddress) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -3518,11 +3558,11 @@ def __new__( nat_inside=nat_inside, dns_name=dns_name, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -3539,24 +3579,24 @@ def __new__( status: str | None = None, role: str | Role | pb.Role | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, + mark_populated: bool | None = None, mark_utilized: bool | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - mark_populated: bool | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IPRange: """Create a new IPRange.""" vrf = convert_to_protobuf(vrf, pb.VRF) tenant = convert_to_protobuf(tenant, pb.Tenant) role = convert_to_protobuf(role, pb.Role) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPRange( start_address=start_address, end_address=end_address, @@ -3565,13 +3605,13 @@ def __new__( status=status, role=role, description=description, + owner=owner, comments=comments, tags=tags, + mark_populated=mark_populated, mark_utilized=mark_utilized, custom_fields=custom_fields, - mark_populated=mark_populated, metadata=metadata, - owner=owner, ) return result @@ -3583,32 +3623,32 @@ def __new__( cls, name: str | None = None, description: str | None = None, + proposals: list[str | IPSecProposal | pb.IPSecProposal] | None = None, pfs_group: int | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - proposals: list[str | IPSecProposal | pb.IPSecProposal] | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecPolicy: """Create a new IPSecPolicy.""" + proposals = convert_to_protobuf_list(proposals, pb.IPSecProposal) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - proposals = convert_to_protobuf_list(proposals, pb.IPSecProposal) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecPolicy( name=name, description=description, + proposals=proposals, pfs_group=pfs_group, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, - proposals=proposals, metadata=metadata, - owner=owner, ) return result @@ -3623,32 +3663,32 @@ def __new__( mode: str | None = None, ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, ipsec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecProfile: """Create a new IPSecProfile.""" ike_policy = convert_to_protobuf(ike_policy, pb.IKEPolicy) ipsec_policy = convert_to_protobuf(ipsec_policy, pb.IPSecPolicy) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecProfile( name=name, description=description, mode=mode, ike_policy=ike_policy, ipsec_policy=ipsec_policy, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -3664,19 +3704,19 @@ def __new__( authentication_algorithm: str | None = None, sa_lifetime_seconds: int | None = None, sa_lifetime_data: int | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecProposal: """Create a new IPSecProposal.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecProposal( name=name, description=description, @@ -3684,11 +3724,11 @@ def __new__( authentication_algorithm=authentication_algorithm, sa_lifetime_seconds=sa_lifetime_seconds, sa_lifetime_data=sa_lifetime_data, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -3699,6 +3739,7 @@ class Interface: def __new__( cls, device: str | Device | pb.Device | None = None, + vdcs: list[str | VirtualDeviceContext | pb.VirtualDeviceContext] | None = None, module: str | Module | pb.Module | None = None, name: str | None = None, label: str | None = None, @@ -3723,21 +3764,20 @@ def __new__( rf_channel_width: float | None = None, tx_power: int | None = None, untagged_vlan: str | VLAN | pb.VLAN | None = None, + tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, qinq_svlan: str | VLAN | pb.VLAN | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, mark_connected: bool | None = None, + wireless_lans: list[str | WirelessLAN | pb.WirelessLAN] | None = None, vrf: str | VRF | pb.VRF | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - vdcs: list[str | VirtualDeviceContext | pb.VirtualDeviceContext] | None = None, - tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, - wireless_lans: list[str | WirelessLAN | pb.WirelessLAN] | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, device_type: str | DeviceType | pb.DeviceType = None, @@ -3747,24 +3787,24 @@ def __new__( ) -> pb.Interface: """Create a new Interface.""" device = convert_to_protobuf(device, pb.Device) + vdcs = convert_to_protobuf_list(vdcs, pb.VirtualDeviceContext) module = convert_to_protobuf(module, pb.Module) parent = convert_to_protobuf(parent, pb.Interface) bridge = convert_to_protobuf(bridge, pb.Interface) lag = convert_to_protobuf(lag, pb.Interface) primary_mac_address = convert_to_protobuf(primary_mac_address, pb.MACAddress) untagged_vlan = convert_to_protobuf(untagged_vlan, pb.VLAN) + tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) vlan_translation_policy = convert_to_protobuf( vlan_translation_policy, pb.VLANTranslationPolicy ) + wireless_lans = convert_to_protobuf_list(wireless_lans, pb.WirelessLAN) vrf = convert_to_protobuf(vrf, pb.VRF) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - vdcs = convert_to_protobuf_list(vdcs, pb.VirtualDeviceContext) - tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) - wireless_lans = convert_to_protobuf_list(wireless_lans, pb.WirelessLAN) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -3793,6 +3833,7 @@ def __new__( device.role.CopyFrom(role) result = pb.Interface( device=device, + vdcs=vdcs, module=module, name=name, label=label, @@ -3817,17 +3858,16 @@ def __new__( rf_channel_width=rf_channel_width, tx_power=tx_power, untagged_vlan=untagged_vlan, + tagged_vlans=tagged_vlans, qinq_svlan=qinq_svlan, vlan_translation_policy=vlan_translation_policy, mark_connected=mark_connected, + wireless_lans=wireless_lans, vrf=vrf, + owner=owner, tags=tags, custom_fields=custom_fields, - vdcs=vdcs, - tagged_vlans=tagged_vlans, - wireless_lans=wireless_lans, metadata=metadata, - owner=owner, ) return result @@ -3858,12 +3898,12 @@ def __new__( component_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, component_power_port: str | PowerPort | pb.PowerPort | None = None, component_rear_port: str | RearPort | pb.RearPort | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.InventoryItem: """Create a new InventoryItem.""" device = convert_to_protobuf(device, pb.Device) @@ -3883,10 +3923,10 @@ def __new__( ) component_power_port = convert_to_protobuf(component_power_port, pb.PowerPort) component_rear_port = convert_to_protobuf(component_rear_port, pb.RearPort) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.InventoryItem( device=device, parent=parent, @@ -3907,10 +3947,10 @@ def __new__( component_power_outlet=component_power_outlet, component_power_port=component_power_port, component_rear_port=component_rear_port, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -3924,91 +3964,38 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, ) -> pb.InventoryItemRole: """Create a new InventoryItemRole.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.InventoryItemRole( name=name, slug=slug, color=color, description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, owner=owner, comments=comments, - ) - return result - - -class L2VPN: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPN.""" - - def __new__( - cls, - identifier: int | None = None, - name: str | None = None, - slug: str | None = None, - type: str | None = None, - description: str | None = None, - comments: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - status: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.L2VPN: - """Create a new L2VPN.""" - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) - export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.L2VPN( - identifier=identifier, - name=name, - slug=slug, - type=type, - description=description, - comments=comments, - tenant=tenant, tags=tags, custom_fields=custom_fields, - import_targets=import_targets, - export_targets=export_targets, - status=status, metadata=metadata, - owner=owner, ) return result -class L2VPNTermination: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPNTermination.""" +class JournalEntry: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.JournalEntry.""" def __new__( cls, - l2vpn: str | L2VPN | pb.L2VPN | None = None, - assigned_object_interface: str | Interface | pb.Interface | None = None, - assigned_object_vlan: str | VLAN | pb.VLAN | None = None, - assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, assigned_object_asn: str | ASN | pb.ASN | None = None, assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, assigned_object_aggregate: str | Aggregate | pb.Aggregate | None = None, @@ -4049,6 +4036,7 @@ def __new__( assigned_object_custom_field_choice_set: ( str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None ) = None, + assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, assigned_object_device: str | Device | pb.Device | None = None, assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, @@ -4069,6 +4057,7 @@ def __new__( assigned_object_ip_sec_proposal: ( str | IPSecProposal | pb.IPSecProposal | None ) = None, + assigned_object_interface: str | Interface | pb.Interface | None = None, assigned_object_inventory_item: ( str | InventoryItem | pb.InventoryItem | None ) = None, @@ -4093,6 +4082,8 @@ def __new__( assigned_object_module_type_profile: ( str | ModuleTypeProfile | pb.ModuleTypeProfile | None ) = None, + assigned_object_owner: str | Owner | pb.Owner | None = None, + assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, assigned_object_platform: str | Platform | pb.Platform | None = None, assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -4128,6 +4119,7 @@ def __new__( assigned_object_tunnel_termination: ( str | TunnelTermination | pb.TunnelTermination | None ) = None, + assigned_object_vlan: str | VLAN | pb.VLAN | None = None, assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, assigned_object_vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None @@ -4135,6 +4127,7 @@ def __new__( assigned_object_vlan_translation_rule: ( str | VLANTranslationRule | pb.VLANTranslationRule | None ) = None, + assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, assigned_object_vrf: str | VRF | pb.VRF | None = None, assigned_object_virtual_chassis: ( str | VirtualChassis | pb.VirtualChassis | None @@ -4162,24 +4155,15 @@ def __new__( assigned_object_wireless_link: ( str | WirelessLink | pb.WirelessLink | None ) = None, - assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, - assigned_object_owner: str | Owner | pb.Owner | None = None, - assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + kind: str | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.L2VPNTermination: - """Create a new L2VPNTermination.""" - l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) - assigned_object_interface = convert_to_protobuf( - assigned_object_interface, pb.Interface - ) - assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface - ) + ) -> pb.JournalEntry: + """Create a new JournalEntry.""" assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) assigned_object_asn_range = convert_to_protobuf( assigned_object_asn_range, pb.ASNRange @@ -4191,9 +4175,6 @@ def __new__( assigned_object_cable_path = convert_to_protobuf( assigned_object_cable_path, pb.CablePath ) - assigned_object_cable_termination = convert_to_protobuf( - assigned_object_cable_termination, pb.CableTermination - ) assigned_object_circuit = convert_to_protobuf( assigned_object_circuit, pb.Circuit ) @@ -4242,6 +4223,9 @@ def __new__( assigned_object_custom_field_choice_set = convert_to_protobuf( assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet ) + assigned_object_custom_link = convert_to_protobuf( + assigned_object_custom_link, pb.CustomLink + ) assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) assigned_object_device_bay = convert_to_protobuf( assigned_object_device_bay, pb.DeviceBay @@ -4282,6 +4266,9 @@ def __new__( assigned_object_ip_sec_proposal = convert_to_protobuf( assigned_object_ip_sec_proposal, pb.IPSecProposal ) + assigned_object_interface = convert_to_protobuf( + assigned_object_interface, pb.Interface + ) assigned_object_inventory_item = convert_to_protobuf( assigned_object_inventory_item, pb.InventoryItem ) @@ -4314,6 +4301,10 @@ def __new__( assigned_object_module_type_profile = convert_to_protobuf( assigned_object_module_type_profile, pb.ModuleTypeProfile ) + assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) + assigned_object_owner_group = convert_to_protobuf( + assigned_object_owner_group, pb.OwnerGroup + ) assigned_object_platform = convert_to_protobuf( assigned_object_platform, pb.Platform ) @@ -4377,6 +4368,7 @@ def __new__( assigned_object_tunnel_termination = convert_to_protobuf( assigned_object_tunnel_termination, pb.TunnelTermination ) + assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) assigned_object_vlan_group = convert_to_protobuf( assigned_object_vlan_group, pb.VLANGroup ) @@ -4386,6 +4378,9 @@ def __new__( assigned_object_vlan_translation_rule = convert_to_protobuf( assigned_object_vlan_translation_rule, pb.VLANTranslationRule ) + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface + ) assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) assigned_object_virtual_chassis = convert_to_protobuf( assigned_object_virtual_chassis, pb.VirtualChassis @@ -4417,21 +4412,10 @@ def __new__( assigned_object_wireless_link = convert_to_protobuf( assigned_object_wireless_link, pb.WirelessLink ) - assigned_object_custom_link = convert_to_protobuf( - assigned_object_custom_link, pb.CustomLink - ) - assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) - assigned_object_owner_group = convert_to_protobuf( - assigned_object_owner_group, pb.OwnerGroup - ) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.L2VPNTermination( - l2vpn=l2vpn, - assigned_object_interface=assigned_object_interface, - assigned_object_vlan=assigned_object_vlan, - assigned_object_vm_interface=assigned_object_vm_interface, + result = pb.JournalEntry( assigned_object_asn=assigned_object_asn, assigned_object_asn_range=assigned_object_asn_range, assigned_object_aggregate=assigned_object_aggregate, @@ -4454,6 +4438,7 @@ def __new__( assigned_object_contact_role=assigned_object_contact_role, assigned_object_custom_field=assigned_object_custom_field, assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, + assigned_object_custom_link=assigned_object_custom_link, assigned_object_device=assigned_object_device, assigned_object_device_bay=assigned_object_device_bay, assigned_object_device_role=assigned_object_device_role, @@ -4468,6 +4453,7 @@ def __new__( assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, + assigned_object_interface=assigned_object_interface, assigned_object_inventory_item=assigned_object_inventory_item, assigned_object_inventory_item_role=assigned_object_inventory_item_role, assigned_object_journal_entry=assigned_object_journal_entry, @@ -4480,6 +4466,8 @@ def __new__( assigned_object_module_bay=assigned_object_module_bay, assigned_object_module_type=assigned_object_module_type, assigned_object_module_type_profile=assigned_object_module_type_profile, + assigned_object_owner=assigned_object_owner, + assigned_object_owner_group=assigned_object_owner_group, assigned_object_platform=assigned_object_platform, assigned_object_power_feed=assigned_object_power_feed, assigned_object_power_outlet=assigned_object_power_outlet, @@ -4507,9 +4495,11 @@ def __new__( assigned_object_tunnel=assigned_object_tunnel, assigned_object_tunnel_group=assigned_object_tunnel_group, assigned_object_tunnel_termination=assigned_object_tunnel_termination, + assigned_object_vlan=assigned_object_vlan, assigned_object_vlan_group=assigned_object_vlan_group, assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, + assigned_object_vm_interface=assigned_object_vm_interface, assigned_object_vrf=assigned_object_vrf, assigned_object_virtual_chassis=assigned_object_virtual_chassis, assigned_object_virtual_circuit=assigned_object_virtual_circuit, @@ -4521,9 +4511,8 @@ def __new__( assigned_object_wireless_lan=assigned_object_wireless_lan, assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, assigned_object_wireless_link=assigned_object_wireless_link, - assigned_object_custom_link=assigned_object_custom_link, - assigned_object_owner=assigned_object_owner, - assigned_object_owner_group=assigned_object_owner_group, + kind=kind, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, @@ -4531,1911 +4520,1007 @@ def __new__( return result -class Location: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Location.""" +class L2VPN: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPN.""" def __new__( cls, + identifier: int | None = None, name: str | None = None, slug: str | None = None, - site: str | Site | pb.Site | None = None, - parent: str | Location | pb.Location | None = None, + type: str | None = None, status: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - facility: str | None = None, + import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, + export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - comments: str | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Location: - """Create a new Location.""" - site = convert_to_protobuf(site, pb.Site) - parent = convert_to_protobuf(parent, pb.Location) + ) -> pb.L2VPN: + """Create a new L2VPN.""" + import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) + export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) + owner = convert_to_protobuf(owner, pb.Owner) tenant = convert_to_protobuf(tenant, pb.Tenant) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Location( + result = pb.L2VPN( + identifier=identifier, name=name, slug=slug, - site=site, - parent=parent, + type=type, status=status, - tenant=tenant, - facility=facility, + import_targets=import_targets, + export_targets=export_targets, description=description, + owner=owner, + comments=comments, + tenant=tenant, tags=tags, custom_fields=custom_fields, - comments=comments, metadata=metadata, - owner=owner, ) return result -class MACAddress: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.MACAddress.""" +class L2VPNTermination: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPNTermination.""" def __new__( cls, - mac_address: str | None = None, - assigned_object_interface: str | Interface | pb.Interface | None = None, - assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + l2vpn: str | L2VPN | pb.L2VPN | None = None, + assigned_object_asn: str | ASN | pb.ASN | None = None, + assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, + assigned_object_aggregate: str | Aggregate | pb.Aggregate | None = None, + assigned_object_cable: str | Cable | pb.Cable | None = None, + assigned_object_cable_path: str | CablePath | pb.CablePath | None = None, + assigned_object_cable_termination: ( + str | CableTermination | pb.CableTermination | None ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.MACAddress: - """Create a new MACAddress.""" - assigned_object_interface = convert_to_protobuf( - assigned_object_interface, pb.Interface - ) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface - ) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.MACAddress( - mac_address=mac_address, - assigned_object_interface=assigned_object_interface, - assigned_object_vm_interface=assigned_object_vm_interface, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class Manufacturer: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Manufacturer.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + assigned_object_circuit: str | Circuit | pb.Circuit | None = None, + assigned_object_circuit_group: ( + str | CircuitGroup | pb.CircuitGroup | None + ) = None, + assigned_object_circuit_group_assignment: ( + str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + ) = None, + assigned_object_circuit_termination: ( + str | CircuitTermination | pb.CircuitTermination | None + ) = None, + assigned_object_circuit_type: str | CircuitType | pb.CircuitType | None = None, + assigned_object_cluster: str | Cluster | pb.Cluster | None = None, + assigned_object_cluster_group: ( + str | ClusterGroup | pb.ClusterGroup | None + ) = None, + assigned_object_cluster_type: str | ClusterType | pb.ClusterType | None = None, + assigned_object_console_port: str | ConsolePort | pb.ConsolePort | None = None, + assigned_object_console_server_port: ( + str | ConsoleServerPort | pb.ConsoleServerPort | None + ) = None, + assigned_object_contact: str | Contact | pb.Contact | None = None, + assigned_object_contact_assignment: ( + str | ContactAssignment | pb.ContactAssignment | None + ) = None, + assigned_object_contact_group: ( + str | ContactGroup | pb.ContactGroup | None + ) = None, + assigned_object_contact_role: str | ContactRole | pb.ContactRole | None = None, + assigned_object_custom_field: str | CustomField | pb.CustomField | None = None, + assigned_object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, + assigned_object_device: str | Device | pb.Device | None = None, + assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, + assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, + assigned_object_device_type: str | DeviceType | pb.DeviceType | None = None, + assigned_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, + assigned_object_fhrp_group_assignment: ( + str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + ) = None, + assigned_object_front_port: str | FrontPort | pb.FrontPort | None = None, + assigned_object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, + assigned_object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, + assigned_object_ip_address: str | IPAddress | pb.IPAddress | None = None, + assigned_object_ip_range: str | IPRange | pb.IPRange | None = None, + assigned_object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, + assigned_object_ip_sec_profile: ( + str | IPSecProfile | pb.IPSecProfile | None + ) = None, + assigned_object_ip_sec_proposal: ( + str | IPSecProposal | pb.IPSecProposal | None + ) = None, + assigned_object_interface: str | Interface | pb.Interface | None = None, + assigned_object_inventory_item: ( + str | InventoryItem | pb.InventoryItem | None + ) = None, + assigned_object_inventory_item_role: ( + str | InventoryItemRole | pb.InventoryItemRole | None + ) = None, + assigned_object_journal_entry: ( + str | JournalEntry | pb.JournalEntry | None + ) = None, + assigned_object_l2vpn: str | L2VPN | pb.L2VPN | None = None, + assigned_object_l2vpn_termination: ( + str | L2VPNTermination | pb.L2VPNTermination | None + ) = None, + assigned_object_location: str | Location | pb.Location | None = None, + assigned_object_mac_address: str | MACAddress | pb.MACAddress | None = None, + assigned_object_manufacturer: ( + str | Manufacturer | pb.Manufacturer | None + ) = None, + assigned_object_module: str | Module | pb.Module | None = None, + assigned_object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, + assigned_object_module_type: str | ModuleType | pb.ModuleType | None = None, + assigned_object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + assigned_object_owner: str | Owner | pb.Owner | None = None, + assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + assigned_object_platform: str | Platform | pb.Platform | None = None, + assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, + assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, + assigned_object_power_panel: str | PowerPanel | pb.PowerPanel | None = None, + assigned_object_power_port: str | PowerPort | pb.PowerPort | None = None, + assigned_object_prefix: str | Prefix | pb.Prefix | None = None, + assigned_object_provider: str | Provider | pb.Provider | None = None, + assigned_object_provider_account: ( + str | ProviderAccount | pb.ProviderAccount | None + ) = None, + assigned_object_provider_network: ( + str | ProviderNetwork | pb.ProviderNetwork | None + ) = None, + assigned_object_rir: str | RIR | pb.RIR | None = None, + assigned_object_rack: str | Rack | pb.Rack | None = None, + assigned_object_rack_reservation: ( + str | RackReservation | pb.RackReservation | None + ) = None, + assigned_object_rack_role: str | RackRole | pb.RackRole | None = None, + assigned_object_rack_type: str | RackType | pb.RackType | None = None, + assigned_object_rear_port: str | RearPort | pb.RearPort | None = None, + assigned_object_region: str | Region | pb.Region | None = None, + assigned_object_role: str | Role | pb.Role | None = None, + assigned_object_route_target: str | RouteTarget | pb.RouteTarget | None = None, + assigned_object_service: str | Service | pb.Service | None = None, + assigned_object_site: str | Site | pb.Site | None = None, + assigned_object_site_group: str | SiteGroup | pb.SiteGroup | None = None, + assigned_object_tag: str | Tag | pb.Tag | None = None, + assigned_object_tenant: str | Tenant | pb.Tenant | None = None, + assigned_object_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, + assigned_object_tunnel: str | Tunnel | pb.Tunnel | None = None, + assigned_object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, + assigned_object_tunnel_termination: ( + str | TunnelTermination | pb.TunnelTermination | None + ) = None, + assigned_object_vlan: str | VLAN | pb.VLAN | None = None, + assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, + assigned_object_vlan_translation_policy: ( + str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None + ) = None, + assigned_object_vlan_translation_rule: ( + str | VLANTranslationRule | pb.VLANTranslationRule | None + ) = None, + assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, + assigned_object_vrf: str | VRF | pb.VRF | None = None, + assigned_object_virtual_chassis: ( + str | VirtualChassis | pb.VirtualChassis | None + ) = None, + assigned_object_virtual_circuit: ( + str | VirtualCircuit | pb.VirtualCircuit | None + ) = None, + assigned_object_virtual_circuit_termination: ( + str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + ) = None, + assigned_object_virtual_circuit_type: ( + str | VirtualCircuitType | pb.VirtualCircuitType | None + ) = None, + assigned_object_virtual_device_context: ( + str | VirtualDeviceContext | pb.VirtualDeviceContext | None + ) = None, + assigned_object_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, + assigned_object_virtual_machine: ( + str | VirtualMachine | pb.VirtualMachine | None + ) = None, + assigned_object_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, + assigned_object_wireless_lan_group: ( + str | WirelessLANGroup | pb.WirelessLANGroup | None + ) = None, + assigned_object_wireless_link: ( + str | WirelessLink | pb.WirelessLink | None ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.Manufacturer: - """Create a new Manufacturer.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Manufacturer( - name=name, - slug=slug, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - comments=comments, - ) - return result - - -class Module: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Module.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - module_bay: str | ModuleBay | pb.ModuleBay | None = None, - module_type: str | ModuleType | pb.ModuleType | None = None, - status: str | None = None, - serial: str | None = None, - asset_tag: str | None = None, - description: str | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Module: - """Create a new Module.""" - device = convert_to_protobuf(device, pb.Device) - module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) - module_type = convert_to_protobuf(module_type, pb.ModuleType) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Module( - device=device, - module_bay=module_bay, - module_type=module_type, - status=status, - serial=serial, - asset_tag=asset_tag, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class ModuleBay: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleBay.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, - name: str | None = None, - installed_module: str | Module | pb.Module | None = None, - label: str | None = None, - position: str | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.ModuleBay: - """Create a new ModuleBay.""" - device = convert_to_protobuf(device, pb.Device) - module = convert_to_protobuf(module, pb.Module) - installed_module = convert_to_protobuf(installed_module, pb.Module) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.ModuleBay( - device=device, - module=module, - name=name, - installed_module=installed_module, - label=label, - position=position, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class ModuleType: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleType.""" - - def __new__( - cls, - manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - model: str | None = None, - part_number: str | None = None, - airflow: str | None = None, - weight: float | None = None, - weight_unit: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - profile: str | ModuleTypeProfile | pb.ModuleTypeProfile | None = None, - attributes: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.ModuleType: - """Create a new ModuleType.""" - manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - profile = convert_to_protobuf(profile, pb.ModuleTypeProfile) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.ModuleType( - manufacturer=manufacturer, - model=model, - part_number=part_number, - airflow=airflow, - weight=weight, - weight_unit=weight_unit, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - profile=profile, - attributes=attributes, - metadata=metadata, - owner=owner, - ) - return result - - -class Platform: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Platform.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - parent: str | Platform | pb.Platform | None = None, - comments: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Platform: - """Create a new Platform.""" - manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - parent = convert_to_protobuf(parent, pb.Platform) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Platform( - name=name, - slug=slug, - manufacturer=manufacturer, - description=description, - tags=tags, - custom_fields=custom_fields, - parent=parent, - comments=comments, - metadata=metadata, - owner=owner, - ) - return result - - -class PowerFeed: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerFeed.""" - - def __new__( - cls, - power_panel: str | PowerPanel | pb.PowerPanel | None = None, - rack: str | Rack | pb.Rack | None = None, - name: str | None = None, - status: str | None = None, - type: str | None = None, - supply: str | None = None, - phase: str | None = None, - voltage: int | None = None, - amperage: int | None = None, - max_utilization: int | None = None, - mark_connected: bool | None = None, - description: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.PowerFeed: - """Create a new PowerFeed.""" - power_panel = convert_to_protobuf(power_panel, pb.PowerPanel) - rack = convert_to_protobuf(rack, pb.Rack) - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.PowerFeed( - power_panel=power_panel, - rack=rack, - name=name, - status=status, - type=type, - supply=supply, - phase=phase, - voltage=voltage, - amperage=amperage, - max_utilization=max_utilization, - mark_connected=mark_connected, - description=description, - tenant=tenant, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class PowerOutlet: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerOutlet.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, - name: str | None = None, - label: str | None = None, - type: str | None = None, - color: str | None = None, - power_port: str | PowerPort | pb.PowerPort | None = None, - feed_leg: str | None = None, - description: str | None = None, - mark_connected: bool | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - status: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.PowerOutlet: - """Create a new PowerOutlet.""" - device = convert_to_protobuf(device, pb.Device) - module = convert_to_protobuf(module, pb.Module) - power_port = convert_to_protobuf(power_port, pb.PowerPort) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.PowerOutlet( - device=device, - module=module, - name=name, - label=label, - type=type, - color=color, - power_port=power_port, - feed_leg=feed_leg, - description=description, - mark_connected=mark_connected, - tags=tags, - custom_fields=custom_fields, - status=status, - metadata=metadata, - owner=owner, - ) - return result - - -class PowerPanel: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerPanel.""" - - def __new__( - cls, - site: str | Site | pb.Site | None = None, - location: str | Location | pb.Location | None = None, - name: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.PowerPanel: - """Create a new PowerPanel.""" - site = convert_to_protobuf(site, pb.Site) - location = convert_to_protobuf(location, pb.Location) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.PowerPanel( - site=site, - location=location, - name=name, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class PowerPort: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerPort.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, - name: str | None = None, - label: str | None = None, - type: str | None = None, - maximum_draw: int | None = None, - allocated_draw: int | None = None, - description: str | None = None, - mark_connected: bool | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.PowerPort: - """Create a new PowerPort.""" - device = convert_to_protobuf(device, pb.Device) - module = convert_to_protobuf(module, pb.Module) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.PowerPort( - device=device, - module=module, - name=name, - label=label, - type=type, - maximum_draw=maximum_draw, - allocated_draw=allocated_draw, - description=description, - mark_connected=mark_connected, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class Prefix: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Prefix.""" - - def __new__( - cls, - prefix: str | None = None, - vrf: str | VRF | pb.VRF | None = None, - scope_location: str | Location | pb.Location | None = None, - scope_region: str | Region | pb.Region | None = None, - scope_site: str | Site | pb.Site | None = None, - scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - vlan: str | VLAN | pb.VLAN | None = None, - status: str | None = None, - role: str | Role | pb.Role | None = None, - is_pool: bool | None = None, - mark_utilized: bool | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Prefix: - """Create a new Prefix.""" - vrf = convert_to_protobuf(vrf, pb.VRF) - scope_location = convert_to_protobuf(scope_location, pb.Location) - scope_region = convert_to_protobuf(scope_region, pb.Region) - scope_site = convert_to_protobuf(scope_site, pb.Site) - scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) - tenant = convert_to_protobuf(tenant, pb.Tenant) - vlan = convert_to_protobuf(vlan, pb.VLAN) - role = convert_to_protobuf(role, pb.Role) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Prefix( - prefix=prefix, - vrf=vrf, - scope_location=scope_location, - scope_region=scope_region, - scope_site=scope_site, - scope_site_group=scope_site_group, - tenant=tenant, - vlan=vlan, - status=status, - role=role, - is_pool=is_pool, - mark_utilized=mark_utilized, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class Provider: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Provider.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - accounts: list[str | ProviderAccount | pb.ProviderAccount] | None = None, - asns: list[str | ASN | pb.ASN] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Provider: - """Create a new Provider.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - accounts = convert_to_protobuf_list(accounts, pb.ProviderAccount) - asns = convert_to_protobuf_list(asns, pb.ASN) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Provider( - name=name, - slug=slug, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - accounts=accounts, - asns=asns, - metadata=metadata, - owner=owner, - ) - return result - - -class ProviderAccount: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ProviderAccount.""" - - def __new__( - cls, - provider: str | Provider | pb.Provider | None = None, - name: str | None = None, - account: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.ProviderAccount: - """Create a new ProviderAccount.""" - provider = convert_to_protobuf(provider, pb.Provider) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.ProviderAccount( - provider=provider, - name=name, - account=account, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class ProviderNetwork: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ProviderNetwork.""" - - def __new__( - cls, - provider: str | Provider | pb.Provider | None = None, - name: str | None = None, - service_id: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.ProviderNetwork: - """Create a new ProviderNetwork.""" - provider = convert_to_protobuf(provider, pb.Provider) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.ProviderNetwork( - provider=provider, - name=name, - service_id=service_id, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class RIR: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RIR.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - is_private: bool | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.RIR: - """Create a new RIR.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RIR( - name=name, - slug=slug, - is_private=is_private, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - comments=comments, - ) - return result - - -class Rack: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Rack.""" - - def __new__( - cls, - name: str | None = None, - facility_id: str | None = None, - site: str | Site | pb.Site | None = None, - location: str | Location | pb.Location | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - status: str | None = None, - role: str | RackRole | pb.RackRole | None = None, - serial: str | None = None, - asset_tag: str | None = None, - rack_type: str | RackType | pb.RackType | None = None, - form_factor: str | None = None, - width: int | None = None, - u_height: int | None = None, - starting_unit: int | None = None, - weight: float | None = None, - max_weight: int | None = None, - weight_unit: str | None = None, - desc_units: bool | None = None, - outer_width: int | None = None, - outer_depth: int | None = None, - outer_unit: str | None = None, - mounting_depth: int | None = None, - airflow: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - outer_height: int | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Rack: - """Create a new Rack.""" - site = convert_to_protobuf(site, pb.Site) - location = convert_to_protobuf(location, pb.Location) - tenant = convert_to_protobuf(tenant, pb.Tenant) - role = convert_to_protobuf(role, pb.RackRole) - rack_type = convert_to_protobuf(rack_type, pb.RackType) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Rack( - name=name, - facility_id=facility_id, - site=site, - location=location, - tenant=tenant, - status=status, - role=role, - serial=serial, - asset_tag=asset_tag, - rack_type=rack_type, - form_factor=form_factor, - width=width, - u_height=u_height, - starting_unit=starting_unit, - weight=weight, - max_weight=max_weight, - weight_unit=weight_unit, - desc_units=desc_units, - outer_width=outer_width, - outer_depth=outer_depth, - outer_unit=outer_unit, - mounting_depth=mounting_depth, - airflow=airflow, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - outer_height=outer_height, - metadata=metadata, - owner=owner, - ) - return result - - -class RackReservation: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackReservation.""" - - def __new__( - cls, - rack: str | Rack | pb.Rack | None = None, - units: list[int] | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - status: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.RackReservation: - """Create a new RackReservation.""" - rack = convert_to_protobuf(rack, pb.Rack) - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RackReservation( - rack=rack, - units=units, - tenant=tenant, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - status=status, - metadata=metadata, - owner=owner, - ) - return result - - -class RackRole: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackRole.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - color: str | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.RackRole: - """Create a new RackRole.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RackRole( - name=name, - slug=slug, - color=color, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - comments=comments, - ) - return result - - -class RackType: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackType.""" - - def __new__( - cls, - manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - model: str | None = None, - slug: str | None = None, - description: str | None = None, - form_factor: str | None = None, - width: int | None = None, - u_height: int | None = None, - starting_unit: int | None = None, - desc_units: bool | None = None, - outer_width: int | None = None, - outer_depth: int | None = None, - outer_unit: str | None = None, - weight: float | None = None, - max_weight: int | None = None, - weight_unit: str | None = None, - mounting_depth: int | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - outer_height: int | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.RackType: - """Create a new RackType.""" - manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RackType( - manufacturer=manufacturer, - model=model, - slug=slug, - description=description, - form_factor=form_factor, - width=width, - u_height=u_height, - starting_unit=starting_unit, - desc_units=desc_units, - outer_width=outer_width, - outer_depth=outer_depth, - outer_unit=outer_unit, - weight=weight, - max_weight=max_weight, - weight_unit=weight_unit, - mounting_depth=mounting_depth, - comments=comments, - tags=tags, - custom_fields=custom_fields, - outer_height=outer_height, - metadata=metadata, - owner=owner, - ) - return result - - -class RearPort: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RearPort.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, - name: str | None = None, - label: str | None = None, - type: str | None = None, - color: str | None = None, - positions: int | None = None, - description: str | None = None, - mark_connected: bool | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.RearPort: - """Create a new RearPort.""" - device = convert_to_protobuf(device, pb.Device) - module = convert_to_protobuf(module, pb.Module) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RearPort( - device=device, - module=module, - name=name, - label=label, - type=type, - color=color, - positions=positions, - description=description, - mark_connected=mark_connected, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class Region: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Region.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - parent: str | Region | pb.Region | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - comments: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Region: - """Create a new Region.""" - parent = convert_to_protobuf(parent, pb.Region) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Region( - name=name, - slug=slug, - parent=parent, - description=description, - tags=tags, - custom_fields=custom_fields, - comments=comments, - metadata=metadata, - owner=owner, - ) - return result - - -class Role: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Role.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - weight: int | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.Role: - """Create a new Role.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Role( - name=name, - slug=slug, - weight=weight, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - comments=comments, - ) - return result - - -class RouteTarget: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RouteTarget.""" - - def __new__( - cls, - name: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.RouteTarget: - """Create a new RouteTarget.""" - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RouteTarget( - name=name, - tenant=tenant, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class Service: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Service.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, - name: str | None = None, - protocol: str | None = None, - ports: list[int] | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - ipaddresses: list[str | IPAddress | pb.IPAddress] | None = None, - parent_object_device: str | Device | pb.Device | None = None, - parent_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, - parent_object_virtual_machine: ( - str | VirtualMachine | pb.VirtualMachine | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Service: - """Create a new Service.""" - device = convert_to_protobuf(device, pb.Device) - virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - ipaddresses = convert_to_protobuf_list(ipaddresses, pb.IPAddress) - parent_object_device = convert_to_protobuf(parent_object_device, pb.Device) - parent_object_fhrp_group = convert_to_protobuf( - parent_object_fhrp_group, pb.FHRPGroup - ) - parent_object_virtual_machine = convert_to_protobuf( - parent_object_virtual_machine, pb.VirtualMachine - ) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Service( - device=device, - virtual_machine=virtual_machine, - name=name, - protocol=protocol, - ports=ports, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - ipaddresses=ipaddresses, - parent_object_device=parent_object_device, - parent_object_fhrp_group=parent_object_fhrp_group, - parent_object_virtual_machine=parent_object_virtual_machine, - metadata=metadata, - owner=owner, - ) - return result - - -class Site: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Site.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - status: str | None = None, - region: str | Region | pb.Region | None = None, - group: str | SiteGroup | pb.SiteGroup | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - facility: str | None = None, - time_zone: str | None = None, - description: str | None = None, - physical_address: str | None = None, - shipping_address: str | None = None, - latitude: float | None = None, - longitude: float | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - asns: list[str | ASN | pb.ASN] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Site: - """Create a new Site.""" - region = convert_to_protobuf(region, pb.Region) - group = convert_to_protobuf(group, pb.SiteGroup) - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - asns = convert_to_protobuf_list(asns, pb.ASN) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Site( - name=name, - slug=slug, - status=status, - region=region, - group=group, - tenant=tenant, - facility=facility, - time_zone=time_zone, - description=description, - physical_address=physical_address, - shipping_address=shipping_address, - latitude=latitude, - longitude=longitude, - comments=comments, - tags=tags, - custom_fields=custom_fields, - asns=asns, - metadata=metadata, - owner=owner, - ) - return result - - -class SiteGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.SiteGroup.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - parent: str | SiteGroup | pb.SiteGroup | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - comments: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.SiteGroup: - """Create a new SiteGroup.""" - parent = convert_to_protobuf(parent, pb.SiteGroup) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.SiteGroup( - name=name, - slug=slug, - parent=parent, - description=description, - tags=tags, - custom_fields=custom_fields, - comments=comments, - metadata=metadata, - owner=owner, - ) - return result - - -class Tag: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tag.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - color: str | None = None, - description: str | None = None, - weight: int | None = None, - object_types: list[str] | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.Tag: - """Create a new Tag.""" - metadata = convert_dict_to_struct(metadata) - result = pb.Tag( - name=name, - slug=slug, - color=color, - description=description, - weight=weight, - object_types=object_types, - metadata=metadata, - ) - return result - - -class Tenant: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tenant.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - group: str | TenantGroup | pb.TenantGroup | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Tenant: - """Create a new Tenant.""" - group = convert_to_protobuf(group, pb.TenantGroup) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Tenant( - name=name, - slug=slug, - group=group, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class TenantGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TenantGroup.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - parent: str | TenantGroup | pb.TenantGroup | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - comments: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.TenantGroup: - """Create a new TenantGroup.""" - parent = convert_to_protobuf(parent, pb.TenantGroup) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.TenantGroup( - name=name, - slug=slug, - parent=parent, - description=description, - tags=tags, - custom_fields=custom_fields, - comments=comments, - metadata=metadata, - owner=owner, - ) - return result - - -class Tunnel: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tunnel.""" - - def __new__( - cls, - name: str | None = None, - status: str | None = None, - group: str | TunnelGroup | pb.TunnelGroup | None = None, - encapsulation: str | None = None, - ipsec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - tunnel_id: int | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Tunnel: - """Create a new Tunnel.""" - group = convert_to_protobuf(group, pb.TunnelGroup) - ipsec_profile = convert_to_protobuf(ipsec_profile, pb.IPSecProfile) - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Tunnel( - name=name, - status=status, - group=group, - encapsulation=encapsulation, - ipsec_profile=ipsec_profile, - tenant=tenant, - tunnel_id=tunnel_id, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class TunnelGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TunnelGroup.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.TunnelGroup: - """Create a new TunnelGroup.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.TunnelGroup( - name=name, - slug=slug, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - comments=comments, - ) - return result - - -class TunnelTermination: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TunnelTermination.""" - - def __new__( - cls, - tunnel: str | Tunnel | pb.Tunnel | None = None, - role: str | None = None, - termination_asn: str | ASN | pb.ASN | None = None, - termination_asn_range: str | ASNRange | pb.ASNRange | None = None, - termination_aggregate: str | Aggregate | pb.Aggregate | None = None, - termination_cable: str | Cable | pb.Cable | None = None, - termination_cable_path: str | CablePath | pb.CablePath | None = None, - termination_cable_termination: ( - str | CableTermination | pb.CableTermination | None - ) = None, - termination_circuit: str | Circuit | pb.Circuit | None = None, - termination_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, - termination_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None - ) = None, - termination_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None - ) = None, - termination_circuit_type: str | CircuitType | pb.CircuitType | None = None, - termination_cluster: str | Cluster | pb.Cluster | None = None, - termination_cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, - termination_cluster_type: str | ClusterType | pb.ClusterType | None = None, - termination_console_port: str | ConsolePort | pb.ConsolePort | None = None, - termination_console_server_port: ( - str | ConsoleServerPort | pb.ConsoleServerPort | None - ) = None, - termination_contact: str | Contact | pb.Contact | None = None, - termination_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None - ) = None, - termination_contact_group: str | ContactGroup | pb.ContactGroup | None = None, - termination_contact_role: str | ContactRole | pb.ContactRole | None = None, - termination_device: str | Device | pb.Device | None = None, - termination_device_bay: str | DeviceBay | pb.DeviceBay | None = None, - termination_device_role: str | DeviceRole | pb.DeviceRole | None = None, - termination_device_type: str | DeviceType | pb.DeviceType | None = None, - termination_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, - termination_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None - ) = None, - termination_front_port: str | FrontPort | pb.FrontPort | None = None, - termination_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, - termination_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, - termination_ip_address: str | IPAddress | pb.IPAddress | None = None, - termination_ip_range: str | IPRange | pb.IPRange | None = None, - termination_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, - termination_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, - termination_ip_sec_proposal: ( - str | IPSecProposal | pb.IPSecProposal | None - ) = None, - termination_interface: str | Interface | pb.Interface | None = None, - termination_inventory_item: ( - str | InventoryItem | pb.InventoryItem | None - ) = None, - termination_inventory_item_role: ( - str | InventoryItemRole | pb.InventoryItemRole | None - ) = None, - termination_l2vpn: str | L2VPN | pb.L2VPN | None = None, - termination_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None - ) = None, - termination_location: str | Location | pb.Location | None = None, - termination_mac_address: str | MACAddress | pb.MACAddress | None = None, - termination_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - termination_module: str | Module | pb.Module | None = None, - termination_module_bay: str | ModuleBay | pb.ModuleBay | None = None, - termination_module_type: str | ModuleType | pb.ModuleType | None = None, - termination_platform: str | Platform | pb.Platform | None = None, - termination_power_feed: str | PowerFeed | pb.PowerFeed | None = None, - termination_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, - termination_power_panel: str | PowerPanel | pb.PowerPanel | None = None, - termination_power_port: str | PowerPort | pb.PowerPort | None = None, - termination_prefix: str | Prefix | pb.Prefix | None = None, - termination_provider: str | Provider | pb.Provider | None = None, - termination_provider_account: ( - str | ProviderAccount | pb.ProviderAccount | None - ) = None, - termination_provider_network: ( - str | ProviderNetwork | pb.ProviderNetwork | None - ) = None, - termination_rir: str | RIR | pb.RIR | None = None, - termination_rack: str | Rack | pb.Rack | None = None, - termination_rack_reservation: ( - str | RackReservation | pb.RackReservation | None - ) = None, - termination_rack_role: str | RackRole | pb.RackRole | None = None, - termination_rack_type: str | RackType | pb.RackType | None = None, - termination_rear_port: str | RearPort | pb.RearPort | None = None, - termination_region: str | Region | pb.Region | None = None, - termination_role: str | Role | pb.Role | None = None, - termination_route_target: str | RouteTarget | pb.RouteTarget | None = None, - termination_service: str | Service | pb.Service | None = None, - termination_site: str | Site | pb.Site | None = None, - termination_site_group: str | SiteGroup | pb.SiteGroup | None = None, - termination_tag: str | Tag | pb.Tag | None = None, - termination_tenant: str | Tenant | pb.Tenant | None = None, - termination_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, - termination_tunnel: str | Tunnel | pb.Tunnel | None = None, - termination_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - termination_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None - ) = None, - termination_vlan: str | VLAN | pb.VLAN | None = None, - termination_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, - termination_vlan_translation_policy: ( - str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None - ) = None, - termination_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None - ) = None, - termination_vm_interface: str | VMInterface | pb.VMInterface | None = None, - termination_vrf: str | VRF | pb.VRF | None = None, - termination_virtual_chassis: ( - str | VirtualChassis | pb.VirtualChassis | None - ) = None, - termination_virtual_circuit: ( - str | VirtualCircuit | pb.VirtualCircuit | None - ) = None, - termination_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None - ) = None, - termination_virtual_circuit_type: ( - str | VirtualCircuitType | pb.VirtualCircuitType | None - ) = None, - termination_virtual_device_context: ( - str | VirtualDeviceContext | pb.VirtualDeviceContext | None - ) = None, - termination_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, - termination_virtual_machine: ( - str | VirtualMachine | pb.VirtualMachine | None - ) = None, - termination_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, - termination_wireless_lan_group: ( - str | WirelessLANGroup | pb.WirelessLANGroup | None - ) = None, - termination_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, - termination_custom_field: str | CustomField | pb.CustomField | None = None, - termination_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - termination_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, - termination_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - termination_custom_link: str | CustomLink | pb.CustomLink | None = None, - termination_owner: str | Owner | pb.Owner | None = None, - termination_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, - outside_ip: str | IPAddress | pb.IPAddress | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - ) -> pb.TunnelTermination: - """Create a new TunnelTermination.""" - tunnel = convert_to_protobuf(tunnel, pb.Tunnel) - termination_asn = convert_to_protobuf(termination_asn, pb.ASN) - termination_asn_range = convert_to_protobuf(termination_asn_range, pb.ASNRange) - termination_aggregate = convert_to_protobuf(termination_aggregate, pb.Aggregate) - termination_cable = convert_to_protobuf(termination_cable, pb.Cable) - termination_cable_path = convert_to_protobuf( - termination_cable_path, pb.CablePath + ) -> pb.L2VPNTermination: + """Create a new L2VPNTermination.""" + l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) + assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) + assigned_object_asn_range = convert_to_protobuf( + assigned_object_asn_range, pb.ASNRange ) - termination_cable_termination = convert_to_protobuf( - termination_cable_termination, pb.CableTermination + assigned_object_aggregate = convert_to_protobuf( + assigned_object_aggregate, pb.Aggregate ) - termination_circuit = convert_to_protobuf(termination_circuit, pb.Circuit) - termination_circuit_group = convert_to_protobuf( - termination_circuit_group, pb.CircuitGroup + assigned_object_cable = convert_to_protobuf(assigned_object_cable, pb.Cable) + assigned_object_cable_path = convert_to_protobuf( + assigned_object_cable_path, pb.CablePath ) - termination_circuit_group_assignment = convert_to_protobuf( - termination_circuit_group_assignment, pb.CircuitGroupAssignment + assigned_object_circuit = convert_to_protobuf( + assigned_object_circuit, pb.Circuit ) - termination_circuit_termination = convert_to_protobuf( - termination_circuit_termination, pb.CircuitTermination + assigned_object_circuit_group = convert_to_protobuf( + assigned_object_circuit_group, pb.CircuitGroup ) - termination_circuit_type = convert_to_protobuf( - termination_circuit_type, pb.CircuitType + assigned_object_circuit_group_assignment = convert_to_protobuf( + assigned_object_circuit_group_assignment, pb.CircuitGroupAssignment ) - termination_cluster = convert_to_protobuf(termination_cluster, pb.Cluster) - termination_cluster_group = convert_to_protobuf( - termination_cluster_group, pb.ClusterGroup + assigned_object_circuit_termination = convert_to_protobuf( + assigned_object_circuit_termination, pb.CircuitTermination ) - termination_cluster_type = convert_to_protobuf( - termination_cluster_type, pb.ClusterType + assigned_object_circuit_type = convert_to_protobuf( + assigned_object_circuit_type, pb.CircuitType ) - termination_console_port = convert_to_protobuf( - termination_console_port, pb.ConsolePort + assigned_object_cluster = convert_to_protobuf( + assigned_object_cluster, pb.Cluster ) - termination_console_server_port = convert_to_protobuf( - termination_console_server_port, pb.ConsoleServerPort + assigned_object_cluster_group = convert_to_protobuf( + assigned_object_cluster_group, pb.ClusterGroup ) - termination_contact = convert_to_protobuf(termination_contact, pb.Contact) - termination_contact_assignment = convert_to_protobuf( - termination_contact_assignment, pb.ContactAssignment + assigned_object_cluster_type = convert_to_protobuf( + assigned_object_cluster_type, pb.ClusterType ) - termination_contact_group = convert_to_protobuf( - termination_contact_group, pb.ContactGroup + assigned_object_console_port = convert_to_protobuf( + assigned_object_console_port, pb.ConsolePort ) - termination_contact_role = convert_to_protobuf( - termination_contact_role, pb.ContactRole + assigned_object_console_server_port = convert_to_protobuf( + assigned_object_console_server_port, pb.ConsoleServerPort ) - termination_device = convert_to_protobuf(termination_device, pb.Device) - termination_device_bay = convert_to_protobuf( - termination_device_bay, pb.DeviceBay + assigned_object_contact = convert_to_protobuf( + assigned_object_contact, pb.Contact ) - termination_device_role = convert_to_protobuf( - termination_device_role, pb.DeviceRole + assigned_object_contact_assignment = convert_to_protobuf( + assigned_object_contact_assignment, pb.ContactAssignment ) - termination_device_type = convert_to_protobuf( - termination_device_type, pb.DeviceType + assigned_object_contact_group = convert_to_protobuf( + assigned_object_contact_group, pb.ContactGroup ) - termination_fhrp_group = convert_to_protobuf( - termination_fhrp_group, pb.FHRPGroup + assigned_object_contact_role = convert_to_protobuf( + assigned_object_contact_role, pb.ContactRole ) - termination_fhrp_group_assignment = convert_to_protobuf( - termination_fhrp_group_assignment, pb.FHRPGroupAssignment + assigned_object_custom_field = convert_to_protobuf( + assigned_object_custom_field, pb.CustomField ) - termination_front_port = convert_to_protobuf( - termination_front_port, pb.FrontPort + assigned_object_custom_field_choice_set = convert_to_protobuf( + assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet ) - termination_ike_policy = convert_to_protobuf( - termination_ike_policy, pb.IKEPolicy + assigned_object_custom_link = convert_to_protobuf( + assigned_object_custom_link, pb.CustomLink ) - termination_ike_proposal = convert_to_protobuf( - termination_ike_proposal, pb.IKEProposal + assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) + assigned_object_device_bay = convert_to_protobuf( + assigned_object_device_bay, pb.DeviceBay ) - termination_ip_address = convert_to_protobuf( - termination_ip_address, pb.IPAddress + assigned_object_device_role = convert_to_protobuf( + assigned_object_device_role, pb.DeviceRole ) - termination_ip_range = convert_to_protobuf(termination_ip_range, pb.IPRange) - termination_ip_sec_policy = convert_to_protobuf( - termination_ip_sec_policy, pb.IPSecPolicy + assigned_object_device_type = convert_to_protobuf( + assigned_object_device_type, pb.DeviceType ) - termination_ip_sec_profile = convert_to_protobuf( - termination_ip_sec_profile, pb.IPSecProfile + assigned_object_fhrp_group = convert_to_protobuf( + assigned_object_fhrp_group, pb.FHRPGroup ) - termination_ip_sec_proposal = convert_to_protobuf( - termination_ip_sec_proposal, pb.IPSecProposal + assigned_object_fhrp_group_assignment = convert_to_protobuf( + assigned_object_fhrp_group_assignment, pb.FHRPGroupAssignment ) - termination_interface = convert_to_protobuf(termination_interface, pb.Interface) - termination_inventory_item = convert_to_protobuf( - termination_inventory_item, pb.InventoryItem + assigned_object_front_port = convert_to_protobuf( + assigned_object_front_port, pb.FrontPort ) - termination_inventory_item_role = convert_to_protobuf( - termination_inventory_item_role, pb.InventoryItemRole + assigned_object_ike_policy = convert_to_protobuf( + assigned_object_ike_policy, pb.IKEPolicy + ) + assigned_object_ike_proposal = convert_to_protobuf( + assigned_object_ike_proposal, pb.IKEProposal + ) + assigned_object_ip_address = convert_to_protobuf( + assigned_object_ip_address, pb.IPAddress + ) + assigned_object_ip_range = convert_to_protobuf( + assigned_object_ip_range, pb.IPRange + ) + assigned_object_ip_sec_policy = convert_to_protobuf( + assigned_object_ip_sec_policy, pb.IPSecPolicy + ) + assigned_object_ip_sec_profile = convert_to_protobuf( + assigned_object_ip_sec_profile, pb.IPSecProfile + ) + assigned_object_ip_sec_proposal = convert_to_protobuf( + assigned_object_ip_sec_proposal, pb.IPSecProposal + ) + assigned_object_interface = convert_to_protobuf( + assigned_object_interface, pb.Interface + ) + assigned_object_inventory_item = convert_to_protobuf( + assigned_object_inventory_item, pb.InventoryItem + ) + assigned_object_inventory_item_role = convert_to_protobuf( + assigned_object_inventory_item_role, pb.InventoryItemRole + ) + assigned_object_journal_entry = convert_to_protobuf( + assigned_object_journal_entry, pb.JournalEntry + ) + assigned_object_l2vpn = convert_to_protobuf(assigned_object_l2vpn, pb.L2VPN) + assigned_object_l2vpn_termination = convert_to_protobuf( + assigned_object_l2vpn_termination, pb.L2VPNTermination + ) + assigned_object_location = convert_to_protobuf( + assigned_object_location, pb.Location + ) + assigned_object_mac_address = convert_to_protobuf( + assigned_object_mac_address, pb.MACAddress + ) + assigned_object_manufacturer = convert_to_protobuf( + assigned_object_manufacturer, pb.Manufacturer + ) + assigned_object_module = convert_to_protobuf(assigned_object_module, pb.Module) + assigned_object_module_bay = convert_to_protobuf( + assigned_object_module_bay, pb.ModuleBay + ) + assigned_object_module_type = convert_to_protobuf( + assigned_object_module_type, pb.ModuleType + ) + assigned_object_module_type_profile = convert_to_protobuf( + assigned_object_module_type_profile, pb.ModuleTypeProfile + ) + assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) + assigned_object_owner_group = convert_to_protobuf( + assigned_object_owner_group, pb.OwnerGroup + ) + assigned_object_platform = convert_to_protobuf( + assigned_object_platform, pb.Platform + ) + assigned_object_power_feed = convert_to_protobuf( + assigned_object_power_feed, pb.PowerFeed + ) + assigned_object_power_outlet = convert_to_protobuf( + assigned_object_power_outlet, pb.PowerOutlet + ) + assigned_object_power_panel = convert_to_protobuf( + assigned_object_power_panel, pb.PowerPanel + ) + assigned_object_power_port = convert_to_protobuf( + assigned_object_power_port, pb.PowerPort + ) + assigned_object_prefix = convert_to_protobuf(assigned_object_prefix, pb.Prefix) + assigned_object_provider = convert_to_protobuf( + assigned_object_provider, pb.Provider + ) + assigned_object_provider_account = convert_to_protobuf( + assigned_object_provider_account, pb.ProviderAccount + ) + assigned_object_provider_network = convert_to_protobuf( + assigned_object_provider_network, pb.ProviderNetwork ) - termination_l2vpn = convert_to_protobuf(termination_l2vpn, pb.L2VPN) - termination_l2vpn_termination = convert_to_protobuf( - termination_l2vpn_termination, pb.L2VPNTermination + assigned_object_rir = convert_to_protobuf(assigned_object_rir, pb.RIR) + assigned_object_rack = convert_to_protobuf(assigned_object_rack, pb.Rack) + assigned_object_rack_reservation = convert_to_protobuf( + assigned_object_rack_reservation, pb.RackReservation ) - termination_location = convert_to_protobuf(termination_location, pb.Location) - termination_mac_address = convert_to_protobuf( - termination_mac_address, pb.MACAddress + assigned_object_rack_role = convert_to_protobuf( + assigned_object_rack_role, pb.RackRole ) - termination_manufacturer = convert_to_protobuf( - termination_manufacturer, pb.Manufacturer + assigned_object_rack_type = convert_to_protobuf( + assigned_object_rack_type, pb.RackType ) - termination_module = convert_to_protobuf(termination_module, pb.Module) - termination_module_bay = convert_to_protobuf( - termination_module_bay, pb.ModuleBay + assigned_object_rear_port = convert_to_protobuf( + assigned_object_rear_port, pb.RearPort ) - termination_module_type = convert_to_protobuf( - termination_module_type, pb.ModuleType + assigned_object_region = convert_to_protobuf(assigned_object_region, pb.Region) + assigned_object_role = convert_to_protobuf(assigned_object_role, pb.Role) + assigned_object_route_target = convert_to_protobuf( + assigned_object_route_target, pb.RouteTarget ) - termination_platform = convert_to_protobuf(termination_platform, pb.Platform) - termination_power_feed = convert_to_protobuf( - termination_power_feed, pb.PowerFeed + assigned_object_service = convert_to_protobuf( + assigned_object_service, pb.Service ) - termination_power_outlet = convert_to_protobuf( - termination_power_outlet, pb.PowerOutlet + assigned_object_site = convert_to_protobuf(assigned_object_site, pb.Site) + assigned_object_site_group = convert_to_protobuf( + assigned_object_site_group, pb.SiteGroup ) - termination_power_panel = convert_to_protobuf( - termination_power_panel, pb.PowerPanel + assigned_object_tag = convert_to_protobuf(assigned_object_tag, pb.Tag) + assigned_object_tenant = convert_to_protobuf(assigned_object_tenant, pb.Tenant) + assigned_object_tenant_group = convert_to_protobuf( + assigned_object_tenant_group, pb.TenantGroup ) - termination_power_port = convert_to_protobuf( - termination_power_port, pb.PowerPort + assigned_object_tunnel = convert_to_protobuf(assigned_object_tunnel, pb.Tunnel) + assigned_object_tunnel_group = convert_to_protobuf( + assigned_object_tunnel_group, pb.TunnelGroup ) - termination_prefix = convert_to_protobuf(termination_prefix, pb.Prefix) - termination_provider = convert_to_protobuf(termination_provider, pb.Provider) - termination_provider_account = convert_to_protobuf( - termination_provider_account, pb.ProviderAccount + assigned_object_tunnel_termination = convert_to_protobuf( + assigned_object_tunnel_termination, pb.TunnelTermination ) - termination_provider_network = convert_to_protobuf( - termination_provider_network, pb.ProviderNetwork + assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) + assigned_object_vlan_group = convert_to_protobuf( + assigned_object_vlan_group, pb.VLANGroup ) - termination_rir = convert_to_protobuf(termination_rir, pb.RIR) - termination_rack = convert_to_protobuf(termination_rack, pb.Rack) - termination_rack_reservation = convert_to_protobuf( - termination_rack_reservation, pb.RackReservation + assigned_object_vlan_translation_policy = convert_to_protobuf( + assigned_object_vlan_translation_policy, pb.VLANTranslationPolicy ) - termination_rack_role = convert_to_protobuf(termination_rack_role, pb.RackRole) - termination_rack_type = convert_to_protobuf(termination_rack_type, pb.RackType) - termination_rear_port = convert_to_protobuf(termination_rear_port, pb.RearPort) - termination_region = convert_to_protobuf(termination_region, pb.Region) - termination_role = convert_to_protobuf(termination_role, pb.Role) - termination_route_target = convert_to_protobuf( - termination_route_target, pb.RouteTarget + assigned_object_vlan_translation_rule = convert_to_protobuf( + assigned_object_vlan_translation_rule, pb.VLANTranslationRule ) - termination_service = convert_to_protobuf(termination_service, pb.Service) - termination_site = convert_to_protobuf(termination_site, pb.Site) - termination_site_group = convert_to_protobuf( - termination_site_group, pb.SiteGroup + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface ) - termination_tag = convert_to_protobuf(termination_tag, pb.Tag) - termination_tenant = convert_to_protobuf(termination_tenant, pb.Tenant) - termination_tenant_group = convert_to_protobuf( - termination_tenant_group, pb.TenantGroup + assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) + assigned_object_virtual_chassis = convert_to_protobuf( + assigned_object_virtual_chassis, pb.VirtualChassis ) - termination_tunnel = convert_to_protobuf(termination_tunnel, pb.Tunnel) - termination_tunnel_group = convert_to_protobuf( - termination_tunnel_group, pb.TunnelGroup + assigned_object_virtual_circuit = convert_to_protobuf( + assigned_object_virtual_circuit, pb.VirtualCircuit ) - termination_tunnel_termination = convert_to_protobuf( - termination_tunnel_termination, pb.TunnelTermination + assigned_object_virtual_circuit_termination = convert_to_protobuf( + assigned_object_virtual_circuit_termination, pb.VirtualCircuitTermination ) - termination_vlan = convert_to_protobuf(termination_vlan, pb.VLAN) - termination_vlan_group = convert_to_protobuf( - termination_vlan_group, pb.VLANGroup + assigned_object_virtual_circuit_type = convert_to_protobuf( + assigned_object_virtual_circuit_type, pb.VirtualCircuitType ) - termination_vlan_translation_policy = convert_to_protobuf( - termination_vlan_translation_policy, pb.VLANTranslationPolicy + assigned_object_virtual_device_context = convert_to_protobuf( + assigned_object_virtual_device_context, pb.VirtualDeviceContext ) - termination_vlan_translation_rule = convert_to_protobuf( - termination_vlan_translation_rule, pb.VLANTranslationRule + assigned_object_virtual_disk = convert_to_protobuf( + assigned_object_virtual_disk, pb.VirtualDisk ) - termination_vm_interface = convert_to_protobuf( - termination_vm_interface, pb.VMInterface + assigned_object_virtual_machine = convert_to_protobuf( + assigned_object_virtual_machine, pb.VirtualMachine ) - termination_vrf = convert_to_protobuf(termination_vrf, pb.VRF) - termination_virtual_chassis = convert_to_protobuf( - termination_virtual_chassis, pb.VirtualChassis + assigned_object_wireless_lan = convert_to_protobuf( + assigned_object_wireless_lan, pb.WirelessLAN ) - termination_virtual_circuit = convert_to_protobuf( - termination_virtual_circuit, pb.VirtualCircuit + assigned_object_wireless_lan_group = convert_to_protobuf( + assigned_object_wireless_lan_group, pb.WirelessLANGroup ) - termination_virtual_circuit_termination = convert_to_protobuf( - termination_virtual_circuit_termination, pb.VirtualCircuitTermination + assigned_object_wireless_link = convert_to_protobuf( + assigned_object_wireless_link, pb.WirelessLink ) - termination_virtual_circuit_type = convert_to_protobuf( - termination_virtual_circuit_type, pb.VirtualCircuitType + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.L2VPNTermination( + l2vpn=l2vpn, + assigned_object_asn=assigned_object_asn, + assigned_object_asn_range=assigned_object_asn_range, + assigned_object_aggregate=assigned_object_aggregate, + assigned_object_cable=assigned_object_cable, + assigned_object_cable_path=assigned_object_cable_path, + assigned_object_cable_termination=assigned_object_cable_termination, + assigned_object_circuit=assigned_object_circuit, + assigned_object_circuit_group=assigned_object_circuit_group, + assigned_object_circuit_group_assignment=assigned_object_circuit_group_assignment, + assigned_object_circuit_termination=assigned_object_circuit_termination, + assigned_object_circuit_type=assigned_object_circuit_type, + assigned_object_cluster=assigned_object_cluster, + assigned_object_cluster_group=assigned_object_cluster_group, + assigned_object_cluster_type=assigned_object_cluster_type, + assigned_object_console_port=assigned_object_console_port, + assigned_object_console_server_port=assigned_object_console_server_port, + assigned_object_contact=assigned_object_contact, + assigned_object_contact_assignment=assigned_object_contact_assignment, + assigned_object_contact_group=assigned_object_contact_group, + assigned_object_contact_role=assigned_object_contact_role, + assigned_object_custom_field=assigned_object_custom_field, + assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, + assigned_object_custom_link=assigned_object_custom_link, + assigned_object_device=assigned_object_device, + assigned_object_device_bay=assigned_object_device_bay, + assigned_object_device_role=assigned_object_device_role, + assigned_object_device_type=assigned_object_device_type, + assigned_object_fhrp_group=assigned_object_fhrp_group, + assigned_object_fhrp_group_assignment=assigned_object_fhrp_group_assignment, + assigned_object_front_port=assigned_object_front_port, + assigned_object_ike_policy=assigned_object_ike_policy, + assigned_object_ike_proposal=assigned_object_ike_proposal, + assigned_object_ip_address=assigned_object_ip_address, + assigned_object_ip_range=assigned_object_ip_range, + assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, + assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, + assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, + assigned_object_interface=assigned_object_interface, + assigned_object_inventory_item=assigned_object_inventory_item, + assigned_object_inventory_item_role=assigned_object_inventory_item_role, + assigned_object_journal_entry=assigned_object_journal_entry, + assigned_object_l2vpn=assigned_object_l2vpn, + assigned_object_l2vpn_termination=assigned_object_l2vpn_termination, + assigned_object_location=assigned_object_location, + assigned_object_mac_address=assigned_object_mac_address, + assigned_object_manufacturer=assigned_object_manufacturer, + assigned_object_module=assigned_object_module, + assigned_object_module_bay=assigned_object_module_bay, + assigned_object_module_type=assigned_object_module_type, + assigned_object_module_type_profile=assigned_object_module_type_profile, + assigned_object_owner=assigned_object_owner, + assigned_object_owner_group=assigned_object_owner_group, + assigned_object_platform=assigned_object_platform, + assigned_object_power_feed=assigned_object_power_feed, + assigned_object_power_outlet=assigned_object_power_outlet, + assigned_object_power_panel=assigned_object_power_panel, + assigned_object_power_port=assigned_object_power_port, + assigned_object_prefix=assigned_object_prefix, + assigned_object_provider=assigned_object_provider, + assigned_object_provider_account=assigned_object_provider_account, + assigned_object_provider_network=assigned_object_provider_network, + assigned_object_rir=assigned_object_rir, + assigned_object_rack=assigned_object_rack, + assigned_object_rack_reservation=assigned_object_rack_reservation, + assigned_object_rack_role=assigned_object_rack_role, + assigned_object_rack_type=assigned_object_rack_type, + assigned_object_rear_port=assigned_object_rear_port, + assigned_object_region=assigned_object_region, + assigned_object_role=assigned_object_role, + assigned_object_route_target=assigned_object_route_target, + assigned_object_service=assigned_object_service, + assigned_object_site=assigned_object_site, + assigned_object_site_group=assigned_object_site_group, + assigned_object_tag=assigned_object_tag, + assigned_object_tenant=assigned_object_tenant, + assigned_object_tenant_group=assigned_object_tenant_group, + assigned_object_tunnel=assigned_object_tunnel, + assigned_object_tunnel_group=assigned_object_tunnel_group, + assigned_object_tunnel_termination=assigned_object_tunnel_termination, + assigned_object_vlan=assigned_object_vlan, + assigned_object_vlan_group=assigned_object_vlan_group, + assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, + assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, + assigned_object_vm_interface=assigned_object_vm_interface, + assigned_object_vrf=assigned_object_vrf, + assigned_object_virtual_chassis=assigned_object_virtual_chassis, + assigned_object_virtual_circuit=assigned_object_virtual_circuit, + assigned_object_virtual_circuit_termination=assigned_object_virtual_circuit_termination, + assigned_object_virtual_circuit_type=assigned_object_virtual_circuit_type, + assigned_object_virtual_device_context=assigned_object_virtual_device_context, + assigned_object_virtual_disk=assigned_object_virtual_disk, + assigned_object_virtual_machine=assigned_object_virtual_machine, + assigned_object_wireless_lan=assigned_object_wireless_lan, + assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, + assigned_object_wireless_link=assigned_object_wireless_link, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_virtual_device_context = convert_to_protobuf( - termination_virtual_device_context, pb.VirtualDeviceContext + return result + + +class Location: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Location.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + site: str | Site | pb.Site | None = None, + parent: str | Location | pb.Location | None = None, + status: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + facility: str | None = None, + description: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Location: + """Create a new Location.""" + site = convert_to_protobuf(site, pb.Site) + parent = convert_to_protobuf(parent, pb.Location) + tenant = convert_to_protobuf(tenant, pb.Tenant) + tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Location( + name=name, + slug=slug, + site=site, + parent=parent, + status=status, + tenant=tenant, + facility=facility, + description=description, + tags=tags, + owner=owner, + comments=comments, + custom_fields=custom_fields, + metadata=metadata, ) - termination_virtual_disk = convert_to_protobuf( - termination_virtual_disk, pb.VirtualDisk + return result + + +class MACAddress: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.MACAddress.""" + + def __new__( + cls, + mac_address: str | None = None, + assigned_object_interface: str | Interface | pb.Interface | None = None, + assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.MACAddress: + """Create a new MACAddress.""" + assigned_object_interface = convert_to_protobuf( + assigned_object_interface, pb.Interface ) - termination_virtual_machine = convert_to_protobuf( - termination_virtual_machine, pb.VirtualMachine + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface ) - termination_wireless_lan = convert_to_protobuf( - termination_wireless_lan, pb.WirelessLAN + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.MACAddress( + mac_address=mac_address, + assigned_object_interface=assigned_object_interface, + assigned_object_vm_interface=assigned_object_vm_interface, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_wireless_lan_group = convert_to_protobuf( - termination_wireless_lan_group, pb.WirelessLANGroup + return result + + +class Manufacturer: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Manufacturer.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Manufacturer: + """Create a new Manufacturer.""" + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Manufacturer( + name=name, + slug=slug, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_wireless_link = convert_to_protobuf( - termination_wireless_link, pb.WirelessLink + return result + + +class Module: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Module.""" + + def __new__( + cls, + device: str | Device | pb.Device | None = None, + module_bay: str | ModuleBay | pb.ModuleBay | None = None, + module_type: str | ModuleType | pb.ModuleType | None = None, + status: str | None = None, + serial: str | None = None, + asset_tag: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Module: + """Create a new Module.""" + device = convert_to_protobuf(device, pb.Device) + module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) + module_type = convert_to_protobuf(module_type, pb.ModuleType) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Module( + device=device, + module_bay=module_bay, + module_type=module_type, + status=status, + serial=serial, + asset_tag=asset_tag, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_custom_field = convert_to_protobuf( - termination_custom_field, pb.CustomField + return result + + +class ModuleBay: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleBay.""" + + def __new__( + cls, + device: str | Device | pb.Device | None = None, + module: str | Module | pb.Module | None = None, + name: str | None = None, + installed_module: str | Module | pb.Module | None = None, + label: str | None = None, + position: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.ModuleBay: + """Create a new ModuleBay.""" + device = convert_to_protobuf(device, pb.Device) + module = convert_to_protobuf(module, pb.Module) + installed_module = convert_to_protobuf(installed_module, pb.Module) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.ModuleBay( + device=device, + module=module, + name=name, + installed_module=installed_module, + label=label, + position=position, + description=description, + owner=owner, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_custom_field_choice_set = convert_to_protobuf( - termination_custom_field_choice_set, pb.CustomFieldChoiceSet + return result + + +class ModuleType: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleType.""" + + def __new__( + cls, + profile: str | ModuleTypeProfile | pb.ModuleTypeProfile | None = None, + manufacturer: str | Manufacturer | pb.Manufacturer | None = None, + model: str | None = None, + part_number: str | None = None, + airflow: str | None = None, + weight: float | None = None, + weight_unit: str | None = None, + description: str | None = None, + attributes: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.ModuleType: + """Create a new ModuleType.""" + profile = convert_to_protobuf(profile, pb.ModuleTypeProfile) + manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.ModuleType( + profile=profile, + manufacturer=manufacturer, + model=model, + part_number=part_number, + airflow=airflow, + weight=weight, + weight_unit=weight_unit, + description=description, + attributes=attributes, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_journal_entry = convert_to_protobuf( - termination_journal_entry, pb.JournalEntry + return result + + +class ModuleTypeProfile: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleTypeProfile.""" + + def __new__( + cls, + name: str | None = None, + description: str | None = None, + schema: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.ModuleTypeProfile: + """Create a new ModuleTypeProfile.""" + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.ModuleTypeProfile( + name=name, + description=description, + schema=schema, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_module_type_profile = convert_to_protobuf( - termination_module_type_profile, pb.ModuleTypeProfile + return result + + +class Owner: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Owner.""" + + def __new__( + cls, + name: str | None = None, + group: str | OwnerGroup | pb.OwnerGroup | None = None, + description: str | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Owner: + """Create a new Owner.""" + group = convert_to_protobuf(group, pb.OwnerGroup) + metadata = convert_dict_to_struct(metadata) + result = pb.Owner( + name=name, + group=group, + description=description, + metadata=metadata, ) - termination_custom_link = convert_to_protobuf( - termination_custom_link, pb.CustomLink + return result + + +class OwnerGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.OwnerGroup.""" + + def __new__( + cls, + name: str | None = None, + description: str | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.OwnerGroup: + """Create a new OwnerGroup.""" + metadata = convert_dict_to_struct(metadata) + result = pb.OwnerGroup( + name=name, + description=description, + metadata=metadata, ) - termination_owner = convert_to_protobuf(termination_owner, pb.Owner) - termination_owner_group = convert_to_protobuf( - termination_owner_group, pb.OwnerGroup + return result + + +class Platform: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Platform.""" + + def __new__( + cls, + parent: str | Platform | pb.Platform | None = None, + name: str | None = None, + slug: str | None = None, + manufacturer: str | Manufacturer | pb.Manufacturer | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Platform: + """Create a new Platform.""" + parent = convert_to_protobuf(parent, pb.Platform) + manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Platform( + parent=parent, + name=name, + slug=slug, + manufacturer=manufacturer, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - outside_ip = convert_to_protobuf(outside_ip, pb.IPAddress) + return result + + +class PowerFeed: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerFeed.""" + + def __new__( + cls, + power_panel: str | PowerPanel | pb.PowerPanel | None = None, + rack: str | Rack | pb.Rack | None = None, + name: str | None = None, + status: str | None = None, + type: str | None = None, + supply: str | None = None, + phase: str | None = None, + voltage: int | None = None, + amperage: int | None = None, + max_utilization: int | None = None, + mark_connected: bool | None = None, + description: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.PowerFeed: + """Create a new PowerFeed.""" + power_panel = convert_to_protobuf(power_panel, pb.PowerPanel) + rack = convert_to_protobuf(rack, pb.Rack) + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.TunnelTermination( - tunnel=tunnel, - role=role, - termination_asn=termination_asn, - termination_asn_range=termination_asn_range, - termination_aggregate=termination_aggregate, - termination_cable=termination_cable, - termination_cable_path=termination_cable_path, - termination_cable_termination=termination_cable_termination, - termination_circuit=termination_circuit, - termination_circuit_group=termination_circuit_group, - termination_circuit_group_assignment=termination_circuit_group_assignment, - termination_circuit_termination=termination_circuit_termination, - termination_circuit_type=termination_circuit_type, - termination_cluster=termination_cluster, - termination_cluster_group=termination_cluster_group, - termination_cluster_type=termination_cluster_type, - termination_console_port=termination_console_port, - termination_console_server_port=termination_console_server_port, - termination_contact=termination_contact, - termination_contact_assignment=termination_contact_assignment, - termination_contact_group=termination_contact_group, - termination_contact_role=termination_contact_role, - termination_device=termination_device, - termination_device_bay=termination_device_bay, - termination_device_role=termination_device_role, - termination_device_type=termination_device_type, - termination_fhrp_group=termination_fhrp_group, - termination_fhrp_group_assignment=termination_fhrp_group_assignment, - termination_front_port=termination_front_port, - termination_ike_policy=termination_ike_policy, - termination_ike_proposal=termination_ike_proposal, - termination_ip_address=termination_ip_address, - termination_ip_range=termination_ip_range, - termination_ip_sec_policy=termination_ip_sec_policy, - termination_ip_sec_profile=termination_ip_sec_profile, - termination_ip_sec_proposal=termination_ip_sec_proposal, - termination_interface=termination_interface, - termination_inventory_item=termination_inventory_item, - termination_inventory_item_role=termination_inventory_item_role, - termination_l2vpn=termination_l2vpn, - termination_l2vpn_termination=termination_l2vpn_termination, - termination_location=termination_location, - termination_mac_address=termination_mac_address, - termination_manufacturer=termination_manufacturer, - termination_module=termination_module, - termination_module_bay=termination_module_bay, - termination_module_type=termination_module_type, - termination_platform=termination_platform, - termination_power_feed=termination_power_feed, - termination_power_outlet=termination_power_outlet, - termination_power_panel=termination_power_panel, - termination_power_port=termination_power_port, - termination_prefix=termination_prefix, - termination_provider=termination_provider, - termination_provider_account=termination_provider_account, - termination_provider_network=termination_provider_network, - termination_rir=termination_rir, - termination_rack=termination_rack, - termination_rack_reservation=termination_rack_reservation, - termination_rack_role=termination_rack_role, - termination_rack_type=termination_rack_type, - termination_rear_port=termination_rear_port, - termination_region=termination_region, - termination_role=termination_role, - termination_route_target=termination_route_target, - termination_service=termination_service, - termination_site=termination_site, - termination_site_group=termination_site_group, - termination_tag=termination_tag, - termination_tenant=termination_tenant, - termination_tenant_group=termination_tenant_group, - termination_tunnel=termination_tunnel, - termination_tunnel_group=termination_tunnel_group, - termination_tunnel_termination=termination_tunnel_termination, - termination_vlan=termination_vlan, - termination_vlan_group=termination_vlan_group, - termination_vlan_translation_policy=termination_vlan_translation_policy, - termination_vlan_translation_rule=termination_vlan_translation_rule, - termination_vm_interface=termination_vm_interface, - termination_vrf=termination_vrf, - termination_virtual_chassis=termination_virtual_chassis, - termination_virtual_circuit=termination_virtual_circuit, - termination_virtual_circuit_termination=termination_virtual_circuit_termination, - termination_virtual_circuit_type=termination_virtual_circuit_type, - termination_virtual_device_context=termination_virtual_device_context, - termination_virtual_disk=termination_virtual_disk, - termination_virtual_machine=termination_virtual_machine, - termination_wireless_lan=termination_wireless_lan, - termination_wireless_lan_group=termination_wireless_lan_group, - termination_wireless_link=termination_wireless_link, - termination_custom_field=termination_custom_field, - termination_custom_field_choice_set=termination_custom_field_choice_set, - termination_journal_entry=termination_journal_entry, - termination_module_type_profile=termination_module_type_profile, - termination_custom_link=termination_custom_link, - termination_owner=termination_owner, - termination_owner_group=termination_owner_group, - outside_ip=outside_ip, + result = pb.PowerFeed( + power_panel=power_panel, + rack=rack, + name=name, + status=status, + type=type, + supply=supply, + phase=phase, + voltage=voltage, + amperage=amperage, + max_utilization=max_utilization, + mark_connected=mark_connected, + description=description, + tenant=tenant, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, @@ -6443,388 +5528,614 @@ def __new__( return result -class VLAN: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLAN.""" +class PowerOutlet: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerOutlet.""" def __new__( cls, - site: str | Site | pb.Site | None = None, - group: str | VLANGroup | pb.VLANGroup | None = None, - vid: int | None = None, + device: str | Device | pb.Device | None = None, + module: str | Module | pb.Module | None = None, name: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, + label: str | None = None, + type: str | None = None, status: str | None = None, - role: str | Role | pb.Role | None = None, + color: str | None = None, + power_port: str | PowerPort | pb.PowerPort | None = None, + feed_leg: str | None = None, description: str | None = None, - qinq_role: str | None = None, - qinq_svlan: str | VLAN | pb.VLAN | None = None, - comments: str | None = None, + mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, + ) -> pb.PowerOutlet: + """Create a new PowerOutlet.""" + device = convert_to_protobuf(device, pb.Device) + module = convert_to_protobuf(module, pb.Module) + power_port = convert_to_protobuf(power_port, pb.PowerPort) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.PowerOutlet( + device=device, + module=module, + name=name, + label=label, + type=type, + status=status, + color=color, + power_port=power_port, + feed_leg=feed_leg, + description=description, + mark_connected=mark_connected, + owner=owner, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + ) + return result + + +class PowerPanel: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerPanel.""" + + def __new__( + cls, + site: str | Site | pb.Site | None = None, + location: str | Location | pb.Location | None = None, + name: str | None = None, + description: str | None = None, owner: str | Owner | pb.Owner | None = None, - ) -> pb.VLAN: - """Create a new VLAN.""" + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.PowerPanel: + """Create a new PowerPanel.""" site = convert_to_protobuf(site, pb.Site) - group = convert_to_protobuf(group, pb.VLANGroup) - tenant = convert_to_protobuf(tenant, pb.Tenant) - role = convert_to_protobuf(role, pb.Role) - qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) + location = convert_to_protobuf(location, pb.Location) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VLAN( + result = pb.PowerPanel( site=site, - group=group, - vid=vid, + location=location, name=name, - tenant=tenant, - status=status, - role=role, description=description, - qinq_role=qinq_role, - qinq_svlan=qinq_svlan, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class VLANGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANGroup.""" +class PowerPort: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerPort.""" def __new__( cls, + device: str | Device | pb.Device | None = None, + module: str | Module | pb.Module | None = None, name: str | None = None, - slug: str | None = None, - scope_cluster: str | Cluster | pb.Cluster | None = None, - scope_cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, + label: str | None = None, + type: str | None = None, + maximum_draw: int | None = None, + allocated_draw: int | None = None, + description: str | None = None, + mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.PowerPort: + """Create a new PowerPort.""" + device = convert_to_protobuf(device, pb.Device) + module = convert_to_protobuf(module, pb.Module) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.PowerPort( + device=device, + module=module, + name=name, + label=label, + type=type, + maximum_draw=maximum_draw, + allocated_draw=allocated_draw, + description=description, + mark_connected=mark_connected, + owner=owner, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + ) + return result + + +class Prefix: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Prefix.""" + + def __new__( + cls, + prefix: str | None = None, + vrf: str | VRF | pb.VRF | None = None, scope_location: str | Location | pb.Location | None = None, - scope_rack: str | Rack | pb.Rack | None = None, scope_region: str | Region | pb.Region | None = None, scope_site: str | Site | pb.Site | None = None, scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, - vid_ranges: list[int] | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + vlan: str | VLAN | pb.VLAN | None = None, + status: str | None = None, + role: str | Role | pb.Role | None = None, + is_pool: bool | None = None, + mark_utilized: bool | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - tenant: str | Tenant | pb.Tenant | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.VLANGroup: - """Create a new VLANGroup.""" - scope_cluster = convert_to_protobuf(scope_cluster, pb.Cluster) - scope_cluster_group = convert_to_protobuf(scope_cluster_group, pb.ClusterGroup) + ) -> pb.Prefix: + """Create a new Prefix.""" + vrf = convert_to_protobuf(vrf, pb.VRF) scope_location = convert_to_protobuf(scope_location, pb.Location) - scope_rack = convert_to_protobuf(scope_rack, pb.Rack) scope_region = convert_to_protobuf(scope_region, pb.Region) scope_site = convert_to_protobuf(scope_site, pb.Site) scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) + tenant = convert_to_protobuf(tenant, pb.Tenant) + vlan = convert_to_protobuf(vlan, pb.VLAN) + role = convert_to_protobuf(role, pb.Role) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - tenant = convert_to_protobuf(tenant, pb.Tenant) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VLANGroup( - name=name, - slug=slug, - scope_cluster=scope_cluster, - scope_cluster_group=scope_cluster_group, + result = pb.Prefix( + prefix=prefix, + vrf=vrf, scope_location=scope_location, - scope_rack=scope_rack, scope_region=scope_region, scope_site=scope_site, scope_site_group=scope_site_group, - vid_ranges=vid_ranges, + tenant=tenant, + vlan=vlan, + status=status, + role=role, + is_pool=is_pool, + mark_utilized=mark_utilized, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + ) + return result + + +class Provider: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Provider.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + accounts: list[str | ProviderAccount | pb.ProviderAccount] | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + asns: list[str | ASN | pb.ASN] | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Provider: + """Create a new Provider.""" + accounts = convert_to_protobuf_list(accounts, pb.ProviderAccount) + owner = convert_to_protobuf(owner, pb.Owner) + asns = convert_to_protobuf_list(asns, pb.ASN) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Provider( + name=name, + slug=slug, + accounts=accounts, + description=description, + owner=owner, + comments=comments, + asns=asns, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + ) + return result + + +class ProviderAccount: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ProviderAccount.""" + + def __new__( + cls, + provider: str | Provider | pb.Provider | None = None, + name: str | None = None, + account: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.ProviderAccount: + """Create a new ProviderAccount.""" + provider = convert_to_protobuf(provider, pb.Provider) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.ProviderAccount( + provider=provider, + name=name, + account=account, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, - tenant=tenant, metadata=metadata, - owner=owner, - comments=comments, ) return result -class VLANTranslationPolicy: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANTranslationPolicy.""" +class ProviderNetwork: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ProviderNetwork.""" def __new__( cls, + provider: str | Provider | pb.Provider | None = None, name: str | None = None, + service_id: str | None = None, description: str | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - ) -> pb.VLANTranslationPolicy: - """Create a new VLANTranslationPolicy.""" - metadata = convert_dict_to_struct(metadata) + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.ProviderNetwork: + """Create a new ProviderNetwork.""" + provider = convert_to_protobuf(provider, pb.Provider) owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VLANTranslationPolicy( + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.ProviderNetwork( + provider=provider, name=name, + service_id=service_id, description=description, - metadata=metadata, owner=owner, comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) return result -class VLANTranslationRule: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANTranslationRule.""" +class RIR: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RIR.""" def __new__( cls, - policy: str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None = None, - local_vid: int | None = None, - remote_vid: int | None = None, + name: str | None = None, + slug: str | None = None, + is_private: bool | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.VLANTranslationRule: - """Create a new VLANTranslationRule.""" - policy = convert_to_protobuf(policy, pb.VLANTranslationPolicy) + ) -> pb.RIR: + """Create a new RIR.""" + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.VLANTranslationRule( - policy=policy, - local_vid=local_vid, - remote_vid=remote_vid, + result = pb.RIR( + name=name, + slug=slug, + is_private=is_private, description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, metadata=metadata, ) return result -class VMInterface: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VMInterface.""" +class Rack: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Rack.""" def __new__( cls, - virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, name: str | None = None, - enabled: bool | None = None, - parent: str | VMInterface | pb.VMInterface | None = None, - bridge: str | VMInterface | pb.VMInterface | None = None, - mtu: int | None = None, - primary_mac_address: str | MACAddress | pb.MACAddress | None = None, + facility_id: str | None = None, + site: str | Site | pb.Site | None = None, + location: str | Location | pb.Location | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + status: str | None = None, + role: str | RackRole | pb.RackRole | None = None, + serial: str | None = None, + asset_tag: str | None = None, + rack_type: str | RackType | pb.RackType | None = None, + form_factor: str | None = None, + width: int | None = None, + u_height: int | None = None, + starting_unit: int | None = None, + weight: float | None = None, + max_weight: int | None = None, + weight_unit: str | None = None, + desc_units: bool | None = None, + outer_width: int | None = None, + outer_height: int | None = None, + outer_depth: int | None = None, + outer_unit: str | None = None, + mounting_depth: int | None = None, + airflow: str | None = None, description: str | None = None, - mode: str | None = None, - untagged_vlan: str | VLAN | pb.VLAN | None = None, - qinq_svlan: str | VLAN | pb.VLAN | None = None, - vlan_translation_policy: ( - str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None - ) = None, - vrf: str | VRF | pb.VRF | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VMInterface: - """Create a new VMInterface.""" - virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) - parent = convert_to_protobuf(parent, pb.VMInterface) - bridge = convert_to_protobuf(bridge, pb.VMInterface) - primary_mac_address = convert_to_protobuf(primary_mac_address, pb.MACAddress) - untagged_vlan = convert_to_protobuf(untagged_vlan, pb.VLAN) - qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) - vlan_translation_policy = convert_to_protobuf( - vlan_translation_policy, pb.VLANTranslationPolicy - ) - vrf = convert_to_protobuf(vrf, pb.VRF) + ) -> pb.Rack: + """Create a new Rack.""" + site = convert_to_protobuf(site, pb.Site) + location = convert_to_protobuf(location, pb.Location) + tenant = convert_to_protobuf(tenant, pb.Tenant) + role = convert_to_protobuf(role, pb.RackRole) + rack_type = convert_to_protobuf(rack_type, pb.RackType) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VMInterface( - virtual_machine=virtual_machine, + result = pb.Rack( name=name, - enabled=enabled, - parent=parent, - bridge=bridge, - mtu=mtu, - primary_mac_address=primary_mac_address, + facility_id=facility_id, + site=site, + location=location, + tenant=tenant, + status=status, + role=role, + serial=serial, + asset_tag=asset_tag, + rack_type=rack_type, + form_factor=form_factor, + width=width, + u_height=u_height, + starting_unit=starting_unit, + weight=weight, + max_weight=max_weight, + weight_unit=weight_unit, + desc_units=desc_units, + outer_width=outer_width, + outer_height=outer_height, + outer_depth=outer_depth, + outer_unit=outer_unit, + mounting_depth=mounting_depth, + airflow=airflow, description=description, - mode=mode, - untagged_vlan=untagged_vlan, - qinq_svlan=qinq_svlan, - vlan_translation_policy=vlan_translation_policy, - vrf=vrf, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, - tagged_vlans=tagged_vlans, metadata=metadata, - owner=owner, ) return result -class VRF: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VRF.""" +class RackReservation: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackReservation.""" def __new__( cls, - name: str | None = None, - rd: str | None = None, + rack: str | Rack | pb.Rack | None = None, + units: list[int] | None = None, + status: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, - enforce_unique: bool | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VRF: - """Create a new VRF.""" + ) -> pb.RackReservation: + """Create a new RackReservation.""" + rack = convert_to_protobuf(rack, pb.Rack) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) - export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VRF( - name=name, - rd=rd, + result = pb.RackReservation( + rack=rack, + units=units, + status=status, tenant=tenant, - enforce_unique=enforce_unique, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, - import_targets=import_targets, - export_targets=export_targets, metadata=metadata, - owner=owner, ) return result -class VirtualChassis: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualChassis.""" +class RackRole: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackRole.""" def __new__( cls, name: str | None = None, - domain: str | None = None, - master: str | Device | pb.Device | None = None, + slug: str | None = None, + color: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VirtualChassis: - """Create a new VirtualChassis.""" - master = convert_to_protobuf(master, pb.Device) + ) -> pb.RackRole: + """Create a new RackRole.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VirtualChassis( + result = pb.RackRole( name=name, - domain=domain, - master=master, + slug=slug, + color=color, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class VirtualCircuit: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuit.""" +class RackType: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackType.""" def __new__( cls, - cid: str | None = None, - provider_network: str | ProviderNetwork | pb.ProviderNetwork | None = None, - provider_account: str | ProviderAccount | pb.ProviderAccount | None = None, - type: str | VirtualCircuitType | pb.VirtualCircuitType | None = None, - status: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, + manufacturer: str | Manufacturer | pb.Manufacturer | None = None, + model: str | None = None, + slug: str | None = None, description: str | None = None, + form_factor: str | None = None, + width: int | None = None, + u_height: int | None = None, + starting_unit: int | None = None, + desc_units: bool | None = None, + outer_width: int | None = None, + outer_height: int | None = None, + outer_depth: int | None = None, + outer_unit: str | None = None, + weight: float | None = None, + max_weight: int | None = None, + weight_unit: str | None = None, + mounting_depth: int | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VirtualCircuit: - """Create a new VirtualCircuit.""" - provider_network = convert_to_protobuf(provider_network, pb.ProviderNetwork) - provider_account = convert_to_protobuf(provider_account, pb.ProviderAccount) - type = convert_to_protobuf(type, pb.VirtualCircuitType) - tenant = convert_to_protobuf(tenant, pb.Tenant) + ) -> pb.RackType: + """Create a new RackType.""" + manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VirtualCircuit( - cid=cid, - provider_network=provider_network, - provider_account=provider_account, - type=type, - status=status, - tenant=tenant, + result = pb.RackType( + manufacturer=manufacturer, + model=model, + slug=slug, description=description, + form_factor=form_factor, + width=width, + u_height=u_height, + starting_unit=starting_unit, + desc_units=desc_units, + outer_width=outer_width, + outer_height=outer_height, + outer_depth=outer_depth, + outer_unit=outer_unit, + weight=weight, + max_weight=max_weight, + weight_unit=weight_unit, + mounting_depth=mounting_depth, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class VirtualCircuitTermination: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuitTermination.""" +class RearPort: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RearPort.""" def __new__( cls, - virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, - role: str | None = None, - interface: str | Interface | pb.Interface | None = None, + device: str | Device | pb.Device | None = None, + module: str | Module | pb.Module | None = None, + name: str | None = None, + label: str | None = None, + type: str | None = None, + color: str | None = None, + positions: int | None = None, description: str | None = None, + mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.VirtualCircuitTermination: - """Create a new VirtualCircuitTermination.""" - virtual_circuit = convert_to_protobuf(virtual_circuit, pb.VirtualCircuit) - interface = convert_to_protobuf(interface, pb.Interface) + ) -> pb.RearPort: + """Create a new RearPort.""" + device = convert_to_protobuf(device, pb.Device) + module = convert_to_protobuf(module, pb.Module) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.VirtualCircuitTermination( - virtual_circuit=virtual_circuit, - role=role, - interface=interface, + result = pb.RearPort( + device=device, + module=module, + name=name, + label=label, + type=type, + color=color, + positions=positions, description=description, + mark_connected=mark_connected, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, @@ -6832,972 +6143,1403 @@ def __new__( return result -class VirtualCircuitType: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuitType.""" +class Region: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Region.""" def __new__( cls, name: str | None = None, slug: str | None = None, - color: str | None = None, + parent: str | Region | pb.Region | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.VirtualCircuitType: - """Create a new VirtualCircuitType.""" + ) -> pb.Region: + """Create a new Region.""" + parent = convert_to_protobuf(parent, pb.Region) tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VirtualCircuitType( + result = pb.Region( name=name, slug=slug, - color=color, + parent=parent, description=description, tags=tags, - custom_fields=custom_fields, - metadata=metadata, owner=owner, comments=comments, + custom_fields=custom_fields, + metadata=metadata, ) return result -class VirtualDeviceContext: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDeviceContext.""" +class Role: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Role.""" def __new__( cls, name: str | None = None, - device: str | Device | pb.Device | None = None, - identifier: int | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - primary_ip4: str | IPAddress | pb.IPAddress | None = None, - primary_ip6: str | IPAddress | pb.IPAddress | None = None, - status: str | None = None, + slug: str | None = None, + weight: int | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VirtualDeviceContext: - """Create a new VirtualDeviceContext.""" - device = convert_to_protobuf(device, pb.Device) - tenant = convert_to_protobuf(tenant, pb.Tenant) - primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) - primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) + ) -> pb.Role: + """Create a new Role.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VirtualDeviceContext( + result = pb.Role( name=name, - device=device, - identifier=identifier, - tenant=tenant, - primary_ip4=primary_ip4, - primary_ip6=primary_ip6, - status=status, + slug=slug, + weight=weight, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class VirtualDisk: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDisk.""" +class RouteTarget: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RouteTarget.""" def __new__( cls, - virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, name: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - size: int | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VirtualDisk: - """Create a new VirtualDisk.""" - virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) + ) -> pb.RouteTarget: + """Create a new RouteTarget.""" + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VirtualDisk( - virtual_machine=virtual_machine, + result = pb.RouteTarget( name=name, + tenant=tenant, description=description, - size=size, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class VirtualMachine: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualMachine.""" +class Service: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Service.""" def __new__( cls, + parent_object_device: str | Device | pb.Device | None = None, + parent_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, + parent_object_virtual_machine: ( + str | VirtualMachine | pb.VirtualMachine | None + ) = None, name: str | None = None, - status: str | None = None, - site: str | Site | pb.Site | None = None, - cluster: str | Cluster | pb.Cluster | None = None, - device: str | Device | pb.Device | None = None, - serial: str | None = None, - role: str | DeviceRole | pb.DeviceRole | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - platform: str | Platform | pb.Platform | None = None, - primary_ip4: str | IPAddress | pb.IPAddress | None = None, - primary_ip6: str | IPAddress | pb.IPAddress | None = None, - vcpus: float | None = None, - memory: int | None = None, - disk: int | None = None, + protocol: str | None = None, + ports: list[int] | None = None, + ipaddresses: list[str | IPAddress | pb.IPAddress] | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - start_on_boot: str | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VirtualMachine: - """Create a new VirtualMachine.""" - site = convert_to_protobuf(site, pb.Site) - cluster = convert_to_protobuf(cluster, pb.Cluster) - device = convert_to_protobuf(device, pb.Device) - role = convert_to_protobuf(role, pb.DeviceRole) - tenant = convert_to_protobuf(tenant, pb.Tenant) - platform = convert_to_protobuf(platform, pb.Platform) - primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) - primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) + ) -> pb.Service: + """Create a new Service.""" + parent_object_device = convert_to_protobuf(parent_object_device, pb.Device) + parent_object_fhrp_group = convert_to_protobuf( + parent_object_fhrp_group, pb.FHRPGroup + ) + parent_object_virtual_machine = convert_to_protobuf( + parent_object_virtual_machine, pb.VirtualMachine + ) + ipaddresses = convert_to_protobuf_list(ipaddresses, pb.IPAddress) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - - # apply shortcuts - if platform is not None: - if device is not None and not device.HasField("platform"): - device.platform.CopyFrom(platform) - if site is not None: - if device is not None and not device.HasField("site"): - device.site.CopyFrom(site) - if cluster is not None and not cluster.HasField("scope_site"): - cluster.scope_site.CopyFrom(site) - if role is not None: - if device is not None and not device.HasField("role"): - device.role.CopyFrom(role) - result = pb.VirtualMachine( - name=name, - status=status, - site=site, - cluster=cluster, - device=device, - serial=serial, - role=role, - tenant=tenant, - platform=platform, - primary_ip4=primary_ip4, - primary_ip6=primary_ip6, - vcpus=vcpus, - memory=memory, - disk=disk, + result = pb.Service( + parent_object_device=parent_object_device, + parent_object_fhrp_group=parent_object_fhrp_group, + parent_object_virtual_machine=parent_object_virtual_machine, + name=name, + protocol=protocol, + ports=ports, + ipaddresses=ipaddresses, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - start_on_boot=start_on_boot, - owner=owner, ) return result -class WirelessLAN: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLAN.""" +class Site: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Site.""" def __new__( cls, - ssid: str | None = None, - description: str | None = None, - group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, + name: str | None = None, + slug: str | None = None, status: str | None = None, - vlan: str | VLAN | pb.VLAN | None = None, - scope_location: str | Location | pb.Location | None = None, - scope_region: str | Region | pb.Region | None = None, - scope_site: str | Site | pb.Site | None = None, - scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, + region: str | Region | pb.Region | None = None, + group: str | SiteGroup | pb.SiteGroup | None = None, tenant: str | Tenant | pb.Tenant | None = None, - auth_type: str | None = None, - auth_cipher: str | None = None, - auth_psk: str | None = None, + facility: str | None = None, + time_zone: str | None = None, + description: str | None = None, + physical_address: str | None = None, + shipping_address: str | None = None, + latitude: float | None = None, + longitude: float | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + asns: list[str | ASN | pb.ASN] | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.WirelessLAN: - """Create a new WirelessLAN.""" - group = convert_to_protobuf(group, pb.WirelessLANGroup) - vlan = convert_to_protobuf(vlan, pb.VLAN) - scope_location = convert_to_protobuf(scope_location, pb.Location) - scope_region = convert_to_protobuf(scope_region, pb.Region) - scope_site = convert_to_protobuf(scope_site, pb.Site) - scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) + ) -> pb.Site: + """Create a new Site.""" + region = convert_to_protobuf(region, pb.Region) + group = convert_to_protobuf(group, pb.SiteGroup) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + asns = convert_to_protobuf_list(asns, pb.ASN) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.WirelessLAN( - ssid=ssid, - description=description, - group=group, + result = pb.Site( + name=name, + slug=slug, status=status, - vlan=vlan, - scope_location=scope_location, - scope_region=scope_region, - scope_site=scope_site, - scope_site_group=scope_site_group, + region=region, + group=group, tenant=tenant, - auth_type=auth_type, - auth_cipher=auth_cipher, - auth_psk=auth_psk, + facility=facility, + time_zone=time_zone, + description=description, + physical_address=physical_address, + shipping_address=shipping_address, + latitude=latitude, + longitude=longitude, + owner=owner, comments=comments, + asns=asns, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class WirelessLANGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLANGroup.""" +class SiteGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.SiteGroup.""" def __new__( cls, name: str | None = None, slug: str | None = None, - parent: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, + parent: str | SiteGroup | pb.SiteGroup | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - comments: str | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.WirelessLANGroup: - """Create a new WirelessLANGroup.""" - parent = convert_to_protobuf(parent, pb.WirelessLANGroup) + ) -> pb.SiteGroup: + """Create a new SiteGroup.""" + parent = convert_to_protobuf(parent, pb.SiteGroup) tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.WirelessLANGroup( + result = pb.SiteGroup( name=name, slug=slug, parent=parent, description=description, tags=tags, - custom_fields=custom_fields, + owner=owner, comments=comments, + custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class WirelessLink: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLink.""" +class Tag: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tag.""" def __new__( cls, - interface_a: str | Interface | pb.Interface | None = None, - interface_b: str | Interface | pb.Interface | None = None, - ssid: str | None = None, - status: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - auth_type: str | None = None, - auth_cipher: str | None = None, - auth_psk: str | None = None, - distance: float | None = None, - distance_unit: str | None = None, + name: str | None = None, + slug: str | None = None, + color: str | None = None, + description: str | None = None, + weight: int | None = None, + object_types: list[str] | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Tag: + """Create a new Tag.""" + metadata = convert_dict_to_struct(metadata) + result = pb.Tag( + name=name, + slug=slug, + color=color, + description=description, + weight=weight, + object_types=object_types, + metadata=metadata, + ) + return result + + +class Tenant: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tenant.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + group: str | TenantGroup | pb.TenantGroup | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.WirelessLink: - """Create a new WirelessLink.""" - interface_a = convert_to_protobuf(interface_a, pb.Interface) - interface_b = convert_to_protobuf(interface_b, pb.Interface) - tenant = convert_to_protobuf(tenant, pb.Tenant) + ) -> pb.Tenant: + """Create a new Tenant.""" + group = convert_to_protobuf(group, pb.TenantGroup) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.WirelessLink( - interface_a=interface_a, - interface_b=interface_b, - ssid=ssid, - status=status, - tenant=tenant, - auth_type=auth_type, - auth_cipher=auth_cipher, - auth_psk=auth_psk, - distance=distance, - distance_unit=distance_unit, + result = pb.Tenant( + name=name, + slug=slug, + group=group, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class CustomField: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomField.""" +class TenantGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TenantGroup.""" def __new__( cls, - type: str | None = None, - related_object_type: str | None = None, name: str | None = None, - label: str | None = None, - group_name: str | None = None, + slug: str | None = None, + parent: str | TenantGroup | pb.TenantGroup | None = None, description: str | None = None, - required: bool | None = None, - unique: bool | None = None, - search_weight: int | None = None, - filter_logic: str | None = None, - ui_visible: str | None = None, - ui_editable: str | None = None, - is_cloneable: bool | None = None, - default: str | None = None, - related_object_filter: str | None = None, - weight: int | None = None, - validation_minimum: float | None = None, - validation_maximum: float | None = None, - validation_regex: str | None = None, - choice_set: str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - object_types: list[str] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.CustomField: - """Create a new CustomField.""" - choice_set = convert_to_protobuf(choice_set, pb.CustomFieldChoiceSet) + ) -> pb.TenantGroup: + """Create a new TenantGroup.""" + parent = convert_to_protobuf(parent, pb.TenantGroup) + tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + result = pb.TenantGroup( + name=name, + slug=slug, + parent=parent, + description=description, + tags=tags, + owner=owner, + comments=comments, + custom_fields=custom_fields, + metadata=metadata, + ) + return result + + +class Tunnel: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tunnel.""" + + def __new__( + cls, + name: str | None = None, + status: str | None = None, + group: str | TunnelGroup | pb.TunnelGroup | None = None, + encapsulation: str | None = None, + ipsec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + tunnel_id: int | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Tunnel: + """Create a new Tunnel.""" + group = convert_to_protobuf(group, pb.TunnelGroup) + ipsec_profile = convert_to_protobuf(ipsec_profile, pb.IPSecProfile) + tenant = convert_to_protobuf(tenant, pb.Tenant) owner = convert_to_protobuf(owner, pb.Owner) - result = pb.CustomField( - type=type, - related_object_type=related_object_type, + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Tunnel( name=name, - label=label, - group_name=group_name, + status=status, + group=group, + encapsulation=encapsulation, + ipsec_profile=ipsec_profile, + tenant=tenant, + tunnel_id=tunnel_id, description=description, - required=required, - unique=unique, - search_weight=search_weight, - filter_logic=filter_logic, - ui_visible=ui_visible, - ui_editable=ui_editable, - is_cloneable=is_cloneable, - default=default, - related_object_filter=related_object_filter, - weight=weight, - validation_minimum=validation_minimum, - validation_maximum=validation_maximum, - validation_regex=validation_regex, - choice_set=choice_set, + owner=owner, comments=comments, - object_types=object_types, + tags=tags, + custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class CustomFieldChoiceSet: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomFieldChoiceSet.""" +class TunnelGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TunnelGroup.""" def __new__( cls, name: str | None = None, + slug: str | None = None, description: str | None = None, - base_choices: str | None = None, - order_alphabetically: bool | None = None, - extra_choices: list[str] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, - ) -> pb.CustomFieldChoiceSet: - """Create a new CustomFieldChoiceSet.""" - metadata = convert_dict_to_struct(metadata) + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.TunnelGroup: + """Create a new TunnelGroup.""" owner = convert_to_protobuf(owner, pb.Owner) - result = pb.CustomFieldChoiceSet( + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.TunnelGroup( name=name, + slug=slug, description=description, - base_choices=base_choices, - order_alphabetically=order_alphabetically, - extra_choices=extra_choices, - metadata=metadata, owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) return result -class JournalEntry: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.JournalEntry.""" +class TunnelTermination: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TunnelTermination.""" def __new__( cls, - assigned_object_asn: str | ASN | pb.ASN | None = None, - assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, - assigned_object_aggregate: str | Aggregate | pb.Aggregate | None = None, - assigned_object_cable: str | Cable | pb.Cable | None = None, - assigned_object_cable_path: str | CablePath | pb.CablePath | None = None, - assigned_object_cable_termination: ( + tunnel: str | Tunnel | pb.Tunnel | None = None, + role: str | None = None, + termination_asn: str | ASN | pb.ASN | None = None, + termination_asn_range: str | ASNRange | pb.ASNRange | None = None, + termination_aggregate: str | Aggregate | pb.Aggregate | None = None, + termination_cable: str | Cable | pb.Cable | None = None, + termination_cable_path: str | CablePath | pb.CablePath | None = None, + termination_cable_termination: ( str | CableTermination | pb.CableTermination | None ) = None, - assigned_object_circuit: str | Circuit | pb.Circuit | None = None, - assigned_object_circuit_group: ( - str | CircuitGroup | pb.CircuitGroup | None - ) = None, - assigned_object_circuit_group_assignment: ( + termination_circuit: str | Circuit | pb.Circuit | None = None, + termination_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, + termination_circuit_group_assignment: ( str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, - assigned_object_circuit_termination: ( + termination_circuit_termination: ( str | CircuitTermination | pb.CircuitTermination | None ) = None, - assigned_object_circuit_type: str | CircuitType | pb.CircuitType | None = None, - assigned_object_cluster: str | Cluster | pb.Cluster | None = None, - assigned_object_cluster_group: ( - str | ClusterGroup | pb.ClusterGroup | None - ) = None, - assigned_object_cluster_type: str | ClusterType | pb.ClusterType | None = None, - assigned_object_console_port: str | ConsolePort | pb.ConsolePort | None = None, - assigned_object_console_server_port: ( + termination_circuit_type: str | CircuitType | pb.CircuitType | None = None, + termination_cluster: str | Cluster | pb.Cluster | None = None, + termination_cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, + termination_cluster_type: str | ClusterType | pb.ClusterType | None = None, + termination_console_port: str | ConsolePort | pb.ConsolePort | None = None, + termination_console_server_port: ( str | ConsoleServerPort | pb.ConsoleServerPort | None ) = None, - assigned_object_contact: str | Contact | pb.Contact | None = None, - assigned_object_contact_assignment: ( + termination_contact: str | Contact | pb.Contact | None = None, + termination_contact_assignment: ( str | ContactAssignment | pb.ContactAssignment | None ) = None, - assigned_object_contact_group: ( - str | ContactGroup | pb.ContactGroup | None - ) = None, - assigned_object_contact_role: str | ContactRole | pb.ContactRole | None = None, - assigned_object_custom_field: str | CustomField | pb.CustomField | None = None, - assigned_object_custom_field_choice_set: ( + termination_contact_group: str | ContactGroup | pb.ContactGroup | None = None, + termination_contact_role: str | ContactRole | pb.ContactRole | None = None, + termination_custom_field: str | CustomField | pb.CustomField | None = None, + termination_custom_field_choice_set: ( str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None ) = None, - assigned_object_device: str | Device | pb.Device | None = None, - assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, - assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, - assigned_object_device_type: str | DeviceType | pb.DeviceType | None = None, - assigned_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, - assigned_object_fhrp_group_assignment: ( + termination_custom_link: str | CustomLink | pb.CustomLink | None = None, + termination_device: str | Device | pb.Device | None = None, + termination_device_bay: str | DeviceBay | pb.DeviceBay | None = None, + termination_device_role: str | DeviceRole | pb.DeviceRole | None = None, + termination_device_type: str | DeviceType | pb.DeviceType | None = None, + termination_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, + termination_fhrp_group_assignment: ( str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, - assigned_object_front_port: str | FrontPort | pb.FrontPort | None = None, - assigned_object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, - assigned_object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, - assigned_object_ip_address: str | IPAddress | pb.IPAddress | None = None, - assigned_object_ip_range: str | IPRange | pb.IPRange | None = None, - assigned_object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, - assigned_object_ip_sec_profile: ( - str | IPSecProfile | pb.IPSecProfile | None - ) = None, - assigned_object_ip_sec_proposal: ( + termination_front_port: str | FrontPort | pb.FrontPort | None = None, + termination_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, + termination_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, + termination_ip_address: str | IPAddress | pb.IPAddress | None = None, + termination_ip_range: str | IPRange | pb.IPRange | None = None, + termination_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, + termination_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, + termination_ip_sec_proposal: ( str | IPSecProposal | pb.IPSecProposal | None ) = None, - assigned_object_interface: str | Interface | pb.Interface | None = None, - assigned_object_inventory_item: ( + termination_interface: str | Interface | pb.Interface | None = None, + termination_inventory_item: ( str | InventoryItem | pb.InventoryItem | None ) = None, - assigned_object_inventory_item_role: ( + termination_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - assigned_object_journal_entry: ( - str | JournalEntry | pb.JournalEntry | None - ) = None, - assigned_object_l2vpn: str | L2VPN | pb.L2VPN | None = None, - assigned_object_l2vpn_termination: ( + termination_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, + termination_l2vpn: str | L2VPN | pb.L2VPN | None = None, + termination_l2vpn_termination: ( str | L2VPNTermination | pb.L2VPNTermination | None ) = None, - assigned_object_location: str | Location | pb.Location | None = None, - assigned_object_mac_address: str | MACAddress | pb.MACAddress | None = None, - assigned_object_manufacturer: ( - str | Manufacturer | pb.Manufacturer | None - ) = None, - assigned_object_module: str | Module | pb.Module | None = None, - assigned_object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, - assigned_object_module_type: str | ModuleType | pb.ModuleType | None = None, - assigned_object_module_type_profile: ( + termination_location: str | Location | pb.Location | None = None, + termination_mac_address: str | MACAddress | pb.MACAddress | None = None, + termination_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, + termination_module: str | Module | pb.Module | None = None, + termination_module_bay: str | ModuleBay | pb.ModuleBay | None = None, + termination_module_type: str | ModuleType | pb.ModuleType | None = None, + termination_module_type_profile: ( str | ModuleTypeProfile | pb.ModuleTypeProfile | None ) = None, - assigned_object_platform: str | Platform | pb.Platform | None = None, - assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, - assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, - assigned_object_power_panel: str | PowerPanel | pb.PowerPanel | None = None, - assigned_object_power_port: str | PowerPort | pb.PowerPort | None = None, - assigned_object_prefix: str | Prefix | pb.Prefix | None = None, - assigned_object_provider: str | Provider | pb.Provider | None = None, - assigned_object_provider_account: ( + termination_owner: str | Owner | pb.Owner | None = None, + termination_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + termination_platform: str | Platform | pb.Platform | None = None, + termination_power_feed: str | PowerFeed | pb.PowerFeed | None = None, + termination_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, + termination_power_panel: str | PowerPanel | pb.PowerPanel | None = None, + termination_power_port: str | PowerPort | pb.PowerPort | None = None, + termination_prefix: str | Prefix | pb.Prefix | None = None, + termination_provider: str | Provider | pb.Provider | None = None, + termination_provider_account: ( str | ProviderAccount | pb.ProviderAccount | None ) = None, - assigned_object_provider_network: ( + termination_provider_network: ( str | ProviderNetwork | pb.ProviderNetwork | None ) = None, - assigned_object_rir: str | RIR | pb.RIR | None = None, - assigned_object_rack: str | Rack | pb.Rack | None = None, - assigned_object_rack_reservation: ( + termination_rir: str | RIR | pb.RIR | None = None, + termination_rack: str | Rack | pb.Rack | None = None, + termination_rack_reservation: ( str | RackReservation | pb.RackReservation | None ) = None, - assigned_object_rack_role: str | RackRole | pb.RackRole | None = None, - assigned_object_rack_type: str | RackType | pb.RackType | None = None, - assigned_object_rear_port: str | RearPort | pb.RearPort | None = None, - assigned_object_region: str | Region | pb.Region | None = None, - assigned_object_role: str | Role | pb.Role | None = None, - assigned_object_route_target: str | RouteTarget | pb.RouteTarget | None = None, - assigned_object_service: str | Service | pb.Service | None = None, - assigned_object_site: str | Site | pb.Site | None = None, - assigned_object_site_group: str | SiteGroup | pb.SiteGroup | None = None, - assigned_object_tag: str | Tag | pb.Tag | None = None, - assigned_object_tenant: str | Tenant | pb.Tenant | None = None, - assigned_object_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, - assigned_object_tunnel: str | Tunnel | pb.Tunnel | None = None, - assigned_object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - assigned_object_tunnel_termination: ( + termination_rack_role: str | RackRole | pb.RackRole | None = None, + termination_rack_type: str | RackType | pb.RackType | None = None, + termination_rear_port: str | RearPort | pb.RearPort | None = None, + termination_region: str | Region | pb.Region | None = None, + termination_role: str | Role | pb.Role | None = None, + termination_route_target: str | RouteTarget | pb.RouteTarget | None = None, + termination_service: str | Service | pb.Service | None = None, + termination_site: str | Site | pb.Site | None = None, + termination_site_group: str | SiteGroup | pb.SiteGroup | None = None, + termination_tag: str | Tag | pb.Tag | None = None, + termination_tenant: str | Tenant | pb.Tenant | None = None, + termination_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, + termination_tunnel: str | Tunnel | pb.Tunnel | None = None, + termination_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, + termination_tunnel_termination: ( str | TunnelTermination | pb.TunnelTermination | None ) = None, - assigned_object_vlan: str | VLAN | pb.VLAN | None = None, - assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, - assigned_object_vlan_translation_policy: ( + termination_vlan: str | VLAN | pb.VLAN | None = None, + termination_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, + termination_vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, - assigned_object_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None - ) = None, - assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, - assigned_object_vrf: str | VRF | pb.VRF | None = None, - assigned_object_virtual_chassis: ( + termination_vlan_translation_rule: ( + str | VLANTranslationRule | pb.VLANTranslationRule | None + ) = None, + termination_vm_interface: str | VMInterface | pb.VMInterface | None = None, + termination_vrf: str | VRF | pb.VRF | None = None, + termination_virtual_chassis: ( str | VirtualChassis | pb.VirtualChassis | None ) = None, - assigned_object_virtual_circuit: ( + termination_virtual_circuit: ( str | VirtualCircuit | pb.VirtualCircuit | None ) = None, - assigned_object_virtual_circuit_termination: ( + termination_virtual_circuit_termination: ( str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, - assigned_object_virtual_circuit_type: ( + termination_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None ) = None, - assigned_object_virtual_device_context: ( + termination_virtual_device_context: ( str | VirtualDeviceContext | pb.VirtualDeviceContext | None ) = None, - assigned_object_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, - assigned_object_virtual_machine: ( + termination_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, + termination_virtual_machine: ( str | VirtualMachine | pb.VirtualMachine | None ) = None, - assigned_object_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, - assigned_object_wireless_lan_group: ( + termination_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, + termination_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - assigned_object_wireless_link: ( - str | WirelessLink | pb.WirelessLink | None - ) = None, - assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, - assigned_object_owner: str | Owner | pb.Owner | None = None, - assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, - kind: str | None = None, - comments: str | None = None, + termination_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + outside_ip: str | IPAddress | pb.IPAddress | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.JournalEntry: - """Create a new JournalEntry.""" - assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) - assigned_object_asn_range = convert_to_protobuf( - assigned_object_asn_range, pb.ASNRange - ) - assigned_object_aggregate = convert_to_protobuf( - assigned_object_aggregate, pb.Aggregate - ) - assigned_object_cable = convert_to_protobuf(assigned_object_cable, pb.Cable) - assigned_object_cable_path = convert_to_protobuf( - assigned_object_cable_path, pb.CablePath - ) - assigned_object_cable_termination = convert_to_protobuf( - assigned_object_cable_termination, pb.CableTermination + ) -> pb.TunnelTermination: + """Create a new TunnelTermination.""" + tunnel = convert_to_protobuf(tunnel, pb.Tunnel) + termination_asn = convert_to_protobuf(termination_asn, pb.ASN) + termination_asn_range = convert_to_protobuf(termination_asn_range, pb.ASNRange) + termination_aggregate = convert_to_protobuf(termination_aggregate, pb.Aggregate) + termination_cable = convert_to_protobuf(termination_cable, pb.Cable) + termination_cable_path = convert_to_protobuf( + termination_cable_path, pb.CablePath ) - assigned_object_circuit = convert_to_protobuf( - assigned_object_circuit, pb.Circuit + termination_circuit = convert_to_protobuf(termination_circuit, pb.Circuit) + termination_circuit_group = convert_to_protobuf( + termination_circuit_group, pb.CircuitGroup ) - assigned_object_circuit_group = convert_to_protobuf( - assigned_object_circuit_group, pb.CircuitGroup + termination_circuit_group_assignment = convert_to_protobuf( + termination_circuit_group_assignment, pb.CircuitGroupAssignment ) - assigned_object_circuit_group_assignment = convert_to_protobuf( - assigned_object_circuit_group_assignment, pb.CircuitGroupAssignment + termination_circuit_termination = convert_to_protobuf( + termination_circuit_termination, pb.CircuitTermination ) - assigned_object_circuit_termination = convert_to_protobuf( - assigned_object_circuit_termination, pb.CircuitTermination + termination_circuit_type = convert_to_protobuf( + termination_circuit_type, pb.CircuitType ) - assigned_object_circuit_type = convert_to_protobuf( - assigned_object_circuit_type, pb.CircuitType + termination_cluster = convert_to_protobuf(termination_cluster, pb.Cluster) + termination_cluster_group = convert_to_protobuf( + termination_cluster_group, pb.ClusterGroup ) - assigned_object_cluster = convert_to_protobuf( - assigned_object_cluster, pb.Cluster + termination_cluster_type = convert_to_protobuf( + termination_cluster_type, pb.ClusterType ) - assigned_object_cluster_group = convert_to_protobuf( - assigned_object_cluster_group, pb.ClusterGroup + termination_console_port = convert_to_protobuf( + termination_console_port, pb.ConsolePort ) - assigned_object_cluster_type = convert_to_protobuf( - assigned_object_cluster_type, pb.ClusterType + termination_console_server_port = convert_to_protobuf( + termination_console_server_port, pb.ConsoleServerPort ) - assigned_object_console_port = convert_to_protobuf( - assigned_object_console_port, pb.ConsolePort + termination_contact = convert_to_protobuf(termination_contact, pb.Contact) + termination_contact_assignment = convert_to_protobuf( + termination_contact_assignment, pb.ContactAssignment ) - assigned_object_console_server_port = convert_to_protobuf( - assigned_object_console_server_port, pb.ConsoleServerPort + termination_contact_group = convert_to_protobuf( + termination_contact_group, pb.ContactGroup ) - assigned_object_contact = convert_to_protobuf( - assigned_object_contact, pb.Contact + termination_contact_role = convert_to_protobuf( + termination_contact_role, pb.ContactRole ) - assigned_object_contact_assignment = convert_to_protobuf( - assigned_object_contact_assignment, pb.ContactAssignment + termination_custom_field = convert_to_protobuf( + termination_custom_field, pb.CustomField ) - assigned_object_contact_group = convert_to_protobuf( - assigned_object_contact_group, pb.ContactGroup + termination_custom_field_choice_set = convert_to_protobuf( + termination_custom_field_choice_set, pb.CustomFieldChoiceSet ) - assigned_object_contact_role = convert_to_protobuf( - assigned_object_contact_role, pb.ContactRole + termination_custom_link = convert_to_protobuf( + termination_custom_link, pb.CustomLink ) - assigned_object_custom_field = convert_to_protobuf( - assigned_object_custom_field, pb.CustomField + termination_device = convert_to_protobuf(termination_device, pb.Device) + termination_device_bay = convert_to_protobuf( + termination_device_bay, pb.DeviceBay ) - assigned_object_custom_field_choice_set = convert_to_protobuf( - assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet + termination_device_role = convert_to_protobuf( + termination_device_role, pb.DeviceRole ) - assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) - assigned_object_device_bay = convert_to_protobuf( - assigned_object_device_bay, pb.DeviceBay + termination_device_type = convert_to_protobuf( + termination_device_type, pb.DeviceType ) - assigned_object_device_role = convert_to_protobuf( - assigned_object_device_role, pb.DeviceRole + termination_fhrp_group = convert_to_protobuf( + termination_fhrp_group, pb.FHRPGroup ) - assigned_object_device_type = convert_to_protobuf( - assigned_object_device_type, pb.DeviceType + termination_fhrp_group_assignment = convert_to_protobuf( + termination_fhrp_group_assignment, pb.FHRPGroupAssignment ) - assigned_object_fhrp_group = convert_to_protobuf( - assigned_object_fhrp_group, pb.FHRPGroup + termination_front_port = convert_to_protobuf( + termination_front_port, pb.FrontPort ) - assigned_object_fhrp_group_assignment = convert_to_protobuf( - assigned_object_fhrp_group_assignment, pb.FHRPGroupAssignment + termination_ike_policy = convert_to_protobuf( + termination_ike_policy, pb.IKEPolicy ) - assigned_object_front_port = convert_to_protobuf( - assigned_object_front_port, pb.FrontPort + termination_ike_proposal = convert_to_protobuf( + termination_ike_proposal, pb.IKEProposal ) - assigned_object_ike_policy = convert_to_protobuf( - assigned_object_ike_policy, pb.IKEPolicy + termination_ip_address = convert_to_protobuf( + termination_ip_address, pb.IPAddress ) - assigned_object_ike_proposal = convert_to_protobuf( - assigned_object_ike_proposal, pb.IKEProposal + termination_ip_range = convert_to_protobuf(termination_ip_range, pb.IPRange) + termination_ip_sec_policy = convert_to_protobuf( + termination_ip_sec_policy, pb.IPSecPolicy ) - assigned_object_ip_address = convert_to_protobuf( - assigned_object_ip_address, pb.IPAddress + termination_ip_sec_profile = convert_to_protobuf( + termination_ip_sec_profile, pb.IPSecProfile ) - assigned_object_ip_range = convert_to_protobuf( - assigned_object_ip_range, pb.IPRange + termination_ip_sec_proposal = convert_to_protobuf( + termination_ip_sec_proposal, pb.IPSecProposal ) - assigned_object_ip_sec_policy = convert_to_protobuf( - assigned_object_ip_sec_policy, pb.IPSecPolicy + termination_interface = convert_to_protobuf(termination_interface, pb.Interface) + termination_inventory_item = convert_to_protobuf( + termination_inventory_item, pb.InventoryItem ) - assigned_object_ip_sec_profile = convert_to_protobuf( - assigned_object_ip_sec_profile, pb.IPSecProfile + termination_inventory_item_role = convert_to_protobuf( + termination_inventory_item_role, pb.InventoryItemRole ) - assigned_object_ip_sec_proposal = convert_to_protobuf( - assigned_object_ip_sec_proposal, pb.IPSecProposal + termination_journal_entry = convert_to_protobuf( + termination_journal_entry, pb.JournalEntry ) - assigned_object_interface = convert_to_protobuf( - assigned_object_interface, pb.Interface + termination_l2vpn = convert_to_protobuf(termination_l2vpn, pb.L2VPN) + termination_l2vpn_termination = convert_to_protobuf( + termination_l2vpn_termination, pb.L2VPNTermination ) - assigned_object_inventory_item = convert_to_protobuf( - assigned_object_inventory_item, pb.InventoryItem + termination_location = convert_to_protobuf(termination_location, pb.Location) + termination_mac_address = convert_to_protobuf( + termination_mac_address, pb.MACAddress ) - assigned_object_inventory_item_role = convert_to_protobuf( - assigned_object_inventory_item_role, pb.InventoryItemRole + termination_manufacturer = convert_to_protobuf( + termination_manufacturer, pb.Manufacturer ) - assigned_object_journal_entry = convert_to_protobuf( - assigned_object_journal_entry, pb.JournalEntry + termination_module = convert_to_protobuf(termination_module, pb.Module) + termination_module_bay = convert_to_protobuf( + termination_module_bay, pb.ModuleBay ) - assigned_object_l2vpn = convert_to_protobuf(assigned_object_l2vpn, pb.L2VPN) - assigned_object_l2vpn_termination = convert_to_protobuf( - assigned_object_l2vpn_termination, pb.L2VPNTermination + termination_module_type = convert_to_protobuf( + termination_module_type, pb.ModuleType ) - assigned_object_location = convert_to_protobuf( - assigned_object_location, pb.Location + termination_module_type_profile = convert_to_protobuf( + termination_module_type_profile, pb.ModuleTypeProfile ) - assigned_object_mac_address = convert_to_protobuf( - assigned_object_mac_address, pb.MACAddress + termination_owner = convert_to_protobuf(termination_owner, pb.Owner) + termination_owner_group = convert_to_protobuf( + termination_owner_group, pb.OwnerGroup ) - assigned_object_manufacturer = convert_to_protobuf( - assigned_object_manufacturer, pb.Manufacturer + termination_platform = convert_to_protobuf(termination_platform, pb.Platform) + termination_power_feed = convert_to_protobuf( + termination_power_feed, pb.PowerFeed ) - assigned_object_module = convert_to_protobuf(assigned_object_module, pb.Module) - assigned_object_module_bay = convert_to_protobuf( - assigned_object_module_bay, pb.ModuleBay + termination_power_outlet = convert_to_protobuf( + termination_power_outlet, pb.PowerOutlet ) - assigned_object_module_type = convert_to_protobuf( - assigned_object_module_type, pb.ModuleType + termination_power_panel = convert_to_protobuf( + termination_power_panel, pb.PowerPanel ) - assigned_object_module_type_profile = convert_to_protobuf( - assigned_object_module_type_profile, pb.ModuleTypeProfile + termination_power_port = convert_to_protobuf( + termination_power_port, pb.PowerPort ) - assigned_object_platform = convert_to_protobuf( - assigned_object_platform, pb.Platform + termination_prefix = convert_to_protobuf(termination_prefix, pb.Prefix) + termination_provider = convert_to_protobuf(termination_provider, pb.Provider) + termination_provider_account = convert_to_protobuf( + termination_provider_account, pb.ProviderAccount ) - assigned_object_power_feed = convert_to_protobuf( - assigned_object_power_feed, pb.PowerFeed + termination_provider_network = convert_to_protobuf( + termination_provider_network, pb.ProviderNetwork ) - assigned_object_power_outlet = convert_to_protobuf( - assigned_object_power_outlet, pb.PowerOutlet + termination_rir = convert_to_protobuf(termination_rir, pb.RIR) + termination_rack = convert_to_protobuf(termination_rack, pb.Rack) + termination_rack_reservation = convert_to_protobuf( + termination_rack_reservation, pb.RackReservation ) - assigned_object_power_panel = convert_to_protobuf( - assigned_object_power_panel, pb.PowerPanel + termination_rack_role = convert_to_protobuf(termination_rack_role, pb.RackRole) + termination_rack_type = convert_to_protobuf(termination_rack_type, pb.RackType) + termination_rear_port = convert_to_protobuf(termination_rear_port, pb.RearPort) + termination_region = convert_to_protobuf(termination_region, pb.Region) + termination_role = convert_to_protobuf(termination_role, pb.Role) + termination_route_target = convert_to_protobuf( + termination_route_target, pb.RouteTarget ) - assigned_object_power_port = convert_to_protobuf( - assigned_object_power_port, pb.PowerPort + termination_service = convert_to_protobuf(termination_service, pb.Service) + termination_site = convert_to_protobuf(termination_site, pb.Site) + termination_site_group = convert_to_protobuf( + termination_site_group, pb.SiteGroup ) - assigned_object_prefix = convert_to_protobuf(assigned_object_prefix, pb.Prefix) - assigned_object_provider = convert_to_protobuf( - assigned_object_provider, pb.Provider + termination_tag = convert_to_protobuf(termination_tag, pb.Tag) + termination_tenant = convert_to_protobuf(termination_tenant, pb.Tenant) + termination_tenant_group = convert_to_protobuf( + termination_tenant_group, pb.TenantGroup ) - assigned_object_provider_account = convert_to_protobuf( - assigned_object_provider_account, pb.ProviderAccount + termination_tunnel = convert_to_protobuf(termination_tunnel, pb.Tunnel) + termination_tunnel_group = convert_to_protobuf( + termination_tunnel_group, pb.TunnelGroup ) - assigned_object_provider_network = convert_to_protobuf( - assigned_object_provider_network, pb.ProviderNetwork + termination_tunnel_termination = convert_to_protobuf( + termination_tunnel_termination, pb.TunnelTermination ) - assigned_object_rir = convert_to_protobuf(assigned_object_rir, pb.RIR) - assigned_object_rack = convert_to_protobuf(assigned_object_rack, pb.Rack) - assigned_object_rack_reservation = convert_to_protobuf( - assigned_object_rack_reservation, pb.RackReservation + termination_vlan = convert_to_protobuf(termination_vlan, pb.VLAN) + termination_vlan_group = convert_to_protobuf( + termination_vlan_group, pb.VLANGroup ) - assigned_object_rack_role = convert_to_protobuf( - assigned_object_rack_role, pb.RackRole + termination_vlan_translation_policy = convert_to_protobuf( + termination_vlan_translation_policy, pb.VLANTranslationPolicy ) - assigned_object_rack_type = convert_to_protobuf( - assigned_object_rack_type, pb.RackType + termination_vlan_translation_rule = convert_to_protobuf( + termination_vlan_translation_rule, pb.VLANTranslationRule ) - assigned_object_rear_port = convert_to_protobuf( - assigned_object_rear_port, pb.RearPort + termination_vm_interface = convert_to_protobuf( + termination_vm_interface, pb.VMInterface ) - assigned_object_region = convert_to_protobuf(assigned_object_region, pb.Region) - assigned_object_role = convert_to_protobuf(assigned_object_role, pb.Role) - assigned_object_route_target = convert_to_protobuf( - assigned_object_route_target, pb.RouteTarget + termination_vrf = convert_to_protobuf(termination_vrf, pb.VRF) + termination_virtual_chassis = convert_to_protobuf( + termination_virtual_chassis, pb.VirtualChassis ) - assigned_object_service = convert_to_protobuf( - assigned_object_service, pb.Service + termination_virtual_circuit = convert_to_protobuf( + termination_virtual_circuit, pb.VirtualCircuit ) - assigned_object_site = convert_to_protobuf(assigned_object_site, pb.Site) - assigned_object_site_group = convert_to_protobuf( - assigned_object_site_group, pb.SiteGroup + termination_virtual_circuit_termination = convert_to_protobuf( + termination_virtual_circuit_termination, pb.VirtualCircuitTermination ) - assigned_object_tag = convert_to_protobuf(assigned_object_tag, pb.Tag) - assigned_object_tenant = convert_to_protobuf(assigned_object_tenant, pb.Tenant) - assigned_object_tenant_group = convert_to_protobuf( - assigned_object_tenant_group, pb.TenantGroup + termination_virtual_circuit_type = convert_to_protobuf( + termination_virtual_circuit_type, pb.VirtualCircuitType ) - assigned_object_tunnel = convert_to_protobuf(assigned_object_tunnel, pb.Tunnel) - assigned_object_tunnel_group = convert_to_protobuf( - assigned_object_tunnel_group, pb.TunnelGroup + termination_virtual_device_context = convert_to_protobuf( + termination_virtual_device_context, pb.VirtualDeviceContext ) - assigned_object_tunnel_termination = convert_to_protobuf( - assigned_object_tunnel_termination, pb.TunnelTermination + termination_virtual_disk = convert_to_protobuf( + termination_virtual_disk, pb.VirtualDisk ) - assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) - assigned_object_vlan_group = convert_to_protobuf( - assigned_object_vlan_group, pb.VLANGroup + termination_virtual_machine = convert_to_protobuf( + termination_virtual_machine, pb.VirtualMachine ) - assigned_object_vlan_translation_policy = convert_to_protobuf( - assigned_object_vlan_translation_policy, pb.VLANTranslationPolicy + termination_wireless_lan = convert_to_protobuf( + termination_wireless_lan, pb.WirelessLAN ) - assigned_object_vlan_translation_rule = convert_to_protobuf( - assigned_object_vlan_translation_rule, pb.VLANTranslationRule + termination_wireless_lan_group = convert_to_protobuf( + termination_wireless_lan_group, pb.WirelessLANGroup ) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface + termination_wireless_link = convert_to_protobuf( + termination_wireless_link, pb.WirelessLink ) - assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) - assigned_object_virtual_chassis = convert_to_protobuf( - assigned_object_virtual_chassis, pb.VirtualChassis + outside_ip = convert_to_protobuf(outside_ip, pb.IPAddress) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.TunnelTermination( + tunnel=tunnel, + role=role, + termination_asn=termination_asn, + termination_asn_range=termination_asn_range, + termination_aggregate=termination_aggregate, + termination_cable=termination_cable, + termination_cable_path=termination_cable_path, + termination_cable_termination=termination_cable_termination, + termination_circuit=termination_circuit, + termination_circuit_group=termination_circuit_group, + termination_circuit_group_assignment=termination_circuit_group_assignment, + termination_circuit_termination=termination_circuit_termination, + termination_circuit_type=termination_circuit_type, + termination_cluster=termination_cluster, + termination_cluster_group=termination_cluster_group, + termination_cluster_type=termination_cluster_type, + termination_console_port=termination_console_port, + termination_console_server_port=termination_console_server_port, + termination_contact=termination_contact, + termination_contact_assignment=termination_contact_assignment, + termination_contact_group=termination_contact_group, + termination_contact_role=termination_contact_role, + termination_custom_field=termination_custom_field, + termination_custom_field_choice_set=termination_custom_field_choice_set, + termination_custom_link=termination_custom_link, + termination_device=termination_device, + termination_device_bay=termination_device_bay, + termination_device_role=termination_device_role, + termination_device_type=termination_device_type, + termination_fhrp_group=termination_fhrp_group, + termination_fhrp_group_assignment=termination_fhrp_group_assignment, + termination_front_port=termination_front_port, + termination_ike_policy=termination_ike_policy, + termination_ike_proposal=termination_ike_proposal, + termination_ip_address=termination_ip_address, + termination_ip_range=termination_ip_range, + termination_ip_sec_policy=termination_ip_sec_policy, + termination_ip_sec_profile=termination_ip_sec_profile, + termination_ip_sec_proposal=termination_ip_sec_proposal, + termination_interface=termination_interface, + termination_inventory_item=termination_inventory_item, + termination_inventory_item_role=termination_inventory_item_role, + termination_journal_entry=termination_journal_entry, + termination_l2vpn=termination_l2vpn, + termination_l2vpn_termination=termination_l2vpn_termination, + termination_location=termination_location, + termination_mac_address=termination_mac_address, + termination_manufacturer=termination_manufacturer, + termination_module=termination_module, + termination_module_bay=termination_module_bay, + termination_module_type=termination_module_type, + termination_module_type_profile=termination_module_type_profile, + termination_owner=termination_owner, + termination_owner_group=termination_owner_group, + termination_platform=termination_platform, + termination_power_feed=termination_power_feed, + termination_power_outlet=termination_power_outlet, + termination_power_panel=termination_power_panel, + termination_power_port=termination_power_port, + termination_prefix=termination_prefix, + termination_provider=termination_provider, + termination_provider_account=termination_provider_account, + termination_provider_network=termination_provider_network, + termination_rir=termination_rir, + termination_rack=termination_rack, + termination_rack_reservation=termination_rack_reservation, + termination_rack_role=termination_rack_role, + termination_rack_type=termination_rack_type, + termination_rear_port=termination_rear_port, + termination_region=termination_region, + termination_role=termination_role, + termination_route_target=termination_route_target, + termination_service=termination_service, + termination_site=termination_site, + termination_site_group=termination_site_group, + termination_tag=termination_tag, + termination_tenant=termination_tenant, + termination_tenant_group=termination_tenant_group, + termination_tunnel=termination_tunnel, + termination_tunnel_group=termination_tunnel_group, + termination_tunnel_termination=termination_tunnel_termination, + termination_vlan=termination_vlan, + termination_vlan_group=termination_vlan_group, + termination_vlan_translation_policy=termination_vlan_translation_policy, + termination_vlan_translation_rule=termination_vlan_translation_rule, + termination_vm_interface=termination_vm_interface, + termination_vrf=termination_vrf, + termination_virtual_chassis=termination_virtual_chassis, + termination_virtual_circuit=termination_virtual_circuit, + termination_virtual_circuit_termination=termination_virtual_circuit_termination, + termination_virtual_circuit_type=termination_virtual_circuit_type, + termination_virtual_device_context=termination_virtual_device_context, + termination_virtual_disk=termination_virtual_disk, + termination_virtual_machine=termination_virtual_machine, + termination_wireless_lan=termination_wireless_lan, + termination_wireless_lan_group=termination_wireless_lan_group, + termination_wireless_link=termination_wireless_link, + outside_ip=outside_ip, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_virtual_circuit = convert_to_protobuf( - assigned_object_virtual_circuit, pb.VirtualCircuit + return result + + +class VLAN: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLAN.""" + + def __new__( + cls, + site: str | Site | pb.Site | None = None, + group: str | VLANGroup | pb.VLANGroup | None = None, + vid: int | None = None, + name: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + status: str | None = None, + role: str | Role | pb.Role | None = None, + description: str | None = None, + qinq_role: str | None = None, + qinq_svlan: str | VLAN | pb.VLAN | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VLAN: + """Create a new VLAN.""" + site = convert_to_protobuf(site, pb.Site) + group = convert_to_protobuf(group, pb.VLANGroup) + tenant = convert_to_protobuf(tenant, pb.Tenant) + role = convert_to_protobuf(role, pb.Role) + qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VLAN( + site=site, + group=group, + vid=vid, + name=name, + tenant=tenant, + status=status, + role=role, + description=description, + qinq_role=qinq_role, + qinq_svlan=qinq_svlan, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_virtual_circuit_termination = convert_to_protobuf( - assigned_object_virtual_circuit_termination, pb.VirtualCircuitTermination + return result + + +class VLANGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANGroup.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + scope_cluster: str | Cluster | pb.Cluster | None = None, + scope_cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, + scope_location: str | Location | pb.Location | None = None, + scope_rack: str | Rack | pb.Rack | None = None, + scope_region: str | Region | pb.Region | None = None, + scope_site: str | Site | pb.Site | None = None, + scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, + vid_ranges: list[int] | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VLANGroup: + """Create a new VLANGroup.""" + scope_cluster = convert_to_protobuf(scope_cluster, pb.Cluster) + scope_cluster_group = convert_to_protobuf(scope_cluster_group, pb.ClusterGroup) + scope_location = convert_to_protobuf(scope_location, pb.Location) + scope_rack = convert_to_protobuf(scope_rack, pb.Rack) + scope_region = convert_to_protobuf(scope_region, pb.Region) + scope_site = convert_to_protobuf(scope_site, pb.Site) + scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VLANGroup( + name=name, + slug=slug, + scope_cluster=scope_cluster, + scope_cluster_group=scope_cluster_group, + scope_location=scope_location, + scope_rack=scope_rack, + scope_region=scope_region, + scope_site=scope_site, + scope_site_group=scope_site_group, + vid_ranges=vid_ranges, + tenant=tenant, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_virtual_circuit_type = convert_to_protobuf( - assigned_object_virtual_circuit_type, pb.VirtualCircuitType + return result + + +class VLANTranslationPolicy: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANTranslationPolicy.""" + + def __new__( + cls, + name: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VLANTranslationPolicy: + """Create a new VLANTranslationPolicy.""" + owner = convert_to_protobuf(owner, pb.Owner) + metadata = convert_dict_to_struct(metadata) + result = pb.VLANTranslationPolicy( + name=name, + description=description, + owner=owner, + comments=comments, + metadata=metadata, ) - assigned_object_virtual_device_context = convert_to_protobuf( - assigned_object_virtual_device_context, pb.VirtualDeviceContext + return result + + +class VLANTranslationRule: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANTranslationRule.""" + + def __new__( + cls, + policy: str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None = None, + local_vid: int | None = None, + remote_vid: int | None = None, + description: str | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VLANTranslationRule: + """Create a new VLANTranslationRule.""" + policy = convert_to_protobuf(policy, pb.VLANTranslationPolicy) + metadata = convert_dict_to_struct(metadata) + result = pb.VLANTranslationRule( + policy=policy, + local_vid=local_vid, + remote_vid=remote_vid, + description=description, + metadata=metadata, ) - assigned_object_virtual_disk = convert_to_protobuf( - assigned_object_virtual_disk, pb.VirtualDisk + return result + + +class VMInterface: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VMInterface.""" + + def __new__( + cls, + virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, + name: str | None = None, + enabled: bool | None = None, + parent: str | VMInterface | pb.VMInterface | None = None, + bridge: str | VMInterface | pb.VMInterface | None = None, + mtu: int | None = None, + primary_mac_address: str | MACAddress | pb.MACAddress | None = None, + description: str | None = None, + mode: str | None = None, + untagged_vlan: str | VLAN | pb.VLAN | None = None, + tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, + qinq_svlan: str | VLAN | pb.VLAN | None = None, + vlan_translation_policy: ( + str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None + ) = None, + vrf: str | VRF | pb.VRF | None = None, + owner: str | Owner | pb.Owner | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VMInterface: + """Create a new VMInterface.""" + virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) + parent = convert_to_protobuf(parent, pb.VMInterface) + bridge = convert_to_protobuf(bridge, pb.VMInterface) + primary_mac_address = convert_to_protobuf(primary_mac_address, pb.MACAddress) + untagged_vlan = convert_to_protobuf(untagged_vlan, pb.VLAN) + tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) + qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) + vlan_translation_policy = convert_to_protobuf( + vlan_translation_policy, pb.VLANTranslationPolicy ) - assigned_object_virtual_machine = convert_to_protobuf( - assigned_object_virtual_machine, pb.VirtualMachine + vrf = convert_to_protobuf(vrf, pb.VRF) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VMInterface( + virtual_machine=virtual_machine, + name=name, + enabled=enabled, + parent=parent, + bridge=bridge, + mtu=mtu, + primary_mac_address=primary_mac_address, + description=description, + mode=mode, + untagged_vlan=untagged_vlan, + tagged_vlans=tagged_vlans, + qinq_svlan=qinq_svlan, + vlan_translation_policy=vlan_translation_policy, + vrf=vrf, + owner=owner, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_wireless_lan = convert_to_protobuf( - assigned_object_wireless_lan, pb.WirelessLAN + return result + + +class VRF: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VRF.""" + + def __new__( + cls, + name: str | None = None, + rd: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + enforce_unique: bool | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, + export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VRF: + """Create a new VRF.""" + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) + export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VRF( + name=name, + rd=rd, + tenant=tenant, + enforce_unique=enforce_unique, + description=description, + owner=owner, + comments=comments, + import_targets=import_targets, + export_targets=export_targets, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_wireless_lan_group = convert_to_protobuf( - assigned_object_wireless_lan_group, pb.WirelessLANGroup + return result + + +class VirtualChassis: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualChassis.""" + + def __new__( + cls, + name: str | None = None, + domain: str | None = None, + master: str | Device | pb.Device | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualChassis: + """Create a new VirtualChassis.""" + master = convert_to_protobuf(master, pb.Device) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VirtualChassis( + name=name, + domain=domain, + master=master, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_wireless_link = convert_to_protobuf( - assigned_object_wireless_link, pb.WirelessLink + return result + + +class VirtualCircuit: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuit.""" + + def __new__( + cls, + cid: str | None = None, + provider_network: str | ProviderNetwork | pb.ProviderNetwork | None = None, + provider_account: str | ProviderAccount | pb.ProviderAccount | None = None, + type: str | VirtualCircuitType | pb.VirtualCircuitType | None = None, + status: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualCircuit: + """Create a new VirtualCircuit.""" + provider_network = convert_to_protobuf(provider_network, pb.ProviderNetwork) + provider_account = convert_to_protobuf(provider_account, pb.ProviderAccount) + type = convert_to_protobuf(type, pb.VirtualCircuitType) + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VirtualCircuit( + cid=cid, + provider_network=provider_network, + provider_account=provider_account, + type=type, + status=status, + tenant=tenant, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_custom_link = convert_to_protobuf( - assigned_object_custom_link, pb.CustomLink + return result + + +class VirtualCircuitTermination: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuitTermination.""" + + def __new__( + cls, + virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, + role: str | None = None, + interface: str | Interface | pb.Interface | None = None, + description: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualCircuitTermination: + """Create a new VirtualCircuitTermination.""" + virtual_circuit = convert_to_protobuf(virtual_circuit, pb.VirtualCircuit) + interface = convert_to_protobuf(interface, pb.Interface) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VirtualCircuitTermination( + virtual_circuit=virtual_circuit, + role=role, + interface=interface, + description=description, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) - assigned_object_owner_group = convert_to_protobuf( - assigned_object_owner_group, pb.OwnerGroup + return result + + +class VirtualCircuitType: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuitType.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + color: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualCircuitType: + """Create a new VirtualCircuitType.""" + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VirtualCircuitType( + name=name, + slug=slug, + color=color, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) + return result + + +class VirtualDeviceContext: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDeviceContext.""" + + def __new__( + cls, + name: str | None = None, + device: str | Device | pb.Device | None = None, + identifier: int | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + primary_ip4: str | IPAddress | pb.IPAddress | None = None, + primary_ip6: str | IPAddress | pb.IPAddress | None = None, + status: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualDeviceContext: + """Create a new VirtualDeviceContext.""" + device = convert_to_protobuf(device, pb.Device) + tenant = convert_to_protobuf(tenant, pb.Tenant) + primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) + primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.JournalEntry( - assigned_object_asn=assigned_object_asn, - assigned_object_asn_range=assigned_object_asn_range, - assigned_object_aggregate=assigned_object_aggregate, - assigned_object_cable=assigned_object_cable, - assigned_object_cable_path=assigned_object_cable_path, - assigned_object_cable_termination=assigned_object_cable_termination, - assigned_object_circuit=assigned_object_circuit, - assigned_object_circuit_group=assigned_object_circuit_group, - assigned_object_circuit_group_assignment=assigned_object_circuit_group_assignment, - assigned_object_circuit_termination=assigned_object_circuit_termination, - assigned_object_circuit_type=assigned_object_circuit_type, - assigned_object_cluster=assigned_object_cluster, - assigned_object_cluster_group=assigned_object_cluster_group, - assigned_object_cluster_type=assigned_object_cluster_type, - assigned_object_console_port=assigned_object_console_port, - assigned_object_console_server_port=assigned_object_console_server_port, - assigned_object_contact=assigned_object_contact, - assigned_object_contact_assignment=assigned_object_contact_assignment, - assigned_object_contact_group=assigned_object_contact_group, - assigned_object_contact_role=assigned_object_contact_role, - assigned_object_custom_field=assigned_object_custom_field, - assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, - assigned_object_device=assigned_object_device, - assigned_object_device_bay=assigned_object_device_bay, - assigned_object_device_role=assigned_object_device_role, - assigned_object_device_type=assigned_object_device_type, - assigned_object_fhrp_group=assigned_object_fhrp_group, - assigned_object_fhrp_group_assignment=assigned_object_fhrp_group_assignment, - assigned_object_front_port=assigned_object_front_port, - assigned_object_ike_policy=assigned_object_ike_policy, - assigned_object_ike_proposal=assigned_object_ike_proposal, - assigned_object_ip_address=assigned_object_ip_address, - assigned_object_ip_range=assigned_object_ip_range, - assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, - assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, - assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, - assigned_object_interface=assigned_object_interface, - assigned_object_inventory_item=assigned_object_inventory_item, - assigned_object_inventory_item_role=assigned_object_inventory_item_role, - assigned_object_journal_entry=assigned_object_journal_entry, - assigned_object_l2vpn=assigned_object_l2vpn, - assigned_object_l2vpn_termination=assigned_object_l2vpn_termination, - assigned_object_location=assigned_object_location, - assigned_object_mac_address=assigned_object_mac_address, - assigned_object_manufacturer=assigned_object_manufacturer, - assigned_object_module=assigned_object_module, - assigned_object_module_bay=assigned_object_module_bay, - assigned_object_module_type=assigned_object_module_type, - assigned_object_module_type_profile=assigned_object_module_type_profile, - assigned_object_platform=assigned_object_platform, - assigned_object_power_feed=assigned_object_power_feed, - assigned_object_power_outlet=assigned_object_power_outlet, - assigned_object_power_panel=assigned_object_power_panel, - assigned_object_power_port=assigned_object_power_port, - assigned_object_prefix=assigned_object_prefix, - assigned_object_provider=assigned_object_provider, - assigned_object_provider_account=assigned_object_provider_account, - assigned_object_provider_network=assigned_object_provider_network, - assigned_object_rir=assigned_object_rir, - assigned_object_rack=assigned_object_rack, - assigned_object_rack_reservation=assigned_object_rack_reservation, - assigned_object_rack_role=assigned_object_rack_role, - assigned_object_rack_type=assigned_object_rack_type, - assigned_object_rear_port=assigned_object_rear_port, - assigned_object_region=assigned_object_region, - assigned_object_role=assigned_object_role, - assigned_object_route_target=assigned_object_route_target, - assigned_object_service=assigned_object_service, - assigned_object_site=assigned_object_site, - assigned_object_site_group=assigned_object_site_group, - assigned_object_tag=assigned_object_tag, - assigned_object_tenant=assigned_object_tenant, - assigned_object_tenant_group=assigned_object_tenant_group, - assigned_object_tunnel=assigned_object_tunnel, - assigned_object_tunnel_group=assigned_object_tunnel_group, - assigned_object_tunnel_termination=assigned_object_tunnel_termination, - assigned_object_vlan=assigned_object_vlan, - assigned_object_vlan_group=assigned_object_vlan_group, - assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, - assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, - assigned_object_vm_interface=assigned_object_vm_interface, - assigned_object_vrf=assigned_object_vrf, - assigned_object_virtual_chassis=assigned_object_virtual_chassis, - assigned_object_virtual_circuit=assigned_object_virtual_circuit, - assigned_object_virtual_circuit_termination=assigned_object_virtual_circuit_termination, - assigned_object_virtual_circuit_type=assigned_object_virtual_circuit_type, - assigned_object_virtual_device_context=assigned_object_virtual_device_context, - assigned_object_virtual_disk=assigned_object_virtual_disk, - assigned_object_virtual_machine=assigned_object_virtual_machine, - assigned_object_wireless_lan=assigned_object_wireless_lan, - assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, - assigned_object_wireless_link=assigned_object_wireless_link, - assigned_object_custom_link=assigned_object_custom_link, - assigned_object_owner=assigned_object_owner, - assigned_object_owner_group=assigned_object_owner_group, - kind=kind, + result = pb.VirtualDeviceContext( + name=name, + device=device, + identifier=identifier, + tenant=tenant, + primary_ip4=primary_ip4, + primary_ip6=primary_ip6, + status=status, + description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, @@ -7806,112 +7548,268 @@ def __new__( return result -class ModuleTypeProfile: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleTypeProfile.""" +class VirtualDisk: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDisk.""" def __new__( cls, + virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, name: str | None = None, description: str | None = None, - schema: str | None = None, - comments: str | None = None, + size: int | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, custom_fields: ( dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.ModuleTypeProfile: - """Create a new ModuleTypeProfile.""" + ) -> pb.VirtualDisk: + """Create a new VirtualDisk.""" + virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.ModuleTypeProfile( + result = pb.VirtualDisk( + virtual_machine=virtual_machine, name=name, description=description, - schema=schema, - comments=comments, + size=size, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class CustomLink: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomLink.""" +class VirtualMachine: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualMachine.""" def __new__( cls, name: str | None = None, - enabled: bool | None = None, - link_text: str | None = None, - link_url: str | None = None, - weight: int | None = None, - group_name: str | None = None, - button_class: str | None = None, - new_window: bool | None = None, - object_types: list[str] | None = None, - metadata: dict[str, Any] | None = None, + status: str | None = None, + start_on_boot: str | None = None, + site: str | Site | pb.Site | None = None, + cluster: str | Cluster | pb.Cluster | None = None, + device: str | Device | pb.Device | None = None, + serial: str | None = None, + role: str | DeviceRole | pb.DeviceRole | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + platform: str | Platform | pb.Platform | None = None, + primary_ip4: str | IPAddress | pb.IPAddress | None = None, + primary_ip6: str | IPAddress | pb.IPAddress | None = None, + vcpus: float | None = None, + memory: int | None = None, + disk: int | None = None, + description: str | None = None, owner: str | Owner | pb.Owner | None = None, - ) -> pb.CustomLink: - """Create a new CustomLink.""" - metadata = convert_dict_to_struct(metadata) + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualMachine: + """Create a new VirtualMachine.""" + site = convert_to_protobuf(site, pb.Site) + cluster = convert_to_protobuf(cluster, pb.Cluster) + device = convert_to_protobuf(device, pb.Device) + role = convert_to_protobuf(role, pb.DeviceRole) + tenant = convert_to_protobuf(tenant, pb.Tenant) + platform = convert_to_protobuf(platform, pb.Platform) + primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) + primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) owner = convert_to_protobuf(owner, pb.Owner) - result = pb.CustomLink( + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + + # apply shortcuts + if platform is not None: + if device is not None and not device.HasField("platform"): + device.platform.CopyFrom(platform) + if site is not None: + if device is not None and not device.HasField("site"): + device.site.CopyFrom(site) + if cluster is not None and not cluster.HasField("scope_site"): + cluster.scope_site.CopyFrom(site) + if role is not None: + if device is not None and not device.HasField("role"): + device.role.CopyFrom(role) + result = pb.VirtualMachine( name=name, - enabled=enabled, - link_text=link_text, - link_url=link_url, - weight=weight, - group_name=group_name, - button_class=button_class, - new_window=new_window, - object_types=object_types, + status=status, + start_on_boot=start_on_boot, + site=site, + cluster=cluster, + device=device, + serial=serial, + role=role, + tenant=tenant, + platform=platform, + primary_ip4=primary_ip4, + primary_ip6=primary_ip6, + vcpus=vcpus, + memory=memory, + disk=disk, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, metadata=metadata, + ) + return result + + +class WirelessLAN: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLAN.""" + + def __new__( + cls, + ssid: str | None = None, + description: str | None = None, + group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, + status: str | None = None, + vlan: str | VLAN | pb.VLAN | None = None, + scope_location: str | Location | pb.Location | None = None, + scope_region: str | Region | pb.Region | None = None, + scope_site: str | Site | pb.Site | None = None, + scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + auth_type: str | None = None, + auth_cipher: str | None = None, + auth_psk: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.WirelessLAN: + """Create a new WirelessLAN.""" + group = convert_to_protobuf(group, pb.WirelessLANGroup) + vlan = convert_to_protobuf(vlan, pb.VLAN) + scope_location = convert_to_protobuf(scope_location, pb.Location) + scope_region = convert_to_protobuf(scope_region, pb.Region) + scope_site = convert_to_protobuf(scope_site, pb.Site) + scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.WirelessLAN( + ssid=ssid, + description=description, + group=group, + status=status, + vlan=vlan, + scope_location=scope_location, + scope_region=scope_region, + scope_site=scope_site, + scope_site_group=scope_site_group, + tenant=tenant, + auth_type=auth_type, + auth_cipher=auth_cipher, + auth_psk=auth_psk, owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) return result -class Owner: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Owner.""" +class WirelessLANGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLANGroup.""" def __new__( cls, name: str | None = None, - group: str | OwnerGroup | pb.OwnerGroup | None = None, + slug: str | None = None, + parent: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, description: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.Owner: - """Create a new Owner.""" - group = convert_to_protobuf(group, pb.OwnerGroup) + ) -> pb.WirelessLANGroup: + """Create a new WirelessLANGroup.""" + parent = convert_to_protobuf(parent, pb.WirelessLANGroup) + tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.Owner( + result = pb.WirelessLANGroup( name=name, - group=group, + slug=slug, + parent=parent, description=description, + tags=tags, + owner=owner, + comments=comments, + custom_fields=custom_fields, metadata=metadata, ) return result -class OwnerGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.OwnerGroup.""" +class WirelessLink: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLink.""" def __new__( cls, - name: str | None = None, + interface_a: str | Interface | pb.Interface | None = None, + interface_b: str | Interface | pb.Interface | None = None, + ssid: str | None = None, + status: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + auth_type: str | None = None, + auth_cipher: str | None = None, + auth_psk: str | None = None, + distance: float | None = None, + distance_unit: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.OwnerGroup: - """Create a new OwnerGroup.""" + ) -> pb.WirelessLink: + """Create a new WirelessLink.""" + interface_a = convert_to_protobuf(interface_a, pb.Interface) + interface_b = convert_to_protobuf(interface_b, pb.Interface) + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.OwnerGroup( - name=name, + result = pb.WirelessLink( + interface_a=interface_a, + interface_b=interface_b, + ssid=ssid, + status=status, + tenant=tenant, + auth_type=auth_type, + auth_cipher=auth_cipher, + auth_psk=auth_psk, + distance=distance, + distance_unit=distance_unit, description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, metadata=metadata, ) return result From cbd8da14ef3e50669d88e7628887d695059d637b Mon Sep 17 00:00:00 2001 From: Paul Stuart Date: Wed, 4 Feb 2026 18:08:41 -0800 Subject: [PATCH 3/8] use latest ingester --- netboxlabs/diode/sdk/ingester.py | 3894 +++++++++++++++--------------- 1 file changed, 1911 insertions(+), 1983 deletions(-) diff --git a/netboxlabs/diode/sdk/ingester.py b/netboxlabs/diode/sdk/ingester.py index 5ef9829..2ff6094 100644 --- a/netboxlabs/diode/sdk/ingester.py +++ b/netboxlabs/diode/sdk/ingester.py @@ -2,8 +2,7 @@ # # Generated code. DO NOT EDIT. -# Source: NetBox v4.5.0 -# Timestamp: 2026-02-05 00:39:18Z +# Timestamp: 2026-02-02 16:58:59Z # # ruff: noqa: C901 @@ -32,9 +31,6 @@ "Contact": "name", "ContactGroup": "name", "ContactRole": "name", - "CustomField": "name", - "CustomFieldChoiceSet": "name", - "CustomLink": "name", "Device": "name", "DeviceBay": "name", "DeviceRole": "name", @@ -56,9 +52,6 @@ "Manufacturer": "name", "ModuleBay": "name", "ModuleType": "model", - "ModuleTypeProfile": "name", - "Owner": "name", - "OwnerGroup": "name", "Platform": "name", "PowerFeed": "name", "PowerOutlet": "name", @@ -97,6 +90,12 @@ "VirtualMachine": "name", "WirelessLAN": "ssid", "WirelessLANGroup": "name", + "CustomField": "name", + "CustomFieldChoiceSet": "name", + "ModuleTypeProfile": "name", + "CustomLink": "name", + "Owner": "name", + "OwnerGroup": "name", } @@ -163,17 +162,16 @@ def __new__( timestamp: datetime.datetime | None = None, asn: str | ASN | pb.ASN | None = None, asn_range: str | ASNRange | pb.ASNRange | None = None, - aggregate: str | Aggregate | pb.Aggregate | None = None, - cable: str | Cable | pb.Cable | None = None, - cable_path: str | CablePath | pb.CablePath | None = None, + aggregate: Aggregate | pb.Aggregate | None = None, + cable: Cable | pb.Cable | None = None, + cable_path: CablePath | pb.CablePath | None = None, + cable_termination: CableTermination | pb.CableTermination | None = None, circuit: str | Circuit | pb.Circuit | None = None, circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None - ) = None, - circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, + circuit_termination: CircuitTermination | pb.CircuitTermination | None = None, circuit_type: str | CircuitType | pb.CircuitType | None = None, cluster: str | Cluster | pb.Cluster | None = None, cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, @@ -183,29 +181,22 @@ def __new__( str | ConsoleServerPort | pb.ConsoleServerPort | None ) = None, contact: str | Contact | pb.Contact | None = None, - contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None - ) = None, + contact_assignment: ContactAssignment | pb.ContactAssignment | None = None, contact_group: str | ContactGroup | pb.ContactGroup | None = None, contact_role: str | ContactRole | pb.ContactRole | None = None, - custom_field: str | CustomField | pb.CustomField | None = None, - custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - custom_link: str | CustomLink | pb.CustomLink | None = None, device: str | Device | pb.Device | None = None, device_bay: str | DeviceBay | pb.DeviceBay | None = None, device_role: str | DeviceRole | pb.DeviceRole | None = None, device_type: str | DeviceType | pb.DeviceType | None = None, fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, front_port: str | FrontPort | pb.FrontPort | None = None, ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, ip_address: str | IPAddress | pb.IPAddress | None = None, - ip_range: str | IPRange | pb.IPRange | None = None, + ip_range: IPRange | pb.IPRange | None = None, ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -214,20 +205,14 @@ def __new__( inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - journal_entry: str | JournalEntry | pb.JournalEntry | None = None, l2vpn: str | L2VPN | pb.L2VPN | None = None, - l2vpn_termination: str | L2VPNTermination | pb.L2VPNTermination | None = None, + l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, location: str | Location | pb.Location | None = None, mac_address: str | MACAddress | pb.MACAddress | None = None, manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, module_bay: str | ModuleBay | pb.ModuleBay | None = None, module_type: str | ModuleType | pb.ModuleType | None = None, - module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - owner: str | Owner | pb.Owner | None = None, - owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, platform: str | Platform | pb.Platform | None = None, power_feed: str | PowerFeed | pb.PowerFeed | None = None, power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -239,7 +224,7 @@ def __new__( provider_network: str | ProviderNetwork | pb.ProviderNetwork | None = None, rir: str | RIR | pb.RIR | None = None, rack: str | Rack | pb.Rack | None = None, - rack_reservation: str | RackReservation | pb.RackReservation | None = None, + rack_reservation: RackReservation | pb.RackReservation | None = None, rack_role: str | RackRole | pb.RackRole | None = None, rack_type: str | RackType | pb.RackType | None = None, rear_port: str | RearPort | pb.RearPort | None = None, @@ -254,23 +239,21 @@ def __new__( tenant_group: str | TenantGroup | pb.TenantGroup | None = None, tunnel: str | Tunnel | pb.Tunnel | None = None, tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None - ) = None, + tunnel_termination: TunnelTermination | pb.TunnelTermination | None = None, vlan: str | VLAN | pb.VLAN | None = None, vlan_group: str | VLANGroup | pb.VLANGroup | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, vm_interface: str | VMInterface | pb.VMInterface | None = None, vrf: str | VRF | pb.VRF | None = None, virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -282,7 +265,19 @@ def __new__( virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, wireless_lan_group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, - wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + wireless_link: WirelessLink | pb.WirelessLink | None = None, + custom_field: str | CustomField | pb.CustomField | None = None, + custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + journal_entry: JournalEntry | pb.JournalEntry | None = None, + module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + custom_link: str | CustomLink | pb.CustomLink | None = None, + owner: str | Owner | pb.Owner | None = None, + owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + device_config: DeviceConfig | pb.DeviceConfig | None = None, ) -> pb.Entity: """Create a new Entity.""" asn = convert_to_protobuf(asn, pb.ASN) @@ -290,6 +285,7 @@ def __new__( aggregate = convert_to_protobuf(aggregate, pb.Aggregate) cable = convert_to_protobuf(cable, pb.Cable) cable_path = convert_to_protobuf(cable_path, pb.CablePath) + cable_termination = convert_to_protobuf(cable_termination, pb.CableTermination) circuit = convert_to_protobuf(circuit, pb.Circuit) circuit_group = convert_to_protobuf(circuit_group, pb.CircuitGroup) circuit_group_assignment = convert_to_protobuf( @@ -312,11 +308,6 @@ def __new__( ) contact_group = convert_to_protobuf(contact_group, pb.ContactGroup) contact_role = convert_to_protobuf(contact_role, pb.ContactRole) - custom_field = convert_to_protobuf(custom_field, pb.CustomField) - custom_field_choice_set = convert_to_protobuf( - custom_field_choice_set, pb.CustomFieldChoiceSet - ) - custom_link = convert_to_protobuf(custom_link, pb.CustomLink) device = convert_to_protobuf(device, pb.Device) device_bay = convert_to_protobuf(device_bay, pb.DeviceBay) device_role = convert_to_protobuf(device_role, pb.DeviceRole) @@ -338,7 +329,6 @@ def __new__( inventory_item_role = convert_to_protobuf( inventory_item_role, pb.InventoryItemRole ) - journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) l2vpn_termination = convert_to_protobuf(l2vpn_termination, pb.L2VPNTermination) location = convert_to_protobuf(location, pb.Location) @@ -347,11 +337,6 @@ def __new__( module = convert_to_protobuf(module, pb.Module) module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) module_type = convert_to_protobuf(module_type, pb.ModuleType) - module_type_profile = convert_to_protobuf( - module_type_profile, pb.ModuleTypeProfile - ) - owner = convert_to_protobuf(owner, pb.Owner) - owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) platform = convert_to_protobuf(platform, pb.Platform) power_feed = convert_to_protobuf(power_feed, pb.PowerFeed) power_outlet = convert_to_protobuf(power_outlet, pb.PowerOutlet) @@ -409,6 +394,18 @@ def __new__( wireless_lan_group, pb.WirelessLANGroup ) wireless_link = convert_to_protobuf(wireless_link, pb.WirelessLink) + custom_field = convert_to_protobuf(custom_field, pb.CustomField) + custom_field_choice_set = convert_to_protobuf( + custom_field_choice_set, pb.CustomFieldChoiceSet + ) + journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) + module_type_profile = convert_to_protobuf( + module_type_profile, pb.ModuleTypeProfile + ) + custom_link = convert_to_protobuf(custom_link, pb.CustomLink) + owner = convert_to_protobuf(owner, pb.Owner) + owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) + device_config = convert_to_protobuf(device_config, pb.DeviceConfig) if timestamp is None: ts = _timestamp_pb2.Timestamp() ts.GetCurrentTime() @@ -420,6 +417,7 @@ def __new__( aggregate=aggregate, cable=cable, cable_path=cable_path, + cable_termination=cable_termination, circuit=circuit, circuit_group=circuit_group, circuit_group_assignment=circuit_group_assignment, @@ -434,9 +432,6 @@ def __new__( contact_assignment=contact_assignment, contact_group=contact_group, contact_role=contact_role, - custom_field=custom_field, - custom_field_choice_set=custom_field_choice_set, - custom_link=custom_link, device=device, device_bay=device_bay, device_role=device_role, @@ -454,7 +449,6 @@ def __new__( interface=interface, inventory_item=inventory_item, inventory_item_role=inventory_item_role, - journal_entry=journal_entry, l2vpn=l2vpn, l2vpn_termination=l2vpn_termination, location=location, @@ -463,9 +457,6 @@ def __new__( module=module, module_bay=module_bay, module_type=module_type, - module_type_profile=module_type_profile, - owner=owner, - owner_group=owner_group, platform=platform, power_feed=power_feed, power_outlet=power_outlet, @@ -509,6 +500,14 @@ def __new__( wireless_lan=wireless_lan, wireless_lan_group=wireless_lan_group, wireless_link=wireless_link, + custom_field=custom_field, + custom_field_choice_set=custom_field_choice_set, + journal_entry=journal_entry, + module_type_profile=module_type_profile, + custom_link=custom_link, + owner=owner, + owner_group=owner_group, + device_config=device_config, ) return result @@ -522,34 +521,32 @@ def __new__( rir: str | RIR | pb.RIR | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - sites: list[str | Site | pb.Site] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + sites: list[str | Site | pb.Site] | None = None, ) -> pb.ASN: """Create a new ASN.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) - sites = convert_to_protobuf_list(sites, pb.Site) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + sites = convert_to_protobuf_list(sites, pb.Site) result = pb.ASN( asn=asn, rir=rir, tenant=tenant, description=description, - owner=owner, comments=comments, tags=tags, - sites=sites, custom_fields=custom_fields, metadata=metadata, + owner=owner, + sites=sites, ) return result @@ -566,21 +563,19 @@ def __new__( end: int | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.ASNRange: """Create a new ASNRange.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ASNRange( name=name, slug=slug, @@ -589,11 +584,11 @@ def __new__( end=end, tenant=tenant, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -608,32 +603,30 @@ def __new__( tenant: str | Tenant | pb.Tenant | None = None, date_added: datetime.datetime | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Aggregate: """Create a new Aggregate.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Aggregate( prefix=prefix, rir=rir, tenant=tenant, date_added=date_added, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -644,49 +637,47 @@ class Cable: def __new__( cls, type: str | None = None, - a_terminations: list[str | GenericObject | pb.GenericObject] | None = None, - b_terminations: list[str | GenericObject | pb.GenericObject] | None = None, + a_terminations: list[GenericObject | pb.GenericObject] | None = None, + b_terminations: list[GenericObject | pb.GenericObject] | None = None, status: str | None = None, - profile: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, label: str | None = None, color: str | None = None, length: float | None = None, length_unit: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + profile: str | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Cable: """Create a new Cable.""" a_terminations = convert_to_protobuf_list(a_terminations, pb.GenericObject) b_terminations = convert_to_protobuf_list(b_terminations, pb.GenericObject) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Cable( type=type, a_terminations=a_terminations, b_terminations=b_terminations, status=status, - profile=profile, tenant=tenant, label=label, color=color, length=length, length_unit=length_unit, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + profile=profile, + owner=owner, ) return result @@ -712,6 +703,71 @@ def __new__( return result +class CableTermination: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CableTermination.""" + + def __new__( + cls, + cable: Cable | pb.Cable | None = None, + cable_end: str | None = None, + termination_circuit_termination: ( + CircuitTermination | pb.CircuitTermination | None + ) = None, + termination_console_port: str | ConsolePort | pb.ConsolePort | None = None, + termination_console_server_port: ( + str | ConsoleServerPort | pb.ConsoleServerPort | None + ) = None, + termination_front_port: str | FrontPort | pb.FrontPort | None = None, + termination_interface: str | Interface | pb.Interface | None = None, + termination_power_feed: str | PowerFeed | pb.PowerFeed | None = None, + termination_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, + termination_power_port: str | PowerPort | pb.PowerPort | None = None, + termination_rear_port: str | RearPort | pb.RearPort | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.CableTermination: + """Create a new CableTermination.""" + cable = convert_to_protobuf(cable, pb.Cable) + termination_circuit_termination = convert_to_protobuf( + termination_circuit_termination, pb.CircuitTermination + ) + termination_console_port = convert_to_protobuf( + termination_console_port, pb.ConsolePort + ) + termination_console_server_port = convert_to_protobuf( + termination_console_server_port, pb.ConsoleServerPort + ) + termination_front_port = convert_to_protobuf( + termination_front_port, pb.FrontPort + ) + termination_interface = convert_to_protobuf(termination_interface, pb.Interface) + termination_power_feed = convert_to_protobuf( + termination_power_feed, pb.PowerFeed + ) + termination_power_outlet = convert_to_protobuf( + termination_power_outlet, pb.PowerOutlet + ) + termination_power_port = convert_to_protobuf( + termination_power_port, pb.PowerPort + ) + termination_rear_port = convert_to_protobuf(termination_rear_port, pb.RearPort) + metadata = convert_dict_to_struct(metadata) + result = pb.CableTermination( + cable=cable, + cable_end=cable_end, + termination_circuit_termination=termination_circuit_termination, + termination_console_port=termination_console_port, + termination_console_server_port=termination_console_server_port, + termination_front_port=termination_front_port, + termination_interface=termination_interface, + termination_power_feed=termination_power_feed, + termination_power_outlet=termination_power_outlet, + termination_power_port=termination_power_port, + termination_rear_port=termination_rear_port, + metadata=metadata, + ) + return result + + class Circuit: """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Circuit.""" @@ -729,27 +785,25 @@ def __new__( description: str | None = None, distance: float | None = None, distance_unit: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, assignments: ( - list[str | CircuitGroupAssignment | pb.CircuitGroupAssignment] | None - ) = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + list[CircuitGroupAssignment | pb.CircuitGroupAssignment] | None ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Circuit: """Create a new Circuit.""" provider = convert_to_protobuf(provider, pb.Provider) provider_account = convert_to_protobuf(provider_account, pb.ProviderAccount) type = convert_to_protobuf(type, pb.CircuitType) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) assignments = convert_to_protobuf_list(assignments, pb.CircuitGroupAssignment) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Circuit( cid=cid, provider=provider, @@ -763,12 +817,12 @@ def __new__( description=description, distance=distance, distance_unit=distance_unit, - owner=owner, comments=comments, tags=tags, assignments=assignments, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -782,30 +836,28 @@ def __new__( slug: str | None = None, description: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.CircuitGroup: """Create a new CircuitGroup.""" tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.CircuitGroup( name=name, slug=slug, description=description, tenant=tenant, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -862,9 +914,7 @@ def __new__( description: str | None = None, mark_connected: bool | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, ) -> pb.CircuitTermination: """Create a new CircuitTermination.""" @@ -911,29 +961,27 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.CircuitType: """Create a new CircuitType.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.CircuitType( name=name, slug=slug, color=color, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -953,13 +1001,11 @@ def __new__( scope_site: str | Site | pb.Site | None = None, scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Cluster: """Create a new Cluster.""" type = convert_to_protobuf(type, pb.ClusterType) @@ -969,10 +1015,10 @@ def __new__( scope_region = convert_to_protobuf(scope_region, pb.Region) scope_site = convert_to_protobuf(scope_site, pb.Site) scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Cluster( name=name, type=type, @@ -984,11 +1030,11 @@ def __new__( scope_site=scope_site, scope_site_group=scope_site_group, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -1001,28 +1047,26 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.ClusterGroup: """Create a new ClusterGroup.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ClusterGroup( name=name, slug=slug, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -1035,28 +1079,26 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.ClusterType: """Create a new ClusterType.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ClusterType( name=name, slug=slug, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -1067,27 +1109,25 @@ class ConsolePort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, speed: int | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ConsolePort: """Create a new ConsolePort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ConsolePort( device=device, module=module, @@ -1097,10 +1137,10 @@ def __new__( speed=speed, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -1111,27 +1151,25 @@ class ConsoleServerPort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, speed: int | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ConsoleServerPort: """Create a new ConsoleServerPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ConsoleServerPort( device=device, module=module, @@ -1141,10 +1179,10 @@ def __new__( speed=speed, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -1154,7 +1192,7 @@ class Contact: def __new__( cls, - groups: list[str | ContactGroup | pb.ContactGroup] | None = None, + group: str | ContactGroup | pb.ContactGroup | None = None, name: str | None = None, title: str | None = None, phone: str | None = None, @@ -1162,22 +1200,22 @@ def __new__( address: str | None = None, link: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + groups: list[str | ContactGroup | pb.ContactGroup] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Contact: """Create a new Contact.""" - groups = convert_to_protobuf_list(groups, pb.ContactGroup) - owner = convert_to_protobuf(owner, pb.Owner) + group = convert_to_protobuf(group, pb.ContactGroup) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + groups = convert_to_protobuf_list(groups, pb.ContactGroup) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Contact( - groups=groups, + group=group, name=name, title=title, phone=phone, @@ -1185,11 +1223,12 @@ def __new__( address=address, link=link, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + groups=groups, metadata=metadata, + owner=owner, ) return result @@ -1201,19 +1240,17 @@ def __new__( cls, object_asn: str | ASN | pb.ASN | None = None, object_asn_range: str | ASNRange | pb.ASNRange | None = None, - object_aggregate: str | Aggregate | pb.Aggregate | None = None, - object_cable: str | Cable | pb.Cable | None = None, - object_cable_path: str | CablePath | pb.CablePath | None = None, - object_cable_termination: ( - str | CableTermination | pb.CableTermination | None - ) = None, + object_aggregate: Aggregate | pb.Aggregate | None = None, + object_cable: Cable | pb.Cable | None = None, + object_cable_path: CablePath | pb.CablePath | None = None, + object_cable_termination: CableTermination | pb.CableTermination | None = None, object_circuit: str | Circuit | pb.Circuit | None = None, object_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, object_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, object_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitTermination | pb.CircuitTermination | None ) = None, object_circuit_type: str | CircuitType | pb.CircuitType | None = None, object_cluster: str | Cluster | pb.Cluster | None = None, @@ -1225,28 +1262,23 @@ def __new__( ) = None, object_contact: str | Contact | pb.Contact | None = None, object_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None + ContactAssignment | pb.ContactAssignment | None ) = None, object_contact_group: str | ContactGroup | pb.ContactGroup | None = None, object_contact_role: str | ContactRole | pb.ContactRole | None = None, - object_custom_field: str | CustomField | pb.CustomField | None = None, - object_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - object_custom_link: str | CustomLink | pb.CustomLink | None = None, object_device: str | Device | pb.Device | None = None, object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, object_device_role: str | DeviceRole | pb.DeviceRole | None = None, object_device_type: str | DeviceType | pb.DeviceType | None = None, object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, object_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, object_front_port: str | FrontPort | pb.FrontPort | None = None, object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, object_ip_address: str | IPAddress | pb.IPAddress | None = None, - object_ip_range: str | IPRange | pb.IPRange | None = None, + object_ip_range: IPRange | pb.IPRange | None = None, object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, object_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, object_ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -1255,22 +1287,14 @@ def __new__( object_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - object_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, object_l2vpn: str | L2VPN | pb.L2VPN | None = None, - object_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None - ) = None, + object_l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, object_location: str | Location | pb.Location | None = None, object_mac_address: str | MACAddress | pb.MACAddress | None = None, object_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - object_module: str | Module | pb.Module | None = None, + object_module: Module | pb.Module | None = None, object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, object_module_type: str | ModuleType | pb.ModuleType | None = None, - object_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - object_owner: str | Owner | pb.Owner | None = None, - object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, object_platform: str | Platform | pb.Platform | None = None, object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -1286,9 +1310,7 @@ def __new__( ) = None, object_rir: str | RIR | pb.RIR | None = None, object_rack: str | Rack | pb.Rack | None = None, - object_rack_reservation: ( - str | RackReservation | pb.RackReservation | None - ) = None, + object_rack_reservation: RackReservation | pb.RackReservation | None = None, object_rack_role: str | RackRole | pb.RackRole | None = None, object_rack_type: str | RackType | pb.RackType | None = None, object_rear_port: str | RearPort | pb.RearPort | None = None, @@ -1304,7 +1326,7 @@ def __new__( object_tunnel: str | Tunnel | pb.Tunnel | None = None, object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, object_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None + TunnelTermination | pb.TunnelTermination | None ) = None, object_vlan: str | VLAN | pb.VLAN | None = None, object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, @@ -1312,14 +1334,14 @@ def __new__( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, object_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, object_vm_interface: str | VMInterface | pb.VMInterface | None = None, object_vrf: str | VRF | pb.VRF | None = None, object_virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, object_virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, object_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, object_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -1333,14 +1355,23 @@ def __new__( object_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - object_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + object_wireless_link: WirelessLink | pb.WirelessLink | None = None, + object_custom_field: str | CustomField | pb.CustomField | None = None, + object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + object_journal_entry: JournalEntry | pb.JournalEntry | None = None, + object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + object_custom_link: str | CustomLink | pb.CustomLink | None = None, + object_owner: str | Owner | pb.Owner | None = None, + object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, contact: str | Contact | pb.Contact | None = None, role: str | ContactRole | pb.ContactRole | None = None, priority: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, ) -> pb.ContactAssignment: """Create a new ContactAssignment.""" @@ -1349,6 +1380,9 @@ def __new__( object_aggregate = convert_to_protobuf(object_aggregate, pb.Aggregate) object_cable = convert_to_protobuf(object_cable, pb.Cable) object_cable_path = convert_to_protobuf(object_cable_path, pb.CablePath) + object_cable_termination = convert_to_protobuf( + object_cable_termination, pb.CableTermination + ) object_circuit = convert_to_protobuf(object_circuit, pb.Circuit) object_circuit_group = convert_to_protobuf( object_circuit_group, pb.CircuitGroup @@ -1377,11 +1411,6 @@ def __new__( object_contact_group, pb.ContactGroup ) object_contact_role = convert_to_protobuf(object_contact_role, pb.ContactRole) - object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) - object_custom_field_choice_set = convert_to_protobuf( - object_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) object_device = convert_to_protobuf(object_device, pb.Device) object_device_bay = convert_to_protobuf(object_device_bay, pb.DeviceBay) object_device_role = convert_to_protobuf(object_device_role, pb.DeviceRole) @@ -1409,9 +1438,6 @@ def __new__( object_inventory_item_role = convert_to_protobuf( object_inventory_item_role, pb.InventoryItemRole ) - object_journal_entry = convert_to_protobuf( - object_journal_entry, pb.JournalEntry - ) object_l2vpn = convert_to_protobuf(object_l2vpn, pb.L2VPN) object_l2vpn_termination = convert_to_protobuf( object_l2vpn_termination, pb.L2VPNTermination @@ -1422,11 +1448,6 @@ def __new__( object_module = convert_to_protobuf(object_module, pb.Module) object_module_bay = convert_to_protobuf(object_module_bay, pb.ModuleBay) object_module_type = convert_to_protobuf(object_module_type, pb.ModuleType) - object_module_type_profile = convert_to_protobuf( - object_module_type_profile, pb.ModuleTypeProfile - ) - object_owner = convert_to_protobuf(object_owner, pb.Owner) - object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) object_platform = convert_to_protobuf(object_platform, pb.Platform) object_power_feed = convert_to_protobuf(object_power_feed, pb.PowerFeed) object_power_outlet = convert_to_protobuf(object_power_outlet, pb.PowerOutlet) @@ -1498,6 +1519,19 @@ def __new__( object_wireless_link = convert_to_protobuf( object_wireless_link, pb.WirelessLink ) + object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) + object_custom_field_choice_set = convert_to_protobuf( + object_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + object_journal_entry = convert_to_protobuf( + object_journal_entry, pb.JournalEntry + ) + object_module_type_profile = convert_to_protobuf( + object_module_type_profile, pb.ModuleTypeProfile + ) + object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) + object_owner = convert_to_protobuf(object_owner, pb.Owner) + object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) contact = convert_to_protobuf(contact, pb.Contact) role = convert_to_protobuf(role, pb.ContactRole) tags = convert_to_protobuf_list(tags, pb.Tag) @@ -1524,9 +1558,6 @@ def __new__( object_contact_assignment=object_contact_assignment, object_contact_group=object_contact_group, object_contact_role=object_contact_role, - object_custom_field=object_custom_field, - object_custom_field_choice_set=object_custom_field_choice_set, - object_custom_link=object_custom_link, object_device=object_device, object_device_bay=object_device_bay, object_device_role=object_device_role, @@ -1544,7 +1575,6 @@ def __new__( object_interface=object_interface, object_inventory_item=object_inventory_item, object_inventory_item_role=object_inventory_item_role, - object_journal_entry=object_journal_entry, object_l2vpn=object_l2vpn, object_l2vpn_termination=object_l2vpn_termination, object_location=object_location, @@ -1553,9 +1583,6 @@ def __new__( object_module=object_module, object_module_bay=object_module_bay, object_module_type=object_module_type, - object_module_type_profile=object_module_type_profile, - object_owner=object_owner, - object_owner_group=object_owner_group, object_platform=object_platform, object_power_feed=object_power_feed, object_power_outlet=object_power_outlet, @@ -1599,6 +1626,13 @@ def __new__( object_wireless_lan=object_wireless_lan, object_wireless_lan_group=object_wireless_lan_group, object_wireless_link=object_wireless_link, + object_custom_field=object_custom_field, + object_custom_field_choice_set=object_custom_field_choice_set, + object_journal_entry=object_journal_entry, + object_module_type_profile=object_module_type_profile, + object_custom_link=object_custom_link, + object_owner=object_owner, + object_owner_group=object_owner_group, contact=contact, role=role, priority=priority, @@ -1619,29 +1653,27 @@ def __new__( parent: str | ContactGroup | pb.ContactGroup | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ContactGroup: """Create a new ContactGroup.""" parent = convert_to_protobuf(parent, pb.ContactGroup) tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ContactGroup( name=name, slug=slug, parent=parent, description=description, tags=tags, - owner=owner, - comments=comments, custom_fields=custom_fields, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -1654,119 +1686,26 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.ContactRole: """Create a new ContactRole.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ContactRole( name=name, slug=slug, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - ) - return result - - -class CustomField: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomField.""" - - def __new__( - cls, - object_types: list[str] | None = None, - type: str | None = None, - related_object_type: str | None = None, - name: str | None = None, - label: str | None = None, - group_name: str | None = None, - description: str | None = None, - required: bool | None = None, - unique: bool | None = None, - search_weight: int | None = None, - filter_logic: str | None = None, - ui_visible: str | None = None, - ui_editable: str | None = None, - is_cloneable: bool | None = None, - default: str | None = None, - related_object_filter: str | None = None, - weight: int | None = None, - validation_minimum: float | None = None, - validation_maximum: float | None = None, - validation_regex: str | None = None, - choice_set: str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.CustomField: - """Create a new CustomField.""" - choice_set = convert_to_protobuf(choice_set, pb.CustomFieldChoiceSet) - owner = convert_to_protobuf(owner, pb.Owner) - metadata = convert_dict_to_struct(metadata) - result = pb.CustomField( - object_types=object_types, - type=type, - related_object_type=related_object_type, - name=name, - label=label, - group_name=group_name, - description=description, - required=required, - unique=unique, - search_weight=search_weight, - filter_logic=filter_logic, - ui_visible=ui_visible, - ui_editable=ui_editable, - is_cloneable=is_cloneable, - default=default, - related_object_filter=related_object_filter, - weight=weight, - validation_minimum=validation_minimum, - validation_maximum=validation_maximum, - validation_regex=validation_regex, - choice_set=choice_set, owner=owner, comments=comments, - metadata=metadata, - ) - return result - - -class CustomFieldChoiceSet: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomFieldChoiceSet.""" - - def __new__( - cls, - name: str | None = None, - description: str | None = None, - base_choices: str | None = None, - extra_choices: list[str] | None = None, - order_alphabetically: bool | None = None, - owner: str | Owner | pb.Owner | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.CustomFieldChoiceSet: - """Create a new CustomFieldChoiceSet.""" - owner = convert_to_protobuf(owner, pb.Owner) - metadata = convert_dict_to_struct(metadata) - result = pb.CustomFieldChoiceSet( - name=name, - description=description, - base_choices=base_choices, - extra_choices=extra_choices, - order_alphabetically=order_alphabetically, - owner=owner, - metadata=metadata, ) return result @@ -1778,17 +1717,16 @@ def __new__( cls, asn: str | ASN | pb.ASN | None = None, asn_range: str | ASNRange | pb.ASNRange | None = None, - aggregate: str | Aggregate | pb.Aggregate | None = None, - cable: str | Cable | pb.Cable | None = None, - cable_path: str | CablePath | pb.CablePath | None = None, + aggregate: Aggregate | pb.Aggregate | None = None, + cable: Cable | pb.Cable | None = None, + cable_path: CablePath | pb.CablePath | None = None, + cable_termination: CableTermination | pb.CableTermination | None = None, circuit: str | Circuit | pb.Circuit | None = None, circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None - ) = None, - circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, + circuit_termination: CircuitTermination | pb.CircuitTermination | None = None, circuit_type: str | CircuitType | pb.CircuitType | None = None, cluster: str | Cluster | pb.Cluster | None = None, cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, @@ -1798,29 +1736,22 @@ def __new__( str | ConsoleServerPort | pb.ConsoleServerPort | None ) = None, contact: str | Contact | pb.Contact | None = None, - contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None - ) = None, + contact_assignment: ContactAssignment | pb.ContactAssignment | None = None, contact_group: str | ContactGroup | pb.ContactGroup | None = None, contact_role: str | ContactRole | pb.ContactRole | None = None, - custom_field: str | CustomField | pb.CustomField | None = None, - custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - custom_link: str | CustomLink | pb.CustomLink | None = None, device: str | Device | pb.Device | None = None, device_bay: str | DeviceBay | pb.DeviceBay | None = None, device_role: str | DeviceRole | pb.DeviceRole | None = None, device_type: str | DeviceType | pb.DeviceType | None = None, fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, front_port: str | FrontPort | pb.FrontPort | None = None, ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, ip_address: str | IPAddress | pb.IPAddress | None = None, - ip_range: str | IPRange | pb.IPRange | None = None, + ip_range: IPRange | pb.IPRange | None = None, ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -1829,20 +1760,14 @@ def __new__( inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - journal_entry: str | JournalEntry | pb.JournalEntry | None = None, l2vpn: str | L2VPN | pb.L2VPN | None = None, - l2vpn_termination: str | L2VPNTermination | pb.L2VPNTermination | None = None, + l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, location: str | Location | pb.Location | None = None, mac_address: str | MACAddress | pb.MACAddress | None = None, manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, module_bay: str | ModuleBay | pb.ModuleBay | None = None, module_type: str | ModuleType | pb.ModuleType | None = None, - module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - owner: str | Owner | pb.Owner | None = None, - owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, platform: str | Platform | pb.Platform | None = None, power_feed: str | PowerFeed | pb.PowerFeed | None = None, power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -1854,7 +1779,7 @@ def __new__( provider_network: str | ProviderNetwork | pb.ProviderNetwork | None = None, rir: str | RIR | pb.RIR | None = None, rack: str | Rack | pb.Rack | None = None, - rack_reservation: str | RackReservation | pb.RackReservation | None = None, + rack_reservation: RackReservation | pb.RackReservation | None = None, rack_role: str | RackRole | pb.RackRole | None = None, rack_type: str | RackType | pb.RackType | None = None, rear_port: str | RearPort | pb.RearPort | None = None, @@ -1869,23 +1794,21 @@ def __new__( tenant_group: str | TenantGroup | pb.TenantGroup | None = None, tunnel: str | Tunnel | pb.Tunnel | None = None, tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None - ) = None, + tunnel_termination: TunnelTermination | pb.TunnelTermination | None = None, vlan: str | VLAN | pb.VLAN | None = None, vlan_group: str | VLANGroup | pb.VLANGroup | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, vm_interface: str | VMInterface | pb.VMInterface | None = None, vrf: str | VRF | pb.VRF | None = None, virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -1897,7 +1820,18 @@ def __new__( virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, wireless_lan_group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, - wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + wireless_link: WirelessLink | pb.WirelessLink | None = None, + custom_field: str | CustomField | pb.CustomField | None = None, + custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + journal_entry: JournalEntry | pb.JournalEntry | None = None, + module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + custom_link: str | CustomLink | pb.CustomLink | None = None, + owner: str | Owner | pb.Owner | None = None, + owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, ) -> pb.CustomFieldObjectReference: """Create a new CustomFieldObjectReference.""" asn = convert_to_protobuf(asn, pb.ASN) @@ -1905,6 +1839,7 @@ def __new__( aggregate = convert_to_protobuf(aggregate, pb.Aggregate) cable = convert_to_protobuf(cable, pb.Cable) cable_path = convert_to_protobuf(cable_path, pb.CablePath) + cable_termination = convert_to_protobuf(cable_termination, pb.CableTermination) circuit = convert_to_protobuf(circuit, pb.Circuit) circuit_group = convert_to_protobuf(circuit_group, pb.CircuitGroup) circuit_group_assignment = convert_to_protobuf( @@ -1927,11 +1862,6 @@ def __new__( ) contact_group = convert_to_protobuf(contact_group, pb.ContactGroup) contact_role = convert_to_protobuf(contact_role, pb.ContactRole) - custom_field = convert_to_protobuf(custom_field, pb.CustomField) - custom_field_choice_set = convert_to_protobuf( - custom_field_choice_set, pb.CustomFieldChoiceSet - ) - custom_link = convert_to_protobuf(custom_link, pb.CustomLink) device = convert_to_protobuf(device, pb.Device) device_bay = convert_to_protobuf(device_bay, pb.DeviceBay) device_role = convert_to_protobuf(device_role, pb.DeviceRole) @@ -1953,7 +1883,6 @@ def __new__( inventory_item_role = convert_to_protobuf( inventory_item_role, pb.InventoryItemRole ) - journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) l2vpn_termination = convert_to_protobuf(l2vpn_termination, pb.L2VPNTermination) location = convert_to_protobuf(location, pb.Location) @@ -1962,11 +1891,6 @@ def __new__( module = convert_to_protobuf(module, pb.Module) module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) module_type = convert_to_protobuf(module_type, pb.ModuleType) - module_type_profile = convert_to_protobuf( - module_type_profile, pb.ModuleTypeProfile - ) - owner = convert_to_protobuf(owner, pb.Owner) - owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) platform = convert_to_protobuf(platform, pb.Platform) power_feed = convert_to_protobuf(power_feed, pb.PowerFeed) power_outlet = convert_to_protobuf(power_outlet, pb.PowerOutlet) @@ -2024,12 +1948,24 @@ def __new__( wireless_lan_group, pb.WirelessLANGroup ) wireless_link = convert_to_protobuf(wireless_link, pb.WirelessLink) + custom_field = convert_to_protobuf(custom_field, pb.CustomField) + custom_field_choice_set = convert_to_protobuf( + custom_field_choice_set, pb.CustomFieldChoiceSet + ) + journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) + module_type_profile = convert_to_protobuf( + module_type_profile, pb.ModuleTypeProfile + ) + custom_link = convert_to_protobuf(custom_link, pb.CustomLink) + owner = convert_to_protobuf(owner, pb.Owner) + owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) result = pb.CustomFieldObjectReference( asn=asn, asn_range=asn_range, aggregate=aggregate, cable=cable, cable_path=cable_path, + cable_termination=cable_termination, circuit=circuit, circuit_group=circuit_group, circuit_group_assignment=circuit_group_assignment, @@ -2044,9 +1980,6 @@ def __new__( contact_assignment=contact_assignment, contact_group=contact_group, contact_role=contact_role, - custom_field=custom_field, - custom_field_choice_set=custom_field_choice_set, - custom_link=custom_link, device=device, device_bay=device_bay, device_role=device_role, @@ -2064,7 +1997,6 @@ def __new__( interface=interface, inventory_item=inventory_item, inventory_item_role=inventory_item_role, - journal_entry=journal_entry, l2vpn=l2vpn, l2vpn_termination=l2vpn_termination, location=location, @@ -2073,9 +2005,6 @@ def __new__( module=module, module_bay=module_bay, module_type=module_type, - module_type_profile=module_type_profile, - owner=owner, - owner_group=owner_group, platform=platform, power_feed=power_feed, power_outlet=power_outlet, @@ -2119,6 +2048,13 @@ def __new__( wireless_lan=wireless_lan, wireless_lan_group=wireless_lan_group, wireless_link=wireless_link, + custom_field=custom_field, + custom_field_choice_set=custom_field_choice_set, + journal_entry=journal_entry, + module_type_profile=module_type_profile, + custom_link=custom_link, + owner=owner, + owner_group=owner_group, ) return result @@ -2128,6 +2064,10 @@ class CustomFieldValue: def __new__( cls, + multiple_selection: list[str] | None = None, + multiple_objects: ( + list[CustomFieldObjectReference | pb.CustomFieldObjectReference] | None + ) = None, text: str | None = None, long_text: str | None = None, integer: int | None = None, @@ -2139,20 +2079,17 @@ def __new__( json: str | None = None, selection: str | None = None, object: ( - str | CustomFieldObjectReference | pb.CustomFieldObjectReference | None - ) = None, - multiple_selection: list[str] | None = None, - multiple_objects: ( - list[str | CustomFieldObjectReference | pb.CustomFieldObjectReference] - | None + CustomFieldObjectReference | pb.CustomFieldObjectReference | None ) = None, ) -> pb.CustomFieldValue: """Create a new CustomFieldValue.""" - object = convert_to_protobuf(object, pb.CustomFieldObjectReference) multiple_objects = convert_to_protobuf_list( multiple_objects, pb.CustomFieldObjectReference ) + object = convert_to_protobuf(object, pb.CustomFieldObjectReference) result = pb.CustomFieldValue( + multiple_selection=multiple_selection, + multiple_objects=multiple_objects, text=text, long_text=long_text, integer=integer, @@ -2164,50 +2101,12 @@ def __new__( json=json, selection=selection, object=object, - multiple_selection=multiple_selection, - multiple_objects=multiple_objects, ) return result -class CustomLink: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomLink.""" - - def __new__( - cls, - object_types: list[str] | None = None, - name: str | None = None, - enabled: bool | None = None, - link_text: str | None = None, - link_url: str | None = None, - weight: int | None = None, - group_name: str | None = None, - button_class: str | None = None, - new_window: bool | None = None, - owner: str | Owner | pb.Owner | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.CustomLink: - """Create a new CustomLink.""" - owner = convert_to_protobuf(owner, pb.Owner) - metadata = convert_dict_to_struct(metadata) - result = pb.CustomLink( - object_types=object_types, - name=name, - enabled=enabled, - link_text=link_text, - link_url=link_url, - weight=weight, - group_name=group_name, - button_class=button_class, - new_window=new_window, - owner=owner, - metadata=metadata, - ) - return result - - -class Device: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Device.""" +class Device: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Device.""" def __new__( cls, @@ -2235,13 +2134,12 @@ def __new__( vc_position: int | None = None, vc_priority: int | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + config: DeviceConfig | pb.DeviceConfig | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, ) -> pb.Device: @@ -2258,10 +2156,11 @@ def __new__( oob_ip = convert_to_protobuf(oob_ip, pb.IPAddress) cluster = convert_to_protobuf(cluster, pb.Cluster) virtual_chassis = convert_to_protobuf(virtual_chassis, pb.VirtualChassis) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + config = convert_to_protobuf(config, pb.DeviceConfig) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -2297,11 +2196,12 @@ def __new__( vc_position=vc_position, vc_priority=vc_priority, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + config=config, ) return result @@ -2316,30 +2216,28 @@ def __new__( label: str | None = None, description: str | None = None, installed_device: str | Device | pb.Device | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceBay: """Create a new DeviceBay.""" device = convert_to_protobuf(device, pb.Device) installed_device = convert_to_protobuf(installed_device, pb.Device) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceBay( device=device, name=name, label=label, description=description, installed_device=installed_device, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -2353,34 +2251,32 @@ def __new__( slug: str | None = None, color: str | None = None, vm_role: bool | None = None, - parent: str | DeviceRole | pb.DeviceRole | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + parent: str | DeviceRole | pb.DeviceRole | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceRole: """Create a new DeviceRole.""" - parent = convert_to_protobuf(parent, pb.DeviceRole) tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + parent = convert_to_protobuf(parent, pb.DeviceRole) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceRole( name=name, slug=slug, color=color, vm_role=vm_role, - parent=parent, description=description, tags=tags, - owner=owner, - comments=comments, custom_fields=custom_fields, + parent=parent, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -2403,21 +2299,19 @@ def __new__( weight: float | None = None, weight_unit: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceType: """Create a new DeviceType.""" manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) default_platform = convert_to_protobuf(default_platform, pb.Platform) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceType( manufacturer=manufacturer, default_platform=default_platform, @@ -2432,11 +2326,11 @@ def __new__( weight=weight, weight_unit=weight_unit, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -2452,19 +2346,17 @@ def __new__( auth_type: str | None = None, auth_key: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.FHRPGroup: """Create a new FHRPGroup.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.FHRPGroup( name=name, protocol=protocol, @@ -2472,11 +2364,11 @@ def __new__( auth_type=auth_type, auth_key=auth_key, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -2489,19 +2381,19 @@ def __new__( group: str | FHRPGroup | pb.FHRPGroup | None = None, interface_asn: str | ASN | pb.ASN | None = None, interface_asn_range: str | ASNRange | pb.ASNRange | None = None, - interface_aggregate: str | Aggregate | pb.Aggregate | None = None, - interface_cable: str | Cable | pb.Cable | None = None, - interface_cable_path: str | CablePath | pb.CablePath | None = None, + interface_aggregate: Aggregate | pb.Aggregate | None = None, + interface_cable: Cable | pb.Cable | None = None, + interface_cable_path: CablePath | pb.CablePath | None = None, interface_cable_termination: ( - str | CableTermination | pb.CableTermination | None + CableTermination | pb.CableTermination | None ) = None, interface_circuit: str | Circuit | pb.Circuit | None = None, interface_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, interface_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, interface_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitTermination | pb.CircuitTermination | None ) = None, interface_circuit_type: str | CircuitType | pb.CircuitType | None = None, interface_cluster: str | Cluster | pb.Cluster | None = None, @@ -2513,28 +2405,23 @@ def __new__( ) = None, interface_contact: str | Contact | pb.Contact | None = None, interface_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None + ContactAssignment | pb.ContactAssignment | None ) = None, interface_contact_group: str | ContactGroup | pb.ContactGroup | None = None, interface_contact_role: str | ContactRole | pb.ContactRole | None = None, - interface_custom_field: str | CustomField | pb.CustomField | None = None, - interface_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - interface_custom_link: str | CustomLink | pb.CustomLink | None = None, interface_device: str | Device | pb.Device | None = None, interface_device_bay: str | DeviceBay | pb.DeviceBay | None = None, interface_device_role: str | DeviceRole | pb.DeviceRole | None = None, interface_device_type: str | DeviceType | pb.DeviceType | None = None, interface_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, interface_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, interface_front_port: str | FrontPort | pb.FrontPort | None = None, interface_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, interface_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, interface_ip_address: str | IPAddress | pb.IPAddress | None = None, - interface_ip_range: str | IPRange | pb.IPRange | None = None, + interface_ip_range: IPRange | pb.IPRange | None = None, interface_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, interface_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, interface_ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -2543,22 +2430,16 @@ def __new__( interface_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - interface_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, interface_l2vpn: str | L2VPN | pb.L2VPN | None = None, interface_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None + L2VPNTermination | pb.L2VPNTermination | None ) = None, interface_location: str | Location | pb.Location | None = None, interface_mac_address: str | MACAddress | pb.MACAddress | None = None, interface_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - interface_module: str | Module | pb.Module | None = None, + interface_module: Module | pb.Module | None = None, interface_module_bay: str | ModuleBay | pb.ModuleBay | None = None, interface_module_type: str | ModuleType | pb.ModuleType | None = None, - interface_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - interface_owner: str | Owner | pb.Owner | None = None, - interface_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, interface_platform: str | Platform | pb.Platform | None = None, interface_power_feed: str | PowerFeed | pb.PowerFeed | None = None, interface_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -2574,9 +2455,7 @@ def __new__( ) = None, interface_rir: str | RIR | pb.RIR | None = None, interface_rack: str | Rack | pb.Rack | None = None, - interface_rack_reservation: ( - str | RackReservation | pb.RackReservation | None - ) = None, + interface_rack_reservation: RackReservation | pb.RackReservation | None = None, interface_rack_role: str | RackRole | pb.RackRole | None = None, interface_rack_type: str | RackType | pb.RackType | None = None, interface_rear_port: str | RearPort | pb.RearPort | None = None, @@ -2592,7 +2471,7 @@ def __new__( interface_tunnel: str | Tunnel | pb.Tunnel | None = None, interface_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, interface_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None + TunnelTermination | pb.TunnelTermination | None ) = None, interface_vlan: str | VLAN | pb.VLAN | None = None, interface_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, @@ -2600,7 +2479,7 @@ def __new__( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, interface_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, interface_vm_interface: str | VMInterface | pb.VMInterface | None = None, interface_vrf: str | VRF | pb.VRF | None = None, @@ -2611,7 +2490,7 @@ def __new__( str | VirtualCircuit | pb.VirtualCircuit | None ) = None, interface_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, interface_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -2627,7 +2506,18 @@ def __new__( interface_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - interface_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + interface_wireless_link: WirelessLink | pb.WirelessLink | None = None, + interface_custom_field: str | CustomField | pb.CustomField | None = None, + interface_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + interface_journal_entry: JournalEntry | pb.JournalEntry | None = None, + interface_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + interface_custom_link: str | CustomLink | pb.CustomLink | None = None, + interface_owner: str | Owner | pb.Owner | None = None, + interface_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, priority: int | None = None, metadata: dict[str, Any] | None = None, ) -> pb.FHRPGroupAssignment: @@ -2638,6 +2528,9 @@ def __new__( interface_aggregate = convert_to_protobuf(interface_aggregate, pb.Aggregate) interface_cable = convert_to_protobuf(interface_cable, pb.Cable) interface_cable_path = convert_to_protobuf(interface_cable_path, pb.CablePath) + interface_cable_termination = convert_to_protobuf( + interface_cable_termination, pb.CableTermination + ) interface_circuit = convert_to_protobuf(interface_circuit, pb.Circuit) interface_circuit_group = convert_to_protobuf( interface_circuit_group, pb.CircuitGroup @@ -2674,15 +2567,6 @@ def __new__( interface_contact_role = convert_to_protobuf( interface_contact_role, pb.ContactRole ) - interface_custom_field = convert_to_protobuf( - interface_custom_field, pb.CustomField - ) - interface_custom_field_choice_set = convert_to_protobuf( - interface_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - interface_custom_link = convert_to_protobuf( - interface_custom_link, pb.CustomLink - ) interface_device = convert_to_protobuf(interface_device, pb.Device) interface_device_bay = convert_to_protobuf(interface_device_bay, pb.DeviceBay) interface_device_role = convert_to_protobuf( @@ -2718,9 +2602,6 @@ def __new__( interface_inventory_item_role = convert_to_protobuf( interface_inventory_item_role, pb.InventoryItemRole ) - interface_journal_entry = convert_to_protobuf( - interface_journal_entry, pb.JournalEntry - ) interface_l2vpn = convert_to_protobuf(interface_l2vpn, pb.L2VPN) interface_l2vpn_termination = convert_to_protobuf( interface_l2vpn_termination, pb.L2VPNTermination @@ -2737,13 +2618,6 @@ def __new__( interface_module_type = convert_to_protobuf( interface_module_type, pb.ModuleType ) - interface_module_type_profile = convert_to_protobuf( - interface_module_type_profile, pb.ModuleTypeProfile - ) - interface_owner = convert_to_protobuf(interface_owner, pb.Owner) - interface_owner_group = convert_to_protobuf( - interface_owner_group, pb.OwnerGroup - ) interface_platform = convert_to_protobuf(interface_platform, pb.Platform) interface_power_feed = convert_to_protobuf(interface_power_feed, pb.PowerFeed) interface_power_outlet = convert_to_protobuf( @@ -2831,6 +2705,25 @@ def __new__( interface_wireless_link = convert_to_protobuf( interface_wireless_link, pb.WirelessLink ) + interface_custom_field = convert_to_protobuf( + interface_custom_field, pb.CustomField + ) + interface_custom_field_choice_set = convert_to_protobuf( + interface_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + interface_journal_entry = convert_to_protobuf( + interface_journal_entry, pb.JournalEntry + ) + interface_module_type_profile = convert_to_protobuf( + interface_module_type_profile, pb.ModuleTypeProfile + ) + interface_custom_link = convert_to_protobuf( + interface_custom_link, pb.CustomLink + ) + interface_owner = convert_to_protobuf(interface_owner, pb.Owner) + interface_owner_group = convert_to_protobuf( + interface_owner_group, pb.OwnerGroup + ) metadata = convert_dict_to_struct(metadata) result = pb.FHRPGroupAssignment( group=group, @@ -2854,9 +2747,6 @@ def __new__( interface_contact_assignment=interface_contact_assignment, interface_contact_group=interface_contact_group, interface_contact_role=interface_contact_role, - interface_custom_field=interface_custom_field, - interface_custom_field_choice_set=interface_custom_field_choice_set, - interface_custom_link=interface_custom_link, interface_device=interface_device, interface_device_bay=interface_device_bay, interface_device_role=interface_device_role, @@ -2874,7 +2764,6 @@ def __new__( interface_interface=interface_interface, interface_inventory_item=interface_inventory_item, interface_inventory_item_role=interface_inventory_item_role, - interface_journal_entry=interface_journal_entry, interface_l2vpn=interface_l2vpn, interface_l2vpn_termination=interface_l2vpn_termination, interface_location=interface_location, @@ -2883,9 +2772,6 @@ def __new__( interface_module=interface_module, interface_module_bay=interface_module_bay, interface_module_type=interface_module_type, - interface_module_type_profile=interface_module_type_profile, - interface_owner=interface_owner, - interface_owner_group=interface_owner_group, interface_platform=interface_platform, interface_power_feed=interface_power_feed, interface_power_outlet=interface_power_outlet, @@ -2929,6 +2815,13 @@ def __new__( interface_wireless_lan=interface_wireless_lan, interface_wireless_lan_group=interface_wireless_lan_group, interface_wireless_link=interface_wireless_link, + interface_custom_field=interface_custom_field, + interface_custom_field_choice_set=interface_custom_field_choice_set, + interface_journal_entry=interface_journal_entry, + interface_module_type_profile=interface_module_type_profile, + interface_custom_link=interface_custom_link, + interface_owner=interface_owner, + interface_owner_group=interface_owner_group, priority=priority, metadata=metadata, ) @@ -2941,28 +2834,29 @@ class FrontPort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, color: str | None = None, - positions: int | None = None, + rear_port: str | RearPort | pb.RearPort | None = None, + rear_port_position: int | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + positions: int | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.FrontPort: """Create a new FrontPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) + rear_port = convert_to_protobuf(rear_port, pb.RearPort) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.FrontPort( device=device, module=module, @@ -2970,13 +2864,15 @@ def __new__( label=label, type=type, color=color, - positions=positions, + rear_port=rear_port, + rear_port_position=rear_port_position, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + positions=positions, + owner=owner, ) return result @@ -2988,19 +2884,17 @@ def __new__( cls, object_asn: str | ASN | pb.ASN | None = None, object_asn_range: str | ASNRange | pb.ASNRange | None = None, - object_aggregate: str | Aggregate | pb.Aggregate | None = None, - object_cable: str | Cable | pb.Cable | None = None, - object_cable_path: str | CablePath | pb.CablePath | None = None, - object_cable_termination: ( - str | CableTermination | pb.CableTermination | None - ) = None, + object_aggregate: Aggregate | pb.Aggregate | None = None, + object_cable: Cable | pb.Cable | None = None, + object_cable_path: CablePath | pb.CablePath | None = None, + object_cable_termination: CableTermination | pb.CableTermination | None = None, object_circuit: str | Circuit | pb.Circuit | None = None, object_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, object_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, object_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitTermination | pb.CircuitTermination | None ) = None, object_circuit_type: str | CircuitType | pb.CircuitType | None = None, object_cluster: str | Cluster | pb.Cluster | None = None, @@ -3012,28 +2906,23 @@ def __new__( ) = None, object_contact: str | Contact | pb.Contact | None = None, object_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None + ContactAssignment | pb.ContactAssignment | None ) = None, object_contact_group: str | ContactGroup | pb.ContactGroup | None = None, object_contact_role: str | ContactRole | pb.ContactRole | None = None, - object_custom_field: str | CustomField | pb.CustomField | None = None, - object_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - object_custom_link: str | CustomLink | pb.CustomLink | None = None, object_device: str | Device | pb.Device | None = None, object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, object_device_role: str | DeviceRole | pb.DeviceRole | None = None, object_device_type: str | DeviceType | pb.DeviceType | None = None, object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, object_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, object_front_port: str | FrontPort | pb.FrontPort | None = None, object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, object_ip_address: str | IPAddress | pb.IPAddress | None = None, - object_ip_range: str | IPRange | pb.IPRange | None = None, + object_ip_range: IPRange | pb.IPRange | None = None, object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, object_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, object_ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -3042,22 +2931,14 @@ def __new__( object_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - object_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, object_l2vpn: str | L2VPN | pb.L2VPN | None = None, - object_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None - ) = None, + object_l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, object_location: str | Location | pb.Location | None = None, object_mac_address: str | MACAddress | pb.MACAddress | None = None, object_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - object_module: str | Module | pb.Module | None = None, + object_module: Module | pb.Module | None = None, object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, object_module_type: str | ModuleType | pb.ModuleType | None = None, - object_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - object_owner: str | Owner | pb.Owner | None = None, - object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, object_platform: str | Platform | pb.Platform | None = None, object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -3073,9 +2954,7 @@ def __new__( ) = None, object_rir: str | RIR | pb.RIR | None = None, object_rack: str | Rack | pb.Rack | None = None, - object_rack_reservation: ( - str | RackReservation | pb.RackReservation | None - ) = None, + object_rack_reservation: RackReservation | pb.RackReservation | None = None, object_rack_role: str | RackRole | pb.RackRole | None = None, object_rack_type: str | RackType | pb.RackType | None = None, object_rear_port: str | RearPort | pb.RearPort | None = None, @@ -3091,7 +2970,7 @@ def __new__( object_tunnel: str | Tunnel | pb.Tunnel | None = None, object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, object_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None + TunnelTermination | pb.TunnelTermination | None ) = None, object_vlan: str | VLAN | pb.VLAN | None = None, object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, @@ -3099,14 +2978,14 @@ def __new__( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, object_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, object_vm_interface: str | VMInterface | pb.VMInterface | None = None, object_vrf: str | VRF | pb.VRF | None = None, object_virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, object_virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, object_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, object_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -3120,7 +2999,18 @@ def __new__( object_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - object_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + object_wireless_link: WirelessLink | pb.WirelessLink | None = None, + object_custom_field: str | CustomField | pb.CustomField | None = None, + object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + object_journal_entry: JournalEntry | pb.JournalEntry | None = None, + object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + object_custom_link: str | CustomLink | pb.CustomLink | None = None, + object_owner: str | Owner | pb.Owner | None = None, + object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, ) -> pb.GenericObject: """Create a new GenericObject.""" object_asn = convert_to_protobuf(object_asn, pb.ASN) @@ -3128,6 +3018,9 @@ def __new__( object_aggregate = convert_to_protobuf(object_aggregate, pb.Aggregate) object_cable = convert_to_protobuf(object_cable, pb.Cable) object_cable_path = convert_to_protobuf(object_cable_path, pb.CablePath) + object_cable_termination = convert_to_protobuf( + object_cable_termination, pb.CableTermination + ) object_circuit = convert_to_protobuf(object_circuit, pb.Circuit) object_circuit_group = convert_to_protobuf( object_circuit_group, pb.CircuitGroup @@ -3156,11 +3049,6 @@ def __new__( object_contact_group, pb.ContactGroup ) object_contact_role = convert_to_protobuf(object_contact_role, pb.ContactRole) - object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) - object_custom_field_choice_set = convert_to_protobuf( - object_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) object_device = convert_to_protobuf(object_device, pb.Device) object_device_bay = convert_to_protobuf(object_device_bay, pb.DeviceBay) object_device_role = convert_to_protobuf(object_device_role, pb.DeviceRole) @@ -3188,9 +3076,6 @@ def __new__( object_inventory_item_role = convert_to_protobuf( object_inventory_item_role, pb.InventoryItemRole ) - object_journal_entry = convert_to_protobuf( - object_journal_entry, pb.JournalEntry - ) object_l2vpn = convert_to_protobuf(object_l2vpn, pb.L2VPN) object_l2vpn_termination = convert_to_protobuf( object_l2vpn_termination, pb.L2VPNTermination @@ -3201,11 +3086,6 @@ def __new__( object_module = convert_to_protobuf(object_module, pb.Module) object_module_bay = convert_to_protobuf(object_module_bay, pb.ModuleBay) object_module_type = convert_to_protobuf(object_module_type, pb.ModuleType) - object_module_type_profile = convert_to_protobuf( - object_module_type_profile, pb.ModuleTypeProfile - ) - object_owner = convert_to_protobuf(object_owner, pb.Owner) - object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) object_platform = convert_to_protobuf(object_platform, pb.Platform) object_power_feed = convert_to_protobuf(object_power_feed, pb.PowerFeed) object_power_outlet = convert_to_protobuf(object_power_outlet, pb.PowerOutlet) @@ -3277,6 +3157,19 @@ def __new__( object_wireless_link = convert_to_protobuf( object_wireless_link, pb.WirelessLink ) + object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) + object_custom_field_choice_set = convert_to_protobuf( + object_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + object_journal_entry = convert_to_protobuf( + object_journal_entry, pb.JournalEntry + ) + object_module_type_profile = convert_to_protobuf( + object_module_type_profile, pb.ModuleTypeProfile + ) + object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) + object_owner = convert_to_protobuf(object_owner, pb.Owner) + object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) result = pb.GenericObject( object_asn=object_asn, object_asn_range=object_asn_range, @@ -3298,9 +3191,6 @@ def __new__( object_contact_assignment=object_contact_assignment, object_contact_group=object_contact_group, object_contact_role=object_contact_role, - object_custom_field=object_custom_field, - object_custom_field_choice_set=object_custom_field_choice_set, - object_custom_link=object_custom_link, object_device=object_device, object_device_bay=object_device_bay, object_device_role=object_device_role, @@ -3318,7 +3208,6 @@ def __new__( object_interface=object_interface, object_inventory_item=object_inventory_item, object_inventory_item_role=object_inventory_item_role, - object_journal_entry=object_journal_entry, object_l2vpn=object_l2vpn, object_l2vpn_termination=object_l2vpn_termination, object_location=object_location, @@ -3327,9 +3216,6 @@ def __new__( object_module=object_module, object_module_bay=object_module_bay, object_module_type=object_module_type, - object_module_type_profile=object_module_type_profile, - object_owner=object_owner, - object_owner_group=object_owner_group, object_platform=object_platform, object_power_feed=object_power_feed, object_power_outlet=object_power_outlet, @@ -3373,6 +3259,13 @@ def __new__( object_wireless_lan=object_wireless_lan, object_wireless_lan_group=object_wireless_lan_group, object_wireless_link=object_wireless_link, + object_custom_field=object_custom_field, + object_custom_field_choice_set=object_custom_field_choice_set, + object_journal_entry=object_journal_entry, + object_module_type_profile=object_module_type_profile, + object_custom_link=object_custom_link, + object_owner=object_owner, + object_owner_group=object_owner_group, ) return result @@ -3386,34 +3279,32 @@ def __new__( description: str | None = None, version: int | None = None, mode: str | None = None, - proposals: list[str | IKEProposal | pb.IKEProposal] | None = None, preshared_key: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + proposals: list[str | IKEProposal | pb.IKEProposal] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IKEPolicy: """Create a new IKEPolicy.""" - proposals = convert_to_protobuf_list(proposals, pb.IKEProposal) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + proposals = convert_to_protobuf_list(proposals, pb.IKEProposal) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IKEPolicy( name=name, description=description, version=version, mode=mode, - proposals=proposals, preshared_key=preshared_key, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + proposals=proposals, metadata=metadata, + owner=owner, ) return result @@ -3430,19 +3321,17 @@ def __new__( authentication_algorithm: str | None = None, group: int | None = None, sa_lifetime: int | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IKEProposal: """Create a new IKEProposal.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IKEProposal( name=name, description=description, @@ -3451,11 +3340,11 @@ def __new__( authentication_algorithm=authentication_algorithm, group=group, sa_lifetime=sa_lifetime, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -3476,13 +3365,11 @@ def __new__( nat_inside: str | IPAddress | pb.IPAddress | None = None, dns_name: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, device_type: str | DeviceType | pb.DeviceType = None, @@ -3504,10 +3391,10 @@ def __new__( assigned_object_vm_interface, pb.VMInterface ) nat_inside = convert_to_protobuf(nat_inside, pb.IPAddress) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -3558,11 +3445,11 @@ def __new__( nat_inside=nat_inside, dns_name=dns_name, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -3579,24 +3466,22 @@ def __new__( status: str | None = None, role: str | Role | pb.Role | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - mark_populated: bool | None = None, mark_utilized: bool | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + mark_populated: bool | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IPRange: """Create a new IPRange.""" vrf = convert_to_protobuf(vrf, pb.VRF) tenant = convert_to_protobuf(tenant, pb.Tenant) role = convert_to_protobuf(role, pb.Role) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPRange( start_address=start_address, end_address=end_address, @@ -3605,13 +3490,13 @@ def __new__( status=status, role=role, description=description, - owner=owner, comments=comments, tags=tags, - mark_populated=mark_populated, mark_utilized=mark_utilized, custom_fields=custom_fields, + mark_populated=mark_populated, metadata=metadata, + owner=owner, ) return result @@ -3623,32 +3508,30 @@ def __new__( cls, name: str | None = None, description: str | None = None, - proposals: list[str | IPSecProposal | pb.IPSecProposal] | None = None, pfs_group: int | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + proposals: list[str | IPSecProposal | pb.IPSecProposal] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecPolicy: """Create a new IPSecPolicy.""" - proposals = convert_to_protobuf_list(proposals, pb.IPSecProposal) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + proposals = convert_to_protobuf_list(proposals, pb.IPSecProposal) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecPolicy( name=name, description=description, - proposals=proposals, pfs_group=pfs_group, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + proposals=proposals, metadata=metadata, + owner=owner, ) return result @@ -3663,32 +3546,30 @@ def __new__( mode: str | None = None, ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, ipsec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecProfile: """Create a new IPSecProfile.""" ike_policy = convert_to_protobuf(ike_policy, pb.IKEPolicy) ipsec_policy = convert_to_protobuf(ipsec_policy, pb.IPSecPolicy) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecProfile( name=name, description=description, mode=mode, ike_policy=ike_policy, ipsec_policy=ipsec_policy, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -3704,19 +3585,17 @@ def __new__( authentication_algorithm: str | None = None, sa_lifetime_seconds: int | None = None, sa_lifetime_data: int | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecProposal: """Create a new IPSecProposal.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecProposal( name=name, description=description, @@ -3724,11 +3603,11 @@ def __new__( authentication_algorithm=authentication_algorithm, sa_lifetime_seconds=sa_lifetime_seconds, sa_lifetime_data=sa_lifetime_data, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -3739,8 +3618,7 @@ class Interface: def __new__( cls, device: str | Device | pb.Device | None = None, - vdcs: list[str | VirtualDeviceContext | pb.VirtualDeviceContext] | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, @@ -3764,20 +3642,19 @@ def __new__( rf_channel_width: float | None = None, tx_power: int | None = None, untagged_vlan: str | VLAN | pb.VLAN | None = None, - tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, qinq_svlan: str | VLAN | pb.VLAN | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, mark_connected: bool | None = None, - wireless_lans: list[str | WirelessLAN | pb.WirelessLAN] | None = None, vrf: str | VRF | pb.VRF | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + vdcs: list[str | VirtualDeviceContext | pb.VirtualDeviceContext] | None = None, + tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, + wireless_lans: list[str | WirelessLAN | pb.WirelessLAN] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, device_type: str | DeviceType | pb.DeviceType = None, @@ -3787,24 +3664,24 @@ def __new__( ) -> pb.Interface: """Create a new Interface.""" device = convert_to_protobuf(device, pb.Device) - vdcs = convert_to_protobuf_list(vdcs, pb.VirtualDeviceContext) module = convert_to_protobuf(module, pb.Module) parent = convert_to_protobuf(parent, pb.Interface) bridge = convert_to_protobuf(bridge, pb.Interface) lag = convert_to_protobuf(lag, pb.Interface) primary_mac_address = convert_to_protobuf(primary_mac_address, pb.MACAddress) untagged_vlan = convert_to_protobuf(untagged_vlan, pb.VLAN) - tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) vlan_translation_policy = convert_to_protobuf( vlan_translation_policy, pb.VLANTranslationPolicy ) - wireless_lans = convert_to_protobuf_list(wireless_lans, pb.WirelessLAN) vrf = convert_to_protobuf(vrf, pb.VRF) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + vdcs = convert_to_protobuf_list(vdcs, pb.VirtualDeviceContext) + tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) + wireless_lans = convert_to_protobuf_list(wireless_lans, pb.WirelessLAN) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -3833,7 +3710,6 @@ def __new__( device.role.CopyFrom(role) result = pb.Interface( device=device, - vdcs=vdcs, module=module, name=name, label=label, @@ -3858,16 +3734,17 @@ def __new__( rf_channel_width=rf_channel_width, tx_power=tx_power, untagged_vlan=untagged_vlan, - tagged_vlans=tagged_vlans, qinq_svlan=qinq_svlan, vlan_translation_policy=vlan_translation_policy, mark_connected=mark_connected, - wireless_lans=wireless_lans, vrf=vrf, - owner=owner, tags=tags, custom_fields=custom_fields, + vdcs=vdcs, + tagged_vlans=tagged_vlans, + wireless_lans=wireless_lans, metadata=metadata, + owner=owner, ) return result @@ -3898,12 +3775,10 @@ def __new__( component_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, component_power_port: str | PowerPort | pb.PowerPort | None = None, component_rear_port: str | RearPort | pb.RearPort | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.InventoryItem: """Create a new InventoryItem.""" device = convert_to_protobuf(device, pb.Device) @@ -3923,10 +3798,10 @@ def __new__( ) component_power_port = convert_to_protobuf(component_power_port, pb.PowerPort) component_rear_port = convert_to_protobuf(component_rear_port, pb.RearPort) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.InventoryItem( device=device, parent=parent, @@ -3947,10 +3822,10 @@ def __new__( component_power_outlet=component_power_outlet, component_power_port=component_power_port, component_rear_port=component_rear_port, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -3964,55 +3839,104 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.InventoryItemRole: """Create a new InventoryItemRole.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.InventoryItemRole( name=name, slug=slug, color=color, description=description, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, owner=owner, comments=comments, + ) + return result + + +class L2VPN: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPN.""" + + def __new__( + cls, + identifier: int | None = None, + name: str | None = None, + slug: str | None = None, + type: str | None = None, + description: str | None = None, + comments: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, + export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, + status: str | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.L2VPN: + """Create a new L2VPN.""" + tenant = convert_to_protobuf(tenant, pb.Tenant) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) + export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.L2VPN( + identifier=identifier, + name=name, + slug=slug, + type=type, + description=description, + comments=comments, + tenant=tenant, tags=tags, custom_fields=custom_fields, + import_targets=import_targets, + export_targets=export_targets, + status=status, metadata=metadata, + owner=owner, ) return result -class JournalEntry: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.JournalEntry.""" +class L2VPNTermination: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPNTermination.""" def __new__( cls, + l2vpn: str | L2VPN | pb.L2VPN | None = None, + assigned_object_interface: str | Interface | pb.Interface | None = None, + assigned_object_vlan: str | VLAN | pb.VLAN | None = None, + assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, assigned_object_asn: str | ASN | pb.ASN | None = None, assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, - assigned_object_aggregate: str | Aggregate | pb.Aggregate | None = None, - assigned_object_cable: str | Cable | pb.Cable | None = None, - assigned_object_cable_path: str | CablePath | pb.CablePath | None = None, + assigned_object_aggregate: Aggregate | pb.Aggregate | None = None, + assigned_object_cable: Cable | pb.Cable | None = None, + assigned_object_cable_path: CablePath | pb.CablePath | None = None, assigned_object_cable_termination: ( - str | CableTermination | pb.CableTermination | None + CableTermination | pb.CableTermination | None ) = None, assigned_object_circuit: str | Circuit | pb.Circuit | None = None, assigned_object_circuit_group: ( str | CircuitGroup | pb.CircuitGroup | None ) = None, assigned_object_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, assigned_object_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitTermination | pb.CircuitTermination | None ) = None, assigned_object_circuit_type: str | CircuitType | pb.CircuitType | None = None, assigned_object_cluster: str | Cluster | pb.Cluster | None = None, @@ -4026,7 +3950,7 @@ def __new__( ) = None, assigned_object_contact: str | Contact | pb.Contact | None = None, assigned_object_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None + ContactAssignment | pb.ContactAssignment | None ) = None, assigned_object_contact_group: ( str | ContactGroup | pb.ContactGroup | None @@ -4036,20 +3960,19 @@ def __new__( assigned_object_custom_field_choice_set: ( str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None ) = None, - assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, assigned_object_device: str | Device | pb.Device | None = None, assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, assigned_object_device_type: str | DeviceType | pb.DeviceType | None = None, assigned_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, assigned_object_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, assigned_object_front_port: str | FrontPort | pb.FrontPort | None = None, assigned_object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, assigned_object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, assigned_object_ip_address: str | IPAddress | pb.IPAddress | None = None, - assigned_object_ip_range: str | IPRange | pb.IPRange | None = None, + assigned_object_ip_range: IPRange | pb.IPRange | None = None, assigned_object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, assigned_object_ip_sec_profile: ( str | IPSecProfile | pb.IPSecProfile | None @@ -4057,33 +3980,28 @@ def __new__( assigned_object_ip_sec_proposal: ( str | IPSecProposal | pb.IPSecProposal | None ) = None, - assigned_object_interface: str | Interface | pb.Interface | None = None, assigned_object_inventory_item: ( str | InventoryItem | pb.InventoryItem | None ) = None, assigned_object_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - assigned_object_journal_entry: ( - str | JournalEntry | pb.JournalEntry | None - ) = None, + assigned_object_journal_entry: JournalEntry | pb.JournalEntry | None = None, assigned_object_l2vpn: str | L2VPN | pb.L2VPN | None = None, assigned_object_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None + L2VPNTermination | pb.L2VPNTermination | None ) = None, assigned_object_location: str | Location | pb.Location | None = None, assigned_object_mac_address: str | MACAddress | pb.MACAddress | None = None, assigned_object_manufacturer: ( str | Manufacturer | pb.Manufacturer | None ) = None, - assigned_object_module: str | Module | pb.Module | None = None, + assigned_object_module: Module | pb.Module | None = None, assigned_object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, assigned_object_module_type: str | ModuleType | pb.ModuleType | None = None, assigned_object_module_type_profile: ( str | ModuleTypeProfile | pb.ModuleTypeProfile | None ) = None, - assigned_object_owner: str | Owner | pb.Owner | None = None, - assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, assigned_object_platform: str | Platform | pb.Platform | None = None, assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -4100,7 +4018,7 @@ def __new__( assigned_object_rir: str | RIR | pb.RIR | None = None, assigned_object_rack: str | Rack | pb.Rack | None = None, assigned_object_rack_reservation: ( - str | RackReservation | pb.RackReservation | None + RackReservation | pb.RackReservation | None ) = None, assigned_object_rack_role: str | RackRole | pb.RackRole | None = None, assigned_object_rack_type: str | RackType | pb.RackType | None = None, @@ -4117,17 +4035,15 @@ def __new__( assigned_object_tunnel: str | Tunnel | pb.Tunnel | None = None, assigned_object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, assigned_object_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None + TunnelTermination | pb.TunnelTermination | None ) = None, - assigned_object_vlan: str | VLAN | pb.VLAN | None = None, assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, assigned_object_vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, assigned_object_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, - assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, assigned_object_vrf: str | VRF | pb.VRF | None = None, assigned_object_virtual_chassis: ( str | VirtualChassis | pb.VirtualChassis | None @@ -4136,7 +4052,7 @@ def __new__( str | VirtualCircuit | pb.VirtualCircuit | None ) = None, assigned_object_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, assigned_object_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -4152,18 +4068,23 @@ def __new__( assigned_object_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - assigned_object_wireless_link: ( - str | WirelessLink | pb.WirelessLink | None - ) = None, - kind: str | None = None, - comments: str | None = None, + assigned_object_wireless_link: WirelessLink | pb.WirelessLink | None = None, + assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, + assigned_object_owner: str | Owner | pb.Owner | None = None, + assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.JournalEntry: - """Create a new JournalEntry.""" + ) -> pb.L2VPNTermination: + """Create a new L2VPNTermination.""" + l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) + assigned_object_interface = convert_to_protobuf( + assigned_object_interface, pb.Interface + ) + assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface + ) assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) assigned_object_asn_range = convert_to_protobuf( assigned_object_asn_range, pb.ASNRange @@ -4175,6 +4096,9 @@ def __new__( assigned_object_cable_path = convert_to_protobuf( assigned_object_cable_path, pb.CablePath ) + assigned_object_cable_termination = convert_to_protobuf( + assigned_object_cable_termination, pb.CableTermination + ) assigned_object_circuit = convert_to_protobuf( assigned_object_circuit, pb.Circuit ) @@ -4223,9 +4147,6 @@ def __new__( assigned_object_custom_field_choice_set = convert_to_protobuf( assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet ) - assigned_object_custom_link = convert_to_protobuf( - assigned_object_custom_link, pb.CustomLink - ) assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) assigned_object_device_bay = convert_to_protobuf( assigned_object_device_bay, pb.DeviceBay @@ -4266,9 +4187,6 @@ def __new__( assigned_object_ip_sec_proposal = convert_to_protobuf( assigned_object_ip_sec_proposal, pb.IPSecProposal ) - assigned_object_interface = convert_to_protobuf( - assigned_object_interface, pb.Interface - ) assigned_object_inventory_item = convert_to_protobuf( assigned_object_inventory_item, pb.InventoryItem ) @@ -4301,10 +4219,6 @@ def __new__( assigned_object_module_type_profile = convert_to_protobuf( assigned_object_module_type_profile, pb.ModuleTypeProfile ) - assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) - assigned_object_owner_group = convert_to_protobuf( - assigned_object_owner_group, pb.OwnerGroup - ) assigned_object_platform = convert_to_protobuf( assigned_object_platform, pb.Platform ) @@ -4368,7 +4282,6 @@ def __new__( assigned_object_tunnel_termination = convert_to_protobuf( assigned_object_tunnel_termination, pb.TunnelTermination ) - assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) assigned_object_vlan_group = convert_to_protobuf( assigned_object_vlan_group, pb.VLANGroup ) @@ -4378,9 +4291,6 @@ def __new__( assigned_object_vlan_translation_rule = convert_to_protobuf( assigned_object_vlan_translation_rule, pb.VLANTranslationRule ) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface - ) assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) assigned_object_virtual_chassis = convert_to_protobuf( assigned_object_virtual_chassis, pb.VirtualChassis @@ -4412,10 +4322,21 @@ def __new__( assigned_object_wireless_link = convert_to_protobuf( assigned_object_wireless_link, pb.WirelessLink ) + assigned_object_custom_link = convert_to_protobuf( + assigned_object_custom_link, pb.CustomLink + ) + assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) + assigned_object_owner_group = convert_to_protobuf( + assigned_object_owner_group, pb.OwnerGroup + ) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.JournalEntry( + result = pb.L2VPNTermination( + l2vpn=l2vpn, + assigned_object_interface=assigned_object_interface, + assigned_object_vlan=assigned_object_vlan, + assigned_object_vm_interface=assigned_object_vm_interface, assigned_object_asn=assigned_object_asn, assigned_object_asn_range=assigned_object_asn_range, assigned_object_aggregate=assigned_object_aggregate, @@ -4438,7 +4359,6 @@ def __new__( assigned_object_contact_role=assigned_object_contact_role, assigned_object_custom_field=assigned_object_custom_field, assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, - assigned_object_custom_link=assigned_object_custom_link, assigned_object_device=assigned_object_device, assigned_object_device_bay=assigned_object_device_bay, assigned_object_device_role=assigned_object_device_role, @@ -4453,7 +4373,6 @@ def __new__( assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, - assigned_object_interface=assigned_object_interface, assigned_object_inventory_item=assigned_object_inventory_item, assigned_object_inventory_item_role=assigned_object_inventory_item_role, assigned_object_journal_entry=assigned_object_journal_entry, @@ -4466,8 +4385,6 @@ def __new__( assigned_object_module_bay=assigned_object_module_bay, assigned_object_module_type=assigned_object_module_type, assigned_object_module_type_profile=assigned_object_module_type_profile, - assigned_object_owner=assigned_object_owner, - assigned_object_owner_group=assigned_object_owner_group, assigned_object_platform=assigned_object_platform, assigned_object_power_feed=assigned_object_power_feed, assigned_object_power_outlet=assigned_object_power_outlet, @@ -4495,11 +4412,9 @@ def __new__( assigned_object_tunnel=assigned_object_tunnel, assigned_object_tunnel_group=assigned_object_tunnel_group, assigned_object_tunnel_termination=assigned_object_tunnel_termination, - assigned_object_vlan=assigned_object_vlan, assigned_object_vlan_group=assigned_object_vlan_group, assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, - assigned_object_vm_interface=assigned_object_vm_interface, assigned_object_vrf=assigned_object_vrf, assigned_object_virtual_chassis=assigned_object_virtual_chassis, assigned_object_virtual_circuit=assigned_object_virtual_circuit, @@ -4511,8 +4426,9 @@ def __new__( assigned_object_wireless_lan=assigned_object_wireless_lan, assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, assigned_object_wireless_link=assigned_object_wireless_link, - kind=kind, - comments=comments, + assigned_object_custom_link=assigned_object_custom_link, + assigned_object_owner=assigned_object_owner, + assigned_object_owner_group=assigned_object_owner_group, tags=tags, custom_fields=custom_fields, metadata=metadata, @@ -4520,702 +4436,119 @@ def __new__( return result -class L2VPN: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPN.""" +class Location: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Location.""" def __new__( cls, - identifier: int | None = None, name: str | None = None, slug: str | None = None, - type: str | None = None, + site: str | Site | pb.Site | None = None, + parent: str | Location | pb.Location | None = None, status: str | None = None, - import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, + facility: str | None = None, + description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + comments: str | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.L2VPN: - """Create a new L2VPN.""" - import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) - export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) - owner = convert_to_protobuf(owner, pb.Owner) + owner: str | Owner | pb.Owner | None = None, + ) -> pb.Location: + """Create a new Location.""" + site = convert_to_protobuf(site, pb.Site) + parent = convert_to_protobuf(parent, pb.Location) tenant = convert_to_protobuf(tenant, pb.Tenant) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.L2VPN( - identifier=identifier, + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.Location( name=name, slug=slug, - type=type, + site=site, + parent=parent, status=status, - import_targets=import_targets, - export_targets=export_targets, - description=description, - owner=owner, - comments=comments, tenant=tenant, + facility=facility, + description=description, tags=tags, custom_fields=custom_fields, + comments=comments, metadata=metadata, + owner=owner, ) return result -class L2VPNTermination: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPNTermination.""" +class MACAddress: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.MACAddress.""" def __new__( cls, - l2vpn: str | L2VPN | pb.L2VPN | None = None, - assigned_object_asn: str | ASN | pb.ASN | None = None, - assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, - assigned_object_aggregate: str | Aggregate | pb.Aggregate | None = None, - assigned_object_cable: str | Cable | pb.Cable | None = None, - assigned_object_cable_path: str | CablePath | pb.CablePath | None = None, - assigned_object_cable_termination: ( - str | CableTermination | pb.CableTermination | None - ) = None, - assigned_object_circuit: str | Circuit | pb.Circuit | None = None, - assigned_object_circuit_group: ( - str | CircuitGroup | pb.CircuitGroup | None - ) = None, - assigned_object_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None - ) = None, - assigned_object_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None - ) = None, - assigned_object_circuit_type: str | CircuitType | pb.CircuitType | None = None, - assigned_object_cluster: str | Cluster | pb.Cluster | None = None, - assigned_object_cluster_group: ( - str | ClusterGroup | pb.ClusterGroup | None - ) = None, - assigned_object_cluster_type: str | ClusterType | pb.ClusterType | None = None, - assigned_object_console_port: str | ConsolePort | pb.ConsolePort | None = None, - assigned_object_console_server_port: ( - str | ConsoleServerPort | pb.ConsoleServerPort | None - ) = None, - assigned_object_contact: str | Contact | pb.Contact | None = None, - assigned_object_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None - ) = None, - assigned_object_contact_group: ( - str | ContactGroup | pb.ContactGroup | None - ) = None, - assigned_object_contact_role: str | ContactRole | pb.ContactRole | None = None, - assigned_object_custom_field: str | CustomField | pb.CustomField | None = None, - assigned_object_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, - assigned_object_device: str | Device | pb.Device | None = None, - assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, - assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, - assigned_object_device_type: str | DeviceType | pb.DeviceType | None = None, - assigned_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, - assigned_object_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None - ) = None, - assigned_object_front_port: str | FrontPort | pb.FrontPort | None = None, - assigned_object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, - assigned_object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, - assigned_object_ip_address: str | IPAddress | pb.IPAddress | None = None, - assigned_object_ip_range: str | IPRange | pb.IPRange | None = None, - assigned_object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, - assigned_object_ip_sec_profile: ( - str | IPSecProfile | pb.IPSecProfile | None - ) = None, - assigned_object_ip_sec_proposal: ( - str | IPSecProposal | pb.IPSecProposal | None - ) = None, + mac_address: str | None = None, assigned_object_interface: str | Interface | pb.Interface | None = None, - assigned_object_inventory_item: ( - str | InventoryItem | pb.InventoryItem | None - ) = None, - assigned_object_inventory_item_role: ( - str | InventoryItemRole | pb.InventoryItemRole | None - ) = None, - assigned_object_journal_entry: ( - str | JournalEntry | pb.JournalEntry | None - ) = None, - assigned_object_l2vpn: str | L2VPN | pb.L2VPN | None = None, - assigned_object_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None - ) = None, - assigned_object_location: str | Location | pb.Location | None = None, - assigned_object_mac_address: str | MACAddress | pb.MACAddress | None = None, - assigned_object_manufacturer: ( - str | Manufacturer | pb.Manufacturer | None - ) = None, - assigned_object_module: str | Module | pb.Module | None = None, - assigned_object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, - assigned_object_module_type: str | ModuleType | pb.ModuleType | None = None, - assigned_object_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - assigned_object_owner: str | Owner | pb.Owner | None = None, - assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, - assigned_object_platform: str | Platform | pb.Platform | None = None, - assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, - assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, - assigned_object_power_panel: str | PowerPanel | pb.PowerPanel | None = None, - assigned_object_power_port: str | PowerPort | pb.PowerPort | None = None, - assigned_object_prefix: str | Prefix | pb.Prefix | None = None, - assigned_object_provider: str | Provider | pb.Provider | None = None, - assigned_object_provider_account: ( - str | ProviderAccount | pb.ProviderAccount | None - ) = None, - assigned_object_provider_network: ( - str | ProviderNetwork | pb.ProviderNetwork | None - ) = None, - assigned_object_rir: str | RIR | pb.RIR | None = None, - assigned_object_rack: str | Rack | pb.Rack | None = None, - assigned_object_rack_reservation: ( - str | RackReservation | pb.RackReservation | None - ) = None, - assigned_object_rack_role: str | RackRole | pb.RackRole | None = None, - assigned_object_rack_type: str | RackType | pb.RackType | None = None, - assigned_object_rear_port: str | RearPort | pb.RearPort | None = None, - assigned_object_region: str | Region | pb.Region | None = None, - assigned_object_role: str | Role | pb.Role | None = None, - assigned_object_route_target: str | RouteTarget | pb.RouteTarget | None = None, - assigned_object_service: str | Service | pb.Service | None = None, - assigned_object_site: str | Site | pb.Site | None = None, - assigned_object_site_group: str | SiteGroup | pb.SiteGroup | None = None, - assigned_object_tag: str | Tag | pb.Tag | None = None, - assigned_object_tenant: str | Tenant | pb.Tenant | None = None, - assigned_object_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, - assigned_object_tunnel: str | Tunnel | pb.Tunnel | None = None, - assigned_object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - assigned_object_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None - ) = None, - assigned_object_vlan: str | VLAN | pb.VLAN | None = None, - assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, - assigned_object_vlan_translation_policy: ( - str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None - ) = None, - assigned_object_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None - ) = None, assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, - assigned_object_vrf: str | VRF | pb.VRF | None = None, - assigned_object_virtual_chassis: ( - str | VirtualChassis | pb.VirtualChassis | None - ) = None, - assigned_object_virtual_circuit: ( - str | VirtualCircuit | pb.VirtualCircuit | None - ) = None, - assigned_object_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None - ) = None, - assigned_object_virtual_circuit_type: ( - str | VirtualCircuitType | pb.VirtualCircuitType | None - ) = None, - assigned_object_virtual_device_context: ( - str | VirtualDeviceContext | pb.VirtualDeviceContext | None - ) = None, - assigned_object_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, - assigned_object_virtual_machine: ( - str | VirtualMachine | pb.VirtualMachine | None - ) = None, - assigned_object_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, - assigned_object_wireless_lan_group: ( - str | WirelessLANGroup | pb.WirelessLANGroup | None - ) = None, - assigned_object_wireless_link: ( - str | WirelessLink | pb.WirelessLink | None - ) = None, + description: str | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.L2VPNTermination: - """Create a new L2VPNTermination.""" - l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) - assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) - assigned_object_asn_range = convert_to_protobuf( - assigned_object_asn_range, pb.ASNRange - ) - assigned_object_aggregate = convert_to_protobuf( - assigned_object_aggregate, pb.Aggregate - ) - assigned_object_cable = convert_to_protobuf(assigned_object_cable, pb.Cable) - assigned_object_cable_path = convert_to_protobuf( - assigned_object_cable_path, pb.CablePath - ) - assigned_object_circuit = convert_to_protobuf( - assigned_object_circuit, pb.Circuit - ) - assigned_object_circuit_group = convert_to_protobuf( - assigned_object_circuit_group, pb.CircuitGroup - ) - assigned_object_circuit_group_assignment = convert_to_protobuf( - assigned_object_circuit_group_assignment, pb.CircuitGroupAssignment - ) - assigned_object_circuit_termination = convert_to_protobuf( - assigned_object_circuit_termination, pb.CircuitTermination - ) - assigned_object_circuit_type = convert_to_protobuf( - assigned_object_circuit_type, pb.CircuitType - ) - assigned_object_cluster = convert_to_protobuf( - assigned_object_cluster, pb.Cluster - ) - assigned_object_cluster_group = convert_to_protobuf( - assigned_object_cluster_group, pb.ClusterGroup - ) - assigned_object_cluster_type = convert_to_protobuf( - assigned_object_cluster_type, pb.ClusterType - ) - assigned_object_console_port = convert_to_protobuf( - assigned_object_console_port, pb.ConsolePort - ) - assigned_object_console_server_port = convert_to_protobuf( - assigned_object_console_server_port, pb.ConsoleServerPort - ) - assigned_object_contact = convert_to_protobuf( - assigned_object_contact, pb.Contact - ) - assigned_object_contact_assignment = convert_to_protobuf( - assigned_object_contact_assignment, pb.ContactAssignment - ) - assigned_object_contact_group = convert_to_protobuf( - assigned_object_contact_group, pb.ContactGroup - ) - assigned_object_contact_role = convert_to_protobuf( - assigned_object_contact_role, pb.ContactRole - ) - assigned_object_custom_field = convert_to_protobuf( - assigned_object_custom_field, pb.CustomField - ) - assigned_object_custom_field_choice_set = convert_to_protobuf( - assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - assigned_object_custom_link = convert_to_protobuf( - assigned_object_custom_link, pb.CustomLink - ) - assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) - assigned_object_device_bay = convert_to_protobuf( - assigned_object_device_bay, pb.DeviceBay - ) - assigned_object_device_role = convert_to_protobuf( - assigned_object_device_role, pb.DeviceRole - ) - assigned_object_device_type = convert_to_protobuf( - assigned_object_device_type, pb.DeviceType - ) - assigned_object_fhrp_group = convert_to_protobuf( - assigned_object_fhrp_group, pb.FHRPGroup - ) - assigned_object_fhrp_group_assignment = convert_to_protobuf( - assigned_object_fhrp_group_assignment, pb.FHRPGroupAssignment - ) - assigned_object_front_port = convert_to_protobuf( - assigned_object_front_port, pb.FrontPort - ) - assigned_object_ike_policy = convert_to_protobuf( - assigned_object_ike_policy, pb.IKEPolicy - ) - assigned_object_ike_proposal = convert_to_protobuf( - assigned_object_ike_proposal, pb.IKEProposal - ) - assigned_object_ip_address = convert_to_protobuf( - assigned_object_ip_address, pb.IPAddress - ) - assigned_object_ip_range = convert_to_protobuf( - assigned_object_ip_range, pb.IPRange - ) - assigned_object_ip_sec_policy = convert_to_protobuf( - assigned_object_ip_sec_policy, pb.IPSecPolicy - ) - assigned_object_ip_sec_profile = convert_to_protobuf( - assigned_object_ip_sec_profile, pb.IPSecProfile - ) - assigned_object_ip_sec_proposal = convert_to_protobuf( - assigned_object_ip_sec_proposal, pb.IPSecProposal - ) + owner: str | Owner | pb.Owner | None = None, + ) -> pb.MACAddress: + """Create a new MACAddress.""" assigned_object_interface = convert_to_protobuf( assigned_object_interface, pb.Interface ) - assigned_object_inventory_item = convert_to_protobuf( - assigned_object_inventory_item, pb.InventoryItem - ) - assigned_object_inventory_item_role = convert_to_protobuf( - assigned_object_inventory_item_role, pb.InventoryItemRole + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface ) - assigned_object_journal_entry = convert_to_protobuf( - assigned_object_journal_entry, pb.JournalEntry - ) - assigned_object_l2vpn = convert_to_protobuf(assigned_object_l2vpn, pb.L2VPN) - assigned_object_l2vpn_termination = convert_to_protobuf( - assigned_object_l2vpn_termination, pb.L2VPNTermination - ) - assigned_object_location = convert_to_protobuf( - assigned_object_location, pb.Location - ) - assigned_object_mac_address = convert_to_protobuf( - assigned_object_mac_address, pb.MACAddress - ) - assigned_object_manufacturer = convert_to_protobuf( - assigned_object_manufacturer, pb.Manufacturer - ) - assigned_object_module = convert_to_protobuf(assigned_object_module, pb.Module) - assigned_object_module_bay = convert_to_protobuf( - assigned_object_module_bay, pb.ModuleBay - ) - assigned_object_module_type = convert_to_protobuf( - assigned_object_module_type, pb.ModuleType - ) - assigned_object_module_type_profile = convert_to_protobuf( - assigned_object_module_type_profile, pb.ModuleTypeProfile - ) - assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) - assigned_object_owner_group = convert_to_protobuf( - assigned_object_owner_group, pb.OwnerGroup - ) - assigned_object_platform = convert_to_protobuf( - assigned_object_platform, pb.Platform - ) - assigned_object_power_feed = convert_to_protobuf( - assigned_object_power_feed, pb.PowerFeed - ) - assigned_object_power_outlet = convert_to_protobuf( - assigned_object_power_outlet, pb.PowerOutlet - ) - assigned_object_power_panel = convert_to_protobuf( - assigned_object_power_panel, pb.PowerPanel - ) - assigned_object_power_port = convert_to_protobuf( - assigned_object_power_port, pb.PowerPort - ) - assigned_object_prefix = convert_to_protobuf(assigned_object_prefix, pb.Prefix) - assigned_object_provider = convert_to_protobuf( - assigned_object_provider, pb.Provider - ) - assigned_object_provider_account = convert_to_protobuf( - assigned_object_provider_account, pb.ProviderAccount - ) - assigned_object_provider_network = convert_to_protobuf( - assigned_object_provider_network, pb.ProviderNetwork - ) - assigned_object_rir = convert_to_protobuf(assigned_object_rir, pb.RIR) - assigned_object_rack = convert_to_protobuf(assigned_object_rack, pb.Rack) - assigned_object_rack_reservation = convert_to_protobuf( - assigned_object_rack_reservation, pb.RackReservation - ) - assigned_object_rack_role = convert_to_protobuf( - assigned_object_rack_role, pb.RackRole - ) - assigned_object_rack_type = convert_to_protobuf( - assigned_object_rack_type, pb.RackType - ) - assigned_object_rear_port = convert_to_protobuf( - assigned_object_rear_port, pb.RearPort - ) - assigned_object_region = convert_to_protobuf(assigned_object_region, pb.Region) - assigned_object_role = convert_to_protobuf(assigned_object_role, pb.Role) - assigned_object_route_target = convert_to_protobuf( - assigned_object_route_target, pb.RouteTarget - ) - assigned_object_service = convert_to_protobuf( - assigned_object_service, pb.Service - ) - assigned_object_site = convert_to_protobuf(assigned_object_site, pb.Site) - assigned_object_site_group = convert_to_protobuf( - assigned_object_site_group, pb.SiteGroup - ) - assigned_object_tag = convert_to_protobuf(assigned_object_tag, pb.Tag) - assigned_object_tenant = convert_to_protobuf(assigned_object_tenant, pb.Tenant) - assigned_object_tenant_group = convert_to_protobuf( - assigned_object_tenant_group, pb.TenantGroup - ) - assigned_object_tunnel = convert_to_protobuf(assigned_object_tunnel, pb.Tunnel) - assigned_object_tunnel_group = convert_to_protobuf( - assigned_object_tunnel_group, pb.TunnelGroup - ) - assigned_object_tunnel_termination = convert_to_protobuf( - assigned_object_tunnel_termination, pb.TunnelTermination - ) - assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) - assigned_object_vlan_group = convert_to_protobuf( - assigned_object_vlan_group, pb.VLANGroup - ) - assigned_object_vlan_translation_policy = convert_to_protobuf( - assigned_object_vlan_translation_policy, pb.VLANTranslationPolicy - ) - assigned_object_vlan_translation_rule = convert_to_protobuf( - assigned_object_vlan_translation_rule, pb.VLANTranslationRule - ) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface - ) - assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) - assigned_object_virtual_chassis = convert_to_protobuf( - assigned_object_virtual_chassis, pb.VirtualChassis - ) - assigned_object_virtual_circuit = convert_to_protobuf( - assigned_object_virtual_circuit, pb.VirtualCircuit - ) - assigned_object_virtual_circuit_termination = convert_to_protobuf( - assigned_object_virtual_circuit_termination, pb.VirtualCircuitTermination - ) - assigned_object_virtual_circuit_type = convert_to_protobuf( - assigned_object_virtual_circuit_type, pb.VirtualCircuitType - ) - assigned_object_virtual_device_context = convert_to_protobuf( - assigned_object_virtual_device_context, pb.VirtualDeviceContext - ) - assigned_object_virtual_disk = convert_to_protobuf( - assigned_object_virtual_disk, pb.VirtualDisk - ) - assigned_object_virtual_machine = convert_to_protobuf( - assigned_object_virtual_machine, pb.VirtualMachine - ) - assigned_object_wireless_lan = convert_to_protobuf( - assigned_object_wireless_lan, pb.WirelessLAN - ) - assigned_object_wireless_lan_group = convert_to_protobuf( - assigned_object_wireless_lan_group, pb.WirelessLANGroup - ) - assigned_object_wireless_link = convert_to_protobuf( - assigned_object_wireless_link, pb.WirelessLink - ) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - result = pb.L2VPNTermination( - l2vpn=l2vpn, - assigned_object_asn=assigned_object_asn, - assigned_object_asn_range=assigned_object_asn_range, - assigned_object_aggregate=assigned_object_aggregate, - assigned_object_cable=assigned_object_cable, - assigned_object_cable_path=assigned_object_cable_path, - assigned_object_cable_termination=assigned_object_cable_termination, - assigned_object_circuit=assigned_object_circuit, - assigned_object_circuit_group=assigned_object_circuit_group, - assigned_object_circuit_group_assignment=assigned_object_circuit_group_assignment, - assigned_object_circuit_termination=assigned_object_circuit_termination, - assigned_object_circuit_type=assigned_object_circuit_type, - assigned_object_cluster=assigned_object_cluster, - assigned_object_cluster_group=assigned_object_cluster_group, - assigned_object_cluster_type=assigned_object_cluster_type, - assigned_object_console_port=assigned_object_console_port, - assigned_object_console_server_port=assigned_object_console_server_port, - assigned_object_contact=assigned_object_contact, - assigned_object_contact_assignment=assigned_object_contact_assignment, - assigned_object_contact_group=assigned_object_contact_group, - assigned_object_contact_role=assigned_object_contact_role, - assigned_object_custom_field=assigned_object_custom_field, - assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, - assigned_object_custom_link=assigned_object_custom_link, - assigned_object_device=assigned_object_device, - assigned_object_device_bay=assigned_object_device_bay, - assigned_object_device_role=assigned_object_device_role, - assigned_object_device_type=assigned_object_device_type, - assigned_object_fhrp_group=assigned_object_fhrp_group, - assigned_object_fhrp_group_assignment=assigned_object_fhrp_group_assignment, - assigned_object_front_port=assigned_object_front_port, - assigned_object_ike_policy=assigned_object_ike_policy, - assigned_object_ike_proposal=assigned_object_ike_proposal, - assigned_object_ip_address=assigned_object_ip_address, - assigned_object_ip_range=assigned_object_ip_range, - assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, - assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, - assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, - assigned_object_interface=assigned_object_interface, - assigned_object_inventory_item=assigned_object_inventory_item, - assigned_object_inventory_item_role=assigned_object_inventory_item_role, - assigned_object_journal_entry=assigned_object_journal_entry, - assigned_object_l2vpn=assigned_object_l2vpn, - assigned_object_l2vpn_termination=assigned_object_l2vpn_termination, - assigned_object_location=assigned_object_location, - assigned_object_mac_address=assigned_object_mac_address, - assigned_object_manufacturer=assigned_object_manufacturer, - assigned_object_module=assigned_object_module, - assigned_object_module_bay=assigned_object_module_bay, - assigned_object_module_type=assigned_object_module_type, - assigned_object_module_type_profile=assigned_object_module_type_profile, - assigned_object_owner=assigned_object_owner, - assigned_object_owner_group=assigned_object_owner_group, - assigned_object_platform=assigned_object_platform, - assigned_object_power_feed=assigned_object_power_feed, - assigned_object_power_outlet=assigned_object_power_outlet, - assigned_object_power_panel=assigned_object_power_panel, - assigned_object_power_port=assigned_object_power_port, - assigned_object_prefix=assigned_object_prefix, - assigned_object_provider=assigned_object_provider, - assigned_object_provider_account=assigned_object_provider_account, - assigned_object_provider_network=assigned_object_provider_network, - assigned_object_rir=assigned_object_rir, - assigned_object_rack=assigned_object_rack, - assigned_object_rack_reservation=assigned_object_rack_reservation, - assigned_object_rack_role=assigned_object_rack_role, - assigned_object_rack_type=assigned_object_rack_type, - assigned_object_rear_port=assigned_object_rear_port, - assigned_object_region=assigned_object_region, - assigned_object_role=assigned_object_role, - assigned_object_route_target=assigned_object_route_target, - assigned_object_service=assigned_object_service, - assigned_object_site=assigned_object_site, - assigned_object_site_group=assigned_object_site_group, - assigned_object_tag=assigned_object_tag, - assigned_object_tenant=assigned_object_tenant, - assigned_object_tenant_group=assigned_object_tenant_group, - assigned_object_tunnel=assigned_object_tunnel, - assigned_object_tunnel_group=assigned_object_tunnel_group, - assigned_object_tunnel_termination=assigned_object_tunnel_termination, - assigned_object_vlan=assigned_object_vlan, - assigned_object_vlan_group=assigned_object_vlan_group, - assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, - assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, - assigned_object_vm_interface=assigned_object_vm_interface, - assigned_object_vrf=assigned_object_vrf, - assigned_object_virtual_chassis=assigned_object_virtual_chassis, - assigned_object_virtual_circuit=assigned_object_virtual_circuit, - assigned_object_virtual_circuit_termination=assigned_object_virtual_circuit_termination, - assigned_object_virtual_circuit_type=assigned_object_virtual_circuit_type, - assigned_object_virtual_device_context=assigned_object_virtual_device_context, - assigned_object_virtual_disk=assigned_object_virtual_disk, - assigned_object_virtual_machine=assigned_object_virtual_machine, - assigned_object_wireless_lan=assigned_object_wireless_lan, - assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, - assigned_object_wireless_link=assigned_object_wireless_link, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.MACAddress( + mac_address=mac_address, + assigned_object_interface=assigned_object_interface, + assigned_object_vm_interface=assigned_object_vm_interface, + description=description, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + owner=owner, ) return result -class Location: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Location.""" +class Manufacturer: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Manufacturer.""" def __new__( cls, name: str | None = None, slug: str | None = None, - site: str | Site | pb.Site | None = None, - parent: str | Location | pb.Location | None = None, - status: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - facility: str | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - ) -> pb.Location: - """Create a new Location.""" - site = convert_to_protobuf(site, pb.Site) - parent = convert_to_protobuf(parent, pb.Location) - tenant = convert_to_protobuf(tenant, pb.Tenant) + ) -> pb.Manufacturer: + """Create a new Manufacturer.""" tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.Location( - name=name, - slug=slug, - site=site, - parent=parent, - status=status, - tenant=tenant, - facility=facility, - description=description, - tags=tags, - owner=owner, - comments=comments, - custom_fields=custom_fields, - metadata=metadata, - ) - return result - - -class MACAddress: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.MACAddress.""" - - def __new__( - cls, - mac_address: str | None = None, - assigned_object_interface: str | Interface | pb.Interface | None = None, - assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, - description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - ) -> pb.MACAddress: - """Create a new MACAddress.""" - assigned_object_interface = convert_to_protobuf( - assigned_object_interface, pb.Interface - ) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface - ) - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - result = pb.MACAddress( - mac_address=mac_address, - assigned_object_interface=assigned_object_interface, - assigned_object_vm_interface=assigned_object_vm_interface, - description=description, - owner=owner, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - ) - return result - - -class Manufacturer: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Manufacturer.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - ) -> pb.Manufacturer: - """Create a new Manufacturer.""" owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) result = pb.Manufacturer( name=name, slug=slug, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -5232,22 +4565,20 @@ def __new__( serial: str | None = None, asset_tag: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Module: """Create a new Module.""" device = convert_to_protobuf(device, pb.Device) module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) module_type = convert_to_protobuf(module_type, pb.ModuleType) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Module( device=device, module_bay=module_bay, @@ -5256,11 +4587,11 @@ def __new__( serial=serial, asset_tag=asset_tag, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5271,27 +4602,25 @@ class ModuleBay: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, - installed_module: str | Module | pb.Module | None = None, + installed_module: Module | pb.Module | None = None, label: str | None = None, position: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ModuleBay: """Create a new ModuleBay.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) installed_module = convert_to_protobuf(installed_module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ModuleBay( device=device, module=module, @@ -5300,10 +4629,10 @@ def __new__( label=label, position=position, description=description, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5313,7 +4642,6 @@ class ModuleType: def __new__( cls, - profile: str | ModuleTypeProfile | pb.ModuleTypeProfile | None = None, manufacturer: str | Manufacturer | pb.Manufacturer | None = None, model: str | None = None, part_number: str | None = None, @@ -5321,24 +4649,22 @@ def __new__( weight: float | None = None, weight_unit: str | None = None, description: str | None = None, - attributes: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + profile: str | ModuleTypeProfile | pb.ModuleTypeProfile | None = None, + attributes: str | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ModuleType: """Create a new ModuleType.""" - profile = convert_to_protobuf(profile, pb.ModuleTypeProfile) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + profile = convert_to_protobuf(profile, pb.ModuleTypeProfile) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ModuleType( - profile=profile, manufacturer=manufacturer, model=model, part_number=part_number, @@ -5346,87 +4672,13 @@ def __new__( weight=weight, weight_unit=weight_unit, description=description, - attributes=attributes, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + profile=profile, + attributes=attributes, metadata=metadata, - ) - return result - - -class ModuleTypeProfile: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleTypeProfile.""" - - def __new__( - cls, - name: str | None = None, - description: str | None = None, - schema: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - ) -> pb.ModuleTypeProfile: - """Create a new ModuleTypeProfile.""" - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - result = pb.ModuleTypeProfile( - name=name, - description=description, - schema=schema, owner=owner, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - ) - return result - - -class Owner: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Owner.""" - - def __new__( - cls, - name: str | None = None, - group: str | OwnerGroup | pb.OwnerGroup | None = None, - description: str | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.Owner: - """Create a new Owner.""" - group = convert_to_protobuf(group, pb.OwnerGroup) - metadata = convert_dict_to_struct(metadata) - result = pb.Owner( - name=name, - group=group, - description=description, - metadata=metadata, - ) - return result - - -class OwnerGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.OwnerGroup.""" - - def __new__( - cls, - name: str | None = None, - description: str | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.OwnerGroup: - """Create a new OwnerGroup.""" - metadata = convert_dict_to_struct(metadata) - result = pb.OwnerGroup( - name=name, - description=description, - metadata=metadata, ) return result @@ -5436,37 +4688,35 @@ class Platform: def __new__( cls, - parent: str | Platform | pb.Platform | None = None, name: str | None = None, slug: str | None = None, manufacturer: str | Manufacturer | pb.Manufacturer | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + parent: str | Platform | pb.Platform | None = None, + comments: str | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Platform: """Create a new Platform.""" - parent = convert_to_protobuf(parent, pb.Platform) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + parent = convert_to_protobuf(parent, pb.Platform) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Platform( - parent=parent, name=name, slug=slug, manufacturer=manufacturer, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, + parent=parent, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -5489,22 +4739,20 @@ def __new__( mark_connected: bool | None = None, description: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.PowerFeed: """Create a new PowerFeed.""" power_panel = convert_to_protobuf(power_panel, pb.PowerPanel) rack = convert_to_protobuf(rack, pb.Rack) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.PowerFeed( power_panel=power_panel, rack=rack, @@ -5519,11 +4767,11 @@ def __new__( mark_connected=mark_connected, description=description, tenant=tenant, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5534,47 +4782,45 @@ class PowerOutlet: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, - status: str | None = None, color: str | None = None, power_port: str | PowerPort | pb.PowerPort | None = None, feed_leg: str | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + status: str | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.PowerOutlet: """Create a new PowerOutlet.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) power_port = convert_to_protobuf(power_port, pb.PowerPort) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.PowerOutlet( device=device, module=module, name=name, label=label, type=type, - status=status, color=color, power_port=power_port, feed_leg=feed_leg, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, + status=status, metadata=metadata, + owner=owner, ) return result @@ -5588,31 +4834,29 @@ def __new__( location: str | Location | pb.Location | None = None, name: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.PowerPanel: """Create a new PowerPanel.""" site = convert_to_protobuf(site, pb.Site) location = convert_to_protobuf(location, pb.Location) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.PowerPanel( site=site, location=location, name=name, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5623,7 +4867,7 @@ class PowerPort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, @@ -5631,20 +4875,18 @@ def __new__( allocated_draw: int | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.PowerPort: """Create a new PowerPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.PowerPort( device=device, module=module, @@ -5655,10 +4897,10 @@ def __new__( allocated_draw=allocated_draw, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5681,13 +4923,11 @@ def __new__( is_pool: bool | None = None, mark_utilized: bool | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Prefix: """Create a new Prefix.""" vrf = convert_to_protobuf(vrf, pb.VRF) @@ -5698,10 +4938,10 @@ def __new__( tenant = convert_to_protobuf(tenant, pb.Tenant) vlan = convert_to_protobuf(vlan, pb.VLAN) role = convert_to_protobuf(role, pb.Role) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Prefix( prefix=prefix, vrf=vrf, @@ -5716,11 +4956,11 @@ def __new__( is_pool=is_pool, mark_utilized=mark_utilized, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5732,35 +4972,33 @@ def __new__( cls, name: str | None = None, slug: str | None = None, - accounts: list[str | ProviderAccount | pb.ProviderAccount] | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - asns: list[str | ASN | pb.ASN] | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + accounts: list[str | ProviderAccount | pb.ProviderAccount] | None = None, + asns: list[str | ASN | pb.ASN] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Provider: """Create a new Provider.""" - accounts = convert_to_protobuf_list(accounts, pb.ProviderAccount) - owner = convert_to_protobuf(owner, pb.Owner) - asns = convert_to_protobuf_list(asns, pb.ASN) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + accounts = convert_to_protobuf_list(accounts, pb.ProviderAccount) + asns = convert_to_protobuf_list(asns, pb.ASN) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Provider( name=name, slug=slug, - accounts=accounts, description=description, - owner=owner, comments=comments, - asns=asns, tags=tags, custom_fields=custom_fields, + accounts=accounts, + asns=asns, metadata=metadata, + owner=owner, ) return result @@ -5774,30 +5012,28 @@ def __new__( name: str | None = None, account: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ProviderAccount: """Create a new ProviderAccount.""" provider = convert_to_protobuf(provider, pb.Provider) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ProviderAccount( provider=provider, name=name, account=account, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5811,30 +5047,28 @@ def __new__( name: str | None = None, service_id: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ProviderNetwork: """Create a new ProviderNetwork.""" provider = convert_to_protobuf(provider, pb.Provider) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ProviderNetwork( provider=provider, name=name, service_id=service_id, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5848,29 +5082,27 @@ def __new__( slug: str | None = None, is_private: bool | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.RIR: """Create a new RIR.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RIR( name=name, slug=slug, is_private=is_private, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -5899,19 +5131,17 @@ def __new__( weight_unit: str | None = None, desc_units: bool | None = None, outer_width: int | None = None, - outer_height: int | None = None, outer_depth: int | None = None, outer_unit: str | None = None, mounting_depth: int | None = None, airflow: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + outer_height: int | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Rack: """Create a new Rack.""" site = convert_to_protobuf(site, pb.Site) @@ -5919,10 +5149,10 @@ def __new__( tenant = convert_to_protobuf(tenant, pb.Tenant) role = convert_to_protobuf(role, pb.RackRole) rack_type = convert_to_protobuf(rack_type, pb.RackType) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Rack( name=name, facility_id=facility_id, @@ -5943,17 +5173,17 @@ def __new__( weight_unit=weight_unit, desc_units=desc_units, outer_width=outer_width, - outer_height=outer_height, outer_depth=outer_depth, outer_unit=outer_unit, mounting_depth=mounting_depth, airflow=airflow, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + outer_height=outer_height, metadata=metadata, + owner=owner, ) return result @@ -5965,35 +5195,33 @@ def __new__( cls, rack: str | Rack | pb.Rack | None = None, units: list[int] | None = None, - status: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + status: str | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.RackReservation: """Create a new RackReservation.""" rack = convert_to_protobuf(rack, pb.Rack) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RackReservation( rack=rack, units=units, - status=status, tenant=tenant, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + status=status, metadata=metadata, + owner=owner, ) return result @@ -6007,29 +5235,27 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.RackRole: """Create a new RackRole.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RackRole( name=name, slug=slug, color=color, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -6049,27 +5275,25 @@ def __new__( starting_unit: int | None = None, desc_units: bool | None = None, outer_width: int | None = None, - outer_height: int | None = None, outer_depth: int | None = None, outer_unit: str | None = None, weight: float | None = None, max_weight: int | None = None, weight_unit: str | None = None, mounting_depth: int | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + outer_height: int | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.RackType: """Create a new RackType.""" manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RackType( manufacturer=manufacturer, model=model, @@ -6081,18 +5305,18 @@ def __new__( starting_unit=starting_unit, desc_units=desc_units, outer_width=outer_width, - outer_height=outer_height, outer_depth=outer_depth, outer_unit=outer_unit, weight=weight, max_weight=max_weight, weight_unit=weight_unit, mounting_depth=mounting_depth, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + outer_height=outer_height, metadata=metadata, + owner=owner, ) return result @@ -6103,7 +5327,7 @@ class RearPort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, @@ -6111,20 +5335,18 @@ def __new__( positions: int | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.RearPort: """Create a new RearPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RearPort( device=device, module=module, @@ -6135,10 +5357,10 @@ def __new__( positions=positions, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -6153,29 +5375,27 @@ def __new__( parent: str | Region | pb.Region | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Region: """Create a new Region.""" parent = convert_to_protobuf(parent, pb.Region) tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Region( name=name, slug=slug, parent=parent, description=description, tags=tags, - owner=owner, - comments=comments, custom_fields=custom_fields, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -6189,29 +5409,27 @@ def __new__( slug: str | None = None, weight: int | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.Role: """Create a new Role.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Role( name=name, slug=slug, weight=weight, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -6224,29 +5442,27 @@ def __new__( name: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.RouteTarget: """Create a new RouteTarget.""" tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RouteTarget( name=name, tenant=tenant, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -6256,25 +5472,30 @@ class Service: def __new__( cls, - parent_object_device: str | Device | pb.Device | None = None, - parent_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, - parent_object_virtual_machine: ( - str | VirtualMachine | pb.VirtualMachine | None - ) = None, + device: str | Device | pb.Device | None = None, + virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, name: str | None = None, protocol: str | None = None, ports: list[int] | None = None, - ipaddresses: list[str | IPAddress | pb.IPAddress] | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + ipaddresses: list[str | IPAddress | pb.IPAddress] | None = None, + parent_object_device: str | Device | pb.Device | None = None, + parent_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, + parent_object_virtual_machine: ( + str | VirtualMachine | pb.VirtualMachine | None ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Service: """Create a new Service.""" + device = convert_to_protobuf(device, pb.Device) + virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + ipaddresses = convert_to_protobuf_list(ipaddresses, pb.IPAddress) parent_object_device = convert_to_protobuf(parent_object_device, pb.Device) parent_object_fhrp_group = convert_to_protobuf( parent_object_fhrp_group, pb.FHRPGroup @@ -6282,25 +5503,24 @@ def __new__( parent_object_virtual_machine = convert_to_protobuf( parent_object_virtual_machine, pb.VirtualMachine ) - ipaddresses = convert_to_protobuf_list(ipaddresses, pb.IPAddress) - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Service( - parent_object_device=parent_object_device, - parent_object_fhrp_group=parent_object_fhrp_group, - parent_object_virtual_machine=parent_object_virtual_machine, + device=device, + virtual_machine=virtual_machine, name=name, protocol=protocol, ports=ports, - ipaddresses=ipaddresses, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + ipaddresses=ipaddresses, + parent_object_device=parent_object_device, + parent_object_fhrp_group=parent_object_fhrp_group, + parent_object_virtual_machine=parent_object_virtual_machine, metadata=metadata, + owner=owner, ) return result @@ -6323,24 +5543,22 @@ def __new__( shipping_address: str | None = None, latitude: float | None = None, longitude: float | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - asns: list[str | ASN | pb.ASN] | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + asns: list[str | ASN | pb.ASN] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Site: """Create a new Site.""" region = convert_to_protobuf(region, pb.Region) group = convert_to_protobuf(group, pb.SiteGroup) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) - asns = convert_to_protobuf_list(asns, pb.ASN) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + asns = convert_to_protobuf_list(asns, pb.ASN) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Site( name=name, slug=slug, @@ -6355,12 +5573,12 @@ def __new__( shipping_address=shipping_address, latitude=latitude, longitude=longitude, - owner=owner, comments=comments, - asns=asns, tags=tags, custom_fields=custom_fields, + asns=asns, metadata=metadata, + owner=owner, ) return result @@ -6375,29 +5593,27 @@ def __new__( parent: str | SiteGroup | pb.SiteGroup | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.SiteGroup: """Create a new SiteGroup.""" parent = convert_to_protobuf(parent, pb.SiteGroup) tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.SiteGroup( name=name, slug=slug, parent=parent, description=description, tags=tags, - owner=owner, - comments=comments, custom_fields=custom_fields, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -6438,30 +5654,28 @@ def __new__( slug: str | None = None, group: str | TenantGroup | pb.TenantGroup | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Tenant: """Create a new Tenant.""" group = convert_to_protobuf(group, pb.TenantGroup) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Tenant( name=name, slug=slug, group=group, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -6476,29 +5690,27 @@ def __new__( parent: str | TenantGroup | pb.TenantGroup | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.TenantGroup: """Create a new TenantGroup.""" parent = convert_to_protobuf(parent, pb.TenantGroup) tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.TenantGroup( name=name, slug=slug, parent=parent, description=description, tags=tags, - owner=owner, - comments=comments, custom_fields=custom_fields, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -6516,22 +5728,20 @@ def __new__( tenant: str | Tenant | pb.Tenant | None = None, tunnel_id: int | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Tunnel: """Create a new Tunnel.""" group = convert_to_protobuf(group, pb.TunnelGroup) ipsec_profile = convert_to_protobuf(ipsec_profile, pb.IPSecProfile) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Tunnel( name=name, status=status, @@ -6541,11 +5751,11 @@ def __new__( tenant=tenant, tunnel_id=tunnel_id, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -6558,28 +5768,26 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.TunnelGroup: """Create a new TunnelGroup.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.TunnelGroup( name=name, slug=slug, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -6593,19 +5801,19 @@ def __new__( role: str | None = None, termination_asn: str | ASN | pb.ASN | None = None, termination_asn_range: str | ASNRange | pb.ASNRange | None = None, - termination_aggregate: str | Aggregate | pb.Aggregate | None = None, - termination_cable: str | Cable | pb.Cable | None = None, - termination_cable_path: str | CablePath | pb.CablePath | None = None, + termination_aggregate: Aggregate | pb.Aggregate | None = None, + termination_cable: Cable | pb.Cable | None = None, + termination_cable_path: CablePath | pb.CablePath | None = None, termination_cable_termination: ( - str | CableTermination | pb.CableTermination | None + CableTermination | pb.CableTermination | None ) = None, termination_circuit: str | Circuit | pb.Circuit | None = None, termination_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, termination_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, termination_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitTermination | pb.CircuitTermination | None ) = None, termination_circuit_type: str | CircuitType | pb.CircuitType | None = None, termination_cluster: str | Cluster | pb.Cluster | None = None, @@ -6617,28 +5825,23 @@ def __new__( ) = None, termination_contact: str | Contact | pb.Contact | None = None, termination_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None + ContactAssignment | pb.ContactAssignment | None ) = None, termination_contact_group: str | ContactGroup | pb.ContactGroup | None = None, termination_contact_role: str | ContactRole | pb.ContactRole | None = None, - termination_custom_field: str | CustomField | pb.CustomField | None = None, - termination_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - termination_custom_link: str | CustomLink | pb.CustomLink | None = None, termination_device: str | Device | pb.Device | None = None, termination_device_bay: str | DeviceBay | pb.DeviceBay | None = None, termination_device_role: str | DeviceRole | pb.DeviceRole | None = None, termination_device_type: str | DeviceType | pb.DeviceType | None = None, termination_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, termination_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, termination_front_port: str | FrontPort | pb.FrontPort | None = None, termination_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, termination_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, termination_ip_address: str | IPAddress | pb.IPAddress | None = None, - termination_ip_range: str | IPRange | pb.IPRange | None = None, + termination_ip_range: IPRange | pb.IPRange | None = None, termination_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, termination_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, termination_ip_sec_proposal: ( @@ -6651,22 +5854,16 @@ def __new__( termination_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - termination_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, termination_l2vpn: str | L2VPN | pb.L2VPN | None = None, termination_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None + L2VPNTermination | pb.L2VPNTermination | None ) = None, termination_location: str | Location | pb.Location | None = None, termination_mac_address: str | MACAddress | pb.MACAddress | None = None, termination_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - termination_module: str | Module | pb.Module | None = None, + termination_module: Module | pb.Module | None = None, termination_module_bay: str | ModuleBay | pb.ModuleBay | None = None, termination_module_type: str | ModuleType | pb.ModuleType | None = None, - termination_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - termination_owner: str | Owner | pb.Owner | None = None, - termination_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, termination_platform: str | Platform | pb.Platform | None = None, termination_power_feed: str | PowerFeed | pb.PowerFeed | None = None, termination_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -6683,7 +5880,7 @@ def __new__( termination_rir: str | RIR | pb.RIR | None = None, termination_rack: str | Rack | pb.Rack | None = None, termination_rack_reservation: ( - str | RackReservation | pb.RackReservation | None + RackReservation | pb.RackReservation | None ) = None, termination_rack_role: str | RackRole | pb.RackRole | None = None, termination_rack_type: str | RackType | pb.RackType | None = None, @@ -6700,7 +5897,7 @@ def __new__( termination_tunnel: str | Tunnel | pb.Tunnel | None = None, termination_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, termination_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None + TunnelTermination | pb.TunnelTermination | None ) = None, termination_vlan: str | VLAN | pb.VLAN | None = None, termination_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, @@ -6708,7 +5905,7 @@ def __new__( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, termination_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, termination_vm_interface: str | VMInterface | pb.VMInterface | None = None, termination_vrf: str | VRF | pb.VRF | None = None, @@ -6719,7 +5916,7 @@ def __new__( str | VirtualCircuit | pb.VirtualCircuit | None ) = None, termination_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, termination_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -6735,12 +5932,21 @@ def __new__( termination_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - termination_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + termination_wireless_link: WirelessLink | pb.WirelessLink | None = None, + termination_custom_field: str | CustomField | pb.CustomField | None = None, + termination_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + termination_journal_entry: JournalEntry | pb.JournalEntry | None = None, + termination_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + termination_custom_link: str | CustomLink | pb.CustomLink | None = None, + termination_owner: str | Owner | pb.Owner | None = None, + termination_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, outside_ip: str | IPAddress | pb.IPAddress | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, ) -> pb.TunnelTermination: """Create a new TunnelTermination.""" @@ -6752,6 +5958,9 @@ def __new__( termination_cable_path = convert_to_protobuf( termination_cable_path, pb.CablePath ) + termination_cable_termination = convert_to_protobuf( + termination_cable_termination, pb.CableTermination + ) termination_circuit = convert_to_protobuf(termination_circuit, pb.Circuit) termination_circuit_group = convert_to_protobuf( termination_circuit_group, pb.CircuitGroup @@ -6788,15 +5997,6 @@ def __new__( termination_contact_role = convert_to_protobuf( termination_contact_role, pb.ContactRole ) - termination_custom_field = convert_to_protobuf( - termination_custom_field, pb.CustomField - ) - termination_custom_field_choice_set = convert_to_protobuf( - termination_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - termination_custom_link = convert_to_protobuf( - termination_custom_link, pb.CustomLink - ) termination_device = convert_to_protobuf(termination_device, pb.Device) termination_device_bay = convert_to_protobuf( termination_device_bay, pb.DeviceBay @@ -6842,9 +6042,6 @@ def __new__( termination_inventory_item_role = convert_to_protobuf( termination_inventory_item_role, pb.InventoryItemRole ) - termination_journal_entry = convert_to_protobuf( - termination_journal_entry, pb.JournalEntry - ) termination_l2vpn = convert_to_protobuf(termination_l2vpn, pb.L2VPN) termination_l2vpn_termination = convert_to_protobuf( termination_l2vpn_termination, pb.L2VPNTermination @@ -6863,13 +6060,6 @@ def __new__( termination_module_type = convert_to_protobuf( termination_module_type, pb.ModuleType ) - termination_module_type_profile = convert_to_protobuf( - termination_module_type_profile, pb.ModuleTypeProfile - ) - termination_owner = convert_to_protobuf(termination_owner, pb.Owner) - termination_owner_group = convert_to_protobuf( - termination_owner_group, pb.OwnerGroup - ) termination_platform = convert_to_protobuf(termination_platform, pb.Platform) termination_power_feed = convert_to_protobuf( termination_power_feed, pb.PowerFeed @@ -6965,24 +6155,43 @@ def __new__( termination_wireless_link = convert_to_protobuf( termination_wireless_link, pb.WirelessLink ) - outside_ip = convert_to_protobuf(outside_ip, pb.IPAddress) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - result = pb.TunnelTermination( - tunnel=tunnel, - role=role, - termination_asn=termination_asn, - termination_asn_range=termination_asn_range, - termination_aggregate=termination_aggregate, - termination_cable=termination_cable, - termination_cable_path=termination_cable_path, - termination_cable_termination=termination_cable_termination, - termination_circuit=termination_circuit, - termination_circuit_group=termination_circuit_group, - termination_circuit_group_assignment=termination_circuit_group_assignment, - termination_circuit_termination=termination_circuit_termination, - termination_circuit_type=termination_circuit_type, + termination_custom_field = convert_to_protobuf( + termination_custom_field, pb.CustomField + ) + termination_custom_field_choice_set = convert_to_protobuf( + termination_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + termination_journal_entry = convert_to_protobuf( + termination_journal_entry, pb.JournalEntry + ) + termination_module_type_profile = convert_to_protobuf( + termination_module_type_profile, pb.ModuleTypeProfile + ) + termination_custom_link = convert_to_protobuf( + termination_custom_link, pb.CustomLink + ) + termination_owner = convert_to_protobuf(termination_owner, pb.Owner) + termination_owner_group = convert_to_protobuf( + termination_owner_group, pb.OwnerGroup + ) + outside_ip = convert_to_protobuf(outside_ip, pb.IPAddress) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.TunnelTermination( + tunnel=tunnel, + role=role, + termination_asn=termination_asn, + termination_asn_range=termination_asn_range, + termination_aggregate=termination_aggregate, + termination_cable=termination_cable, + termination_cable_path=termination_cable_path, + termination_cable_termination=termination_cable_termination, + termination_circuit=termination_circuit, + termination_circuit_group=termination_circuit_group, + termination_circuit_group_assignment=termination_circuit_group_assignment, + termination_circuit_termination=termination_circuit_termination, + termination_circuit_type=termination_circuit_type, termination_cluster=termination_cluster, termination_cluster_group=termination_cluster_group, termination_cluster_type=termination_cluster_type, @@ -6992,9 +6201,6 @@ def __new__( termination_contact_assignment=termination_contact_assignment, termination_contact_group=termination_contact_group, termination_contact_role=termination_contact_role, - termination_custom_field=termination_custom_field, - termination_custom_field_choice_set=termination_custom_field_choice_set, - termination_custom_link=termination_custom_link, termination_device=termination_device, termination_device_bay=termination_device_bay, termination_device_role=termination_device_role, @@ -7012,7 +6218,6 @@ def __new__( termination_interface=termination_interface, termination_inventory_item=termination_inventory_item, termination_inventory_item_role=termination_inventory_item_role, - termination_journal_entry=termination_journal_entry, termination_l2vpn=termination_l2vpn, termination_l2vpn_termination=termination_l2vpn_termination, termination_location=termination_location, @@ -7021,9 +6226,6 @@ def __new__( termination_module=termination_module, termination_module_bay=termination_module_bay, termination_module_type=termination_module_type, - termination_module_type_profile=termination_module_type_profile, - termination_owner=termination_owner, - termination_owner_group=termination_owner_group, termination_platform=termination_platform, termination_power_feed=termination_power_feed, termination_power_outlet=termination_power_outlet, @@ -7067,6 +6269,13 @@ def __new__( termination_wireless_lan=termination_wireless_lan, termination_wireless_lan_group=termination_wireless_lan_group, termination_wireless_link=termination_wireless_link, + termination_custom_field=termination_custom_field, + termination_custom_field_choice_set=termination_custom_field_choice_set, + termination_journal_entry=termination_journal_entry, + termination_module_type_profile=termination_module_type_profile, + termination_custom_link=termination_custom_link, + termination_owner=termination_owner, + termination_owner_group=termination_owner_group, outside_ip=outside_ip, tags=tags, custom_fields=custom_fields, @@ -7090,13 +6299,11 @@ def __new__( description: str | None = None, qinq_role: str | None = None, qinq_svlan: str | VLAN | pb.VLAN | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VLAN: """Create a new VLAN.""" site = convert_to_protobuf(site, pb.Site) @@ -7104,10 +6311,10 @@ def __new__( tenant = convert_to_protobuf(tenant, pb.Tenant) role = convert_to_protobuf(role, pb.Role) qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VLAN( site=site, group=group, @@ -7119,11 +6326,11 @@ def __new__( description=description, qinq_role=qinq_role, qinq_svlan=qinq_svlan, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -7143,15 +6350,13 @@ def __new__( scope_site: str | Site | pb.Site | None = None, scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, vid_ranges: list[int] | None = None, - tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + tenant: str | Tenant | pb.Tenant | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.VLANGroup: """Create a new VLANGroup.""" scope_cluster = convert_to_protobuf(scope_cluster, pb.Cluster) @@ -7161,11 +6366,11 @@ def __new__( scope_region = convert_to_protobuf(scope_region, pb.Region) scope_site = convert_to_protobuf(scope_site, pb.Site) scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) - tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + tenant = convert_to_protobuf(tenant, pb.Tenant) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VLANGroup( name=name, slug=slug, @@ -7177,13 +6382,13 @@ def __new__( scope_site=scope_site, scope_site_group=scope_site_group, vid_ranges=vid_ranges, - tenant=tenant, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, + tenant=tenant, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -7195,19 +6400,19 @@ def __new__( cls, name: str | None = None, description: str | None = None, + metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - metadata: dict[str, Any] | None = None, ) -> pb.VLANTranslationPolicy: """Create a new VLANTranslationPolicy.""" - owner = convert_to_protobuf(owner, pb.Owner) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VLANTranslationPolicy( name=name, description=description, + metadata=metadata, owner=owner, comments=comments, - metadata=metadata, ) return result @@ -7251,18 +6456,16 @@ def __new__( description: str | None = None, mode: str | None = None, untagged_vlan: str | VLAN | pb.VLAN | None = None, - tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, qinq_svlan: str | VLAN | pb.VLAN | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, vrf: str | VRF | pb.VRF | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VMInterface: """Create a new VMInterface.""" virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) @@ -7270,16 +6473,16 @@ def __new__( bridge = convert_to_protobuf(bridge, pb.VMInterface) primary_mac_address = convert_to_protobuf(primary_mac_address, pb.MACAddress) untagged_vlan = convert_to_protobuf(untagged_vlan, pb.VLAN) - tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) vlan_translation_policy = convert_to_protobuf( vlan_translation_policy, pb.VLANTranslationPolicy ) vrf = convert_to_protobuf(vrf, pb.VRF) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VMInterface( virtual_machine=virtual_machine, name=name, @@ -7291,14 +6494,14 @@ def __new__( description=description, mode=mode, untagged_vlan=untagged_vlan, - tagged_vlans=tagged_vlans, qinq_svlan=qinq_svlan, vlan_translation_policy=vlan_translation_policy, vrf=vrf, - owner=owner, tags=tags, custom_fields=custom_fields, + tagged_vlans=tagged_vlans, metadata=metadata, + owner=owner, ) return result @@ -7313,37 +6516,35 @@ def __new__( tenant: str | Tenant | pb.Tenant | None = None, enforce_unique: bool | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VRF: """Create a new VRF.""" tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) - import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) - export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) + export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VRF( name=name, rd=rd, tenant=tenant, enforce_unique=enforce_unique, description=description, - owner=owner, comments=comments, - import_targets=import_targets, - export_targets=export_targets, tags=tags, custom_fields=custom_fields, + import_targets=import_targets, + export_targets=export_targets, metadata=metadata, + owner=owner, ) return result @@ -7357,30 +6558,28 @@ def __new__( domain: str | None = None, master: str | Device | pb.Device | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VirtualChassis: """Create a new VirtualChassis.""" master = convert_to_protobuf(master, pb.Device) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VirtualChassis( name=name, domain=domain, master=master, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -7397,23 +6596,21 @@ def __new__( status: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VirtualCircuit: """Create a new VirtualCircuit.""" provider_network = convert_to_protobuf(provider_network, pb.ProviderNetwork) provider_account = convert_to_protobuf(provider_account, pb.ProviderAccount) type = convert_to_protobuf(type, pb.VirtualCircuitType) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VirtualCircuit( cid=cid, provider_network=provider_network, @@ -7422,11 +6619,11 @@ def __new__( status=status, tenant=tenant, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -7441,9 +6638,7 @@ def __new__( interface: str | Interface | pb.Interface | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, ) -> pb.VirtualCircuitTermination: """Create a new VirtualCircuitTermination.""" @@ -7473,29 +6668,27 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.VirtualCircuitType: """Create a new VirtualCircuitType.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VirtualCircuitType( name=name, slug=slug, color=color, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -7513,23 +6706,21 @@ def __new__( primary_ip6: str | IPAddress | pb.IPAddress | None = None, status: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VirtualDeviceContext: """Create a new VirtualDeviceContext.""" device = convert_to_protobuf(device, pb.Device) tenant = convert_to_protobuf(tenant, pb.Tenant) primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VirtualDeviceContext( name=name, device=device, @@ -7539,7 +6730,881 @@ def __new__( primary_ip6=primary_ip6, status=status, description=description, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + owner=owner, + ) + return result + + +class VirtualDisk: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDisk.""" + + def __new__( + cls, + virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, + name: str | None = None, + description: str | None = None, + size: int | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.VirtualDisk: + """Create a new VirtualDisk.""" + virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.VirtualDisk( + virtual_machine=virtual_machine, + name=name, + description=description, + size=size, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + owner=owner, + ) + return result + + +class VirtualMachine: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualMachine.""" + + def __new__( + cls, + name: str | None = None, + status: str | None = None, + site: str | Site | pb.Site | None = None, + cluster: str | Cluster | pb.Cluster | None = None, + device: str | Device | pb.Device | None = None, + serial: str | None = None, + role: str | DeviceRole | pb.DeviceRole | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + platform: str | Platform | pb.Platform | None = None, + primary_ip4: str | IPAddress | pb.IPAddress | None = None, + primary_ip6: str | IPAddress | pb.IPAddress | None = None, + vcpus: float | None = None, + memory: int | None = None, + disk: int | None = None, + description: str | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, + start_on_boot: str | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.VirtualMachine: + """Create a new VirtualMachine.""" + site = convert_to_protobuf(site, pb.Site) + cluster = convert_to_protobuf(cluster, pb.Cluster) + device = convert_to_protobuf(device, pb.Device) + role = convert_to_protobuf(role, pb.DeviceRole) + tenant = convert_to_protobuf(tenant, pb.Tenant) + platform = convert_to_protobuf(platform, pb.Platform) + primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) + primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + + # apply shortcuts + if platform is not None: + if device is not None and not device.HasField("platform"): + device.platform.CopyFrom(platform) + if site is not None: + if device is not None and not device.HasField("site"): + device.site.CopyFrom(site) + if cluster is not None and not cluster.HasField("scope_site"): + cluster.scope_site.CopyFrom(site) + if role is not None: + if device is not None and not device.HasField("role"): + device.role.CopyFrom(role) + result = pb.VirtualMachine( + name=name, + status=status, + site=site, + cluster=cluster, + device=device, + serial=serial, + role=role, + tenant=tenant, + platform=platform, + primary_ip4=primary_ip4, + primary_ip6=primary_ip6, + vcpus=vcpus, + memory=memory, + disk=disk, + description=description, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + start_on_boot=start_on_boot, owner=owner, + ) + return result + + +class WirelessLAN: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLAN.""" + + def __new__( + cls, + ssid: str | None = None, + description: str | None = None, + group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, + status: str | None = None, + vlan: str | VLAN | pb.VLAN | None = None, + scope_location: str | Location | pb.Location | None = None, + scope_region: str | Region | pb.Region | None = None, + scope_site: str | Site | pb.Site | None = None, + scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + auth_type: str | None = None, + auth_cipher: str | None = None, + auth_psk: str | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.WirelessLAN: + """Create a new WirelessLAN.""" + group = convert_to_protobuf(group, pb.WirelessLANGroup) + vlan = convert_to_protobuf(vlan, pb.VLAN) + scope_location = convert_to_protobuf(scope_location, pb.Location) + scope_region = convert_to_protobuf(scope_region, pb.Region) + scope_site = convert_to_protobuf(scope_site, pb.Site) + scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) + tenant = convert_to_protobuf(tenant, pb.Tenant) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.WirelessLAN( + ssid=ssid, + description=description, + group=group, + status=status, + vlan=vlan, + scope_location=scope_location, + scope_region=scope_region, + scope_site=scope_site, + scope_site_group=scope_site_group, + tenant=tenant, + auth_type=auth_type, + auth_cipher=auth_cipher, + auth_psk=auth_psk, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + owner=owner, + ) + return result + + +class WirelessLANGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLANGroup.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + parent: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, + description: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + comments: str | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.WirelessLANGroup: + """Create a new WirelessLANGroup.""" + parent = convert_to_protobuf(parent, pb.WirelessLANGroup) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.WirelessLANGroup( + name=name, + slug=slug, + parent=parent, + description=description, + tags=tags, + custom_fields=custom_fields, + comments=comments, + metadata=metadata, + owner=owner, + ) + return result + + +class WirelessLink: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLink.""" + + def __new__( + cls, + interface_a: str | Interface | pb.Interface | None = None, + interface_b: str | Interface | pb.Interface | None = None, + ssid: str | None = None, + status: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + auth_type: str | None = None, + auth_cipher: str | None = None, + auth_psk: str | None = None, + distance: float | None = None, + distance_unit: str | None = None, + description: str | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.WirelessLink: + """Create a new WirelessLink.""" + interface_a = convert_to_protobuf(interface_a, pb.Interface) + interface_b = convert_to_protobuf(interface_b, pb.Interface) + tenant = convert_to_protobuf(tenant, pb.Tenant) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.WirelessLink( + interface_a=interface_a, + interface_b=interface_b, + ssid=ssid, + status=status, + tenant=tenant, + auth_type=auth_type, + auth_cipher=auth_cipher, + auth_psk=auth_psk, + distance=distance, + distance_unit=distance_unit, + description=description, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + owner=owner, + ) + return result + + +class CustomField: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomField.""" + + def __new__( + cls, + type: str | None = None, + related_object_type: str | None = None, + name: str | None = None, + label: str | None = None, + group_name: str | None = None, + description: str | None = None, + required: bool | None = None, + unique: bool | None = None, + search_weight: int | None = None, + filter_logic: str | None = None, + ui_visible: str | None = None, + ui_editable: str | None = None, + is_cloneable: bool | None = None, + default: str | None = None, + related_object_filter: str | None = None, + weight: int | None = None, + validation_minimum: float | None = None, + validation_maximum: float | None = None, + validation_regex: str | None = None, + choice_set: str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None = None, + comments: str | None = None, + object_types: list[str] | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.CustomField: + """Create a new CustomField.""" + choice_set = convert_to_protobuf(choice_set, pb.CustomFieldChoiceSet) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.CustomField( + type=type, + related_object_type=related_object_type, + name=name, + label=label, + group_name=group_name, + description=description, + required=required, + unique=unique, + search_weight=search_weight, + filter_logic=filter_logic, + ui_visible=ui_visible, + ui_editable=ui_editable, + is_cloneable=is_cloneable, + default=default, + related_object_filter=related_object_filter, + weight=weight, + validation_minimum=validation_minimum, + validation_maximum=validation_maximum, + validation_regex=validation_regex, + choice_set=choice_set, + comments=comments, + object_types=object_types, + metadata=metadata, + owner=owner, + ) + return result + + +class CustomFieldChoiceSet: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomFieldChoiceSet.""" + + def __new__( + cls, + name: str | None = None, + description: str | None = None, + base_choices: str | None = None, + order_alphabetically: bool | None = None, + extra_choices: list[str] | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.CustomFieldChoiceSet: + """Create a new CustomFieldChoiceSet.""" + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.CustomFieldChoiceSet( + name=name, + description=description, + base_choices=base_choices, + order_alphabetically=order_alphabetically, + extra_choices=extra_choices, + metadata=metadata, + owner=owner, + ) + return result + + +class JournalEntry: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.JournalEntry.""" + + def __new__( + cls, + assigned_object_asn: str | ASN | pb.ASN | None = None, + assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, + assigned_object_aggregate: Aggregate | pb.Aggregate | None = None, + assigned_object_cable: Cable | pb.Cable | None = None, + assigned_object_cable_path: CablePath | pb.CablePath | None = None, + assigned_object_cable_termination: ( + CableTermination | pb.CableTermination | None + ) = None, + assigned_object_circuit: str | Circuit | pb.Circuit | None = None, + assigned_object_circuit_group: ( + str | CircuitGroup | pb.CircuitGroup | None + ) = None, + assigned_object_circuit_group_assignment: ( + CircuitGroupAssignment | pb.CircuitGroupAssignment | None + ) = None, + assigned_object_circuit_termination: ( + CircuitTermination | pb.CircuitTermination | None + ) = None, + assigned_object_circuit_type: str | CircuitType | pb.CircuitType | None = None, + assigned_object_cluster: str | Cluster | pb.Cluster | None = None, + assigned_object_cluster_group: ( + str | ClusterGroup | pb.ClusterGroup | None + ) = None, + assigned_object_cluster_type: str | ClusterType | pb.ClusterType | None = None, + assigned_object_console_port: str | ConsolePort | pb.ConsolePort | None = None, + assigned_object_console_server_port: ( + str | ConsoleServerPort | pb.ConsoleServerPort | None + ) = None, + assigned_object_contact: str | Contact | pb.Contact | None = None, + assigned_object_contact_assignment: ( + ContactAssignment | pb.ContactAssignment | None + ) = None, + assigned_object_contact_group: ( + str | ContactGroup | pb.ContactGroup | None + ) = None, + assigned_object_contact_role: str | ContactRole | pb.ContactRole | None = None, + assigned_object_custom_field: str | CustomField | pb.CustomField | None = None, + assigned_object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + assigned_object_device: str | Device | pb.Device | None = None, + assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, + assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, + assigned_object_device_type: str | DeviceType | pb.DeviceType | None = None, + assigned_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, + assigned_object_fhrp_group_assignment: ( + FHRPGroupAssignment | pb.FHRPGroupAssignment | None + ) = None, + assigned_object_front_port: str | FrontPort | pb.FrontPort | None = None, + assigned_object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, + assigned_object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, + assigned_object_ip_address: str | IPAddress | pb.IPAddress | None = None, + assigned_object_ip_range: IPRange | pb.IPRange | None = None, + assigned_object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, + assigned_object_ip_sec_profile: ( + str | IPSecProfile | pb.IPSecProfile | None + ) = None, + assigned_object_ip_sec_proposal: ( + str | IPSecProposal | pb.IPSecProposal | None + ) = None, + assigned_object_interface: str | Interface | pb.Interface | None = None, + assigned_object_inventory_item: ( + str | InventoryItem | pb.InventoryItem | None + ) = None, + assigned_object_inventory_item_role: ( + str | InventoryItemRole | pb.InventoryItemRole | None + ) = None, + assigned_object_journal_entry: JournalEntry | pb.JournalEntry | None = None, + assigned_object_l2vpn: str | L2VPN | pb.L2VPN | None = None, + assigned_object_l2vpn_termination: ( + L2VPNTermination | pb.L2VPNTermination | None + ) = None, + assigned_object_location: str | Location | pb.Location | None = None, + assigned_object_mac_address: str | MACAddress | pb.MACAddress | None = None, + assigned_object_manufacturer: ( + str | Manufacturer | pb.Manufacturer | None + ) = None, + assigned_object_module: Module | pb.Module | None = None, + assigned_object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, + assigned_object_module_type: str | ModuleType | pb.ModuleType | None = None, + assigned_object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + assigned_object_platform: str | Platform | pb.Platform | None = None, + assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, + assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, + assigned_object_power_panel: str | PowerPanel | pb.PowerPanel | None = None, + assigned_object_power_port: str | PowerPort | pb.PowerPort | None = None, + assigned_object_prefix: str | Prefix | pb.Prefix | None = None, + assigned_object_provider: str | Provider | pb.Provider | None = None, + assigned_object_provider_account: ( + str | ProviderAccount | pb.ProviderAccount | None + ) = None, + assigned_object_provider_network: ( + str | ProviderNetwork | pb.ProviderNetwork | None + ) = None, + assigned_object_rir: str | RIR | pb.RIR | None = None, + assigned_object_rack: str | Rack | pb.Rack | None = None, + assigned_object_rack_reservation: ( + RackReservation | pb.RackReservation | None + ) = None, + assigned_object_rack_role: str | RackRole | pb.RackRole | None = None, + assigned_object_rack_type: str | RackType | pb.RackType | None = None, + assigned_object_rear_port: str | RearPort | pb.RearPort | None = None, + assigned_object_region: str | Region | pb.Region | None = None, + assigned_object_role: str | Role | pb.Role | None = None, + assigned_object_route_target: str | RouteTarget | pb.RouteTarget | None = None, + assigned_object_service: str | Service | pb.Service | None = None, + assigned_object_site: str | Site | pb.Site | None = None, + assigned_object_site_group: str | SiteGroup | pb.SiteGroup | None = None, + assigned_object_tag: str | Tag | pb.Tag | None = None, + assigned_object_tenant: str | Tenant | pb.Tenant | None = None, + assigned_object_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, + assigned_object_tunnel: str | Tunnel | pb.Tunnel | None = None, + assigned_object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, + assigned_object_tunnel_termination: ( + TunnelTermination | pb.TunnelTermination | None + ) = None, + assigned_object_vlan: str | VLAN | pb.VLAN | None = None, + assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, + assigned_object_vlan_translation_policy: ( + str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None + ) = None, + assigned_object_vlan_translation_rule: ( + VLANTranslationRule | pb.VLANTranslationRule | None + ) = None, + assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, + assigned_object_vrf: str | VRF | pb.VRF | None = None, + assigned_object_virtual_chassis: ( + str | VirtualChassis | pb.VirtualChassis | None + ) = None, + assigned_object_virtual_circuit: ( + str | VirtualCircuit | pb.VirtualCircuit | None + ) = None, + assigned_object_virtual_circuit_termination: ( + VirtualCircuitTermination | pb.VirtualCircuitTermination | None + ) = None, + assigned_object_virtual_circuit_type: ( + str | VirtualCircuitType | pb.VirtualCircuitType | None + ) = None, + assigned_object_virtual_device_context: ( + str | VirtualDeviceContext | pb.VirtualDeviceContext | None + ) = None, + assigned_object_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, + assigned_object_virtual_machine: ( + str | VirtualMachine | pb.VirtualMachine | None + ) = None, + assigned_object_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, + assigned_object_wireless_lan_group: ( + str | WirelessLANGroup | pb.WirelessLANGroup | None + ) = None, + assigned_object_wireless_link: WirelessLink | pb.WirelessLink | None = None, + assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, + assigned_object_owner: str | Owner | pb.Owner | None = None, + assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + kind: str | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.JournalEntry: + """Create a new JournalEntry.""" + assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) + assigned_object_asn_range = convert_to_protobuf( + assigned_object_asn_range, pb.ASNRange + ) + assigned_object_aggregate = convert_to_protobuf( + assigned_object_aggregate, pb.Aggregate + ) + assigned_object_cable = convert_to_protobuf(assigned_object_cable, pb.Cable) + assigned_object_cable_path = convert_to_protobuf( + assigned_object_cable_path, pb.CablePath + ) + assigned_object_cable_termination = convert_to_protobuf( + assigned_object_cable_termination, pb.CableTermination + ) + assigned_object_circuit = convert_to_protobuf( + assigned_object_circuit, pb.Circuit + ) + assigned_object_circuit_group = convert_to_protobuf( + assigned_object_circuit_group, pb.CircuitGroup + ) + assigned_object_circuit_group_assignment = convert_to_protobuf( + assigned_object_circuit_group_assignment, pb.CircuitGroupAssignment + ) + assigned_object_circuit_termination = convert_to_protobuf( + assigned_object_circuit_termination, pb.CircuitTermination + ) + assigned_object_circuit_type = convert_to_protobuf( + assigned_object_circuit_type, pb.CircuitType + ) + assigned_object_cluster = convert_to_protobuf( + assigned_object_cluster, pb.Cluster + ) + assigned_object_cluster_group = convert_to_protobuf( + assigned_object_cluster_group, pb.ClusterGroup + ) + assigned_object_cluster_type = convert_to_protobuf( + assigned_object_cluster_type, pb.ClusterType + ) + assigned_object_console_port = convert_to_protobuf( + assigned_object_console_port, pb.ConsolePort + ) + assigned_object_console_server_port = convert_to_protobuf( + assigned_object_console_server_port, pb.ConsoleServerPort + ) + assigned_object_contact = convert_to_protobuf( + assigned_object_contact, pb.Contact + ) + assigned_object_contact_assignment = convert_to_protobuf( + assigned_object_contact_assignment, pb.ContactAssignment + ) + assigned_object_contact_group = convert_to_protobuf( + assigned_object_contact_group, pb.ContactGroup + ) + assigned_object_contact_role = convert_to_protobuf( + assigned_object_contact_role, pb.ContactRole + ) + assigned_object_custom_field = convert_to_protobuf( + assigned_object_custom_field, pb.CustomField + ) + assigned_object_custom_field_choice_set = convert_to_protobuf( + assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) + assigned_object_device_bay = convert_to_protobuf( + assigned_object_device_bay, pb.DeviceBay + ) + assigned_object_device_role = convert_to_protobuf( + assigned_object_device_role, pb.DeviceRole + ) + assigned_object_device_type = convert_to_protobuf( + assigned_object_device_type, pb.DeviceType + ) + assigned_object_fhrp_group = convert_to_protobuf( + assigned_object_fhrp_group, pb.FHRPGroup + ) + assigned_object_fhrp_group_assignment = convert_to_protobuf( + assigned_object_fhrp_group_assignment, pb.FHRPGroupAssignment + ) + assigned_object_front_port = convert_to_protobuf( + assigned_object_front_port, pb.FrontPort + ) + assigned_object_ike_policy = convert_to_protobuf( + assigned_object_ike_policy, pb.IKEPolicy + ) + assigned_object_ike_proposal = convert_to_protobuf( + assigned_object_ike_proposal, pb.IKEProposal + ) + assigned_object_ip_address = convert_to_protobuf( + assigned_object_ip_address, pb.IPAddress + ) + assigned_object_ip_range = convert_to_protobuf( + assigned_object_ip_range, pb.IPRange + ) + assigned_object_ip_sec_policy = convert_to_protobuf( + assigned_object_ip_sec_policy, pb.IPSecPolicy + ) + assigned_object_ip_sec_profile = convert_to_protobuf( + assigned_object_ip_sec_profile, pb.IPSecProfile + ) + assigned_object_ip_sec_proposal = convert_to_protobuf( + assigned_object_ip_sec_proposal, pb.IPSecProposal + ) + assigned_object_interface = convert_to_protobuf( + assigned_object_interface, pb.Interface + ) + assigned_object_inventory_item = convert_to_protobuf( + assigned_object_inventory_item, pb.InventoryItem + ) + assigned_object_inventory_item_role = convert_to_protobuf( + assigned_object_inventory_item_role, pb.InventoryItemRole + ) + assigned_object_journal_entry = convert_to_protobuf( + assigned_object_journal_entry, pb.JournalEntry + ) + assigned_object_l2vpn = convert_to_protobuf(assigned_object_l2vpn, pb.L2VPN) + assigned_object_l2vpn_termination = convert_to_protobuf( + assigned_object_l2vpn_termination, pb.L2VPNTermination + ) + assigned_object_location = convert_to_protobuf( + assigned_object_location, pb.Location + ) + assigned_object_mac_address = convert_to_protobuf( + assigned_object_mac_address, pb.MACAddress + ) + assigned_object_manufacturer = convert_to_protobuf( + assigned_object_manufacturer, pb.Manufacturer + ) + assigned_object_module = convert_to_protobuf(assigned_object_module, pb.Module) + assigned_object_module_bay = convert_to_protobuf( + assigned_object_module_bay, pb.ModuleBay + ) + assigned_object_module_type = convert_to_protobuf( + assigned_object_module_type, pb.ModuleType + ) + assigned_object_module_type_profile = convert_to_protobuf( + assigned_object_module_type_profile, pb.ModuleTypeProfile + ) + assigned_object_platform = convert_to_protobuf( + assigned_object_platform, pb.Platform + ) + assigned_object_power_feed = convert_to_protobuf( + assigned_object_power_feed, pb.PowerFeed + ) + assigned_object_power_outlet = convert_to_protobuf( + assigned_object_power_outlet, pb.PowerOutlet + ) + assigned_object_power_panel = convert_to_protobuf( + assigned_object_power_panel, pb.PowerPanel + ) + assigned_object_power_port = convert_to_protobuf( + assigned_object_power_port, pb.PowerPort + ) + assigned_object_prefix = convert_to_protobuf(assigned_object_prefix, pb.Prefix) + assigned_object_provider = convert_to_protobuf( + assigned_object_provider, pb.Provider + ) + assigned_object_provider_account = convert_to_protobuf( + assigned_object_provider_account, pb.ProviderAccount + ) + assigned_object_provider_network = convert_to_protobuf( + assigned_object_provider_network, pb.ProviderNetwork + ) + assigned_object_rir = convert_to_protobuf(assigned_object_rir, pb.RIR) + assigned_object_rack = convert_to_protobuf(assigned_object_rack, pb.Rack) + assigned_object_rack_reservation = convert_to_protobuf( + assigned_object_rack_reservation, pb.RackReservation + ) + assigned_object_rack_role = convert_to_protobuf( + assigned_object_rack_role, pb.RackRole + ) + assigned_object_rack_type = convert_to_protobuf( + assigned_object_rack_type, pb.RackType + ) + assigned_object_rear_port = convert_to_protobuf( + assigned_object_rear_port, pb.RearPort + ) + assigned_object_region = convert_to_protobuf(assigned_object_region, pb.Region) + assigned_object_role = convert_to_protobuf(assigned_object_role, pb.Role) + assigned_object_route_target = convert_to_protobuf( + assigned_object_route_target, pb.RouteTarget + ) + assigned_object_service = convert_to_protobuf( + assigned_object_service, pb.Service + ) + assigned_object_site = convert_to_protobuf(assigned_object_site, pb.Site) + assigned_object_site_group = convert_to_protobuf( + assigned_object_site_group, pb.SiteGroup + ) + assigned_object_tag = convert_to_protobuf(assigned_object_tag, pb.Tag) + assigned_object_tenant = convert_to_protobuf(assigned_object_tenant, pb.Tenant) + assigned_object_tenant_group = convert_to_protobuf( + assigned_object_tenant_group, pb.TenantGroup + ) + assigned_object_tunnel = convert_to_protobuf(assigned_object_tunnel, pb.Tunnel) + assigned_object_tunnel_group = convert_to_protobuf( + assigned_object_tunnel_group, pb.TunnelGroup + ) + assigned_object_tunnel_termination = convert_to_protobuf( + assigned_object_tunnel_termination, pb.TunnelTermination + ) + assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) + assigned_object_vlan_group = convert_to_protobuf( + assigned_object_vlan_group, pb.VLANGroup + ) + assigned_object_vlan_translation_policy = convert_to_protobuf( + assigned_object_vlan_translation_policy, pb.VLANTranslationPolicy + ) + assigned_object_vlan_translation_rule = convert_to_protobuf( + assigned_object_vlan_translation_rule, pb.VLANTranslationRule + ) + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface + ) + assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) + assigned_object_virtual_chassis = convert_to_protobuf( + assigned_object_virtual_chassis, pb.VirtualChassis + ) + assigned_object_virtual_circuit = convert_to_protobuf( + assigned_object_virtual_circuit, pb.VirtualCircuit + ) + assigned_object_virtual_circuit_termination = convert_to_protobuf( + assigned_object_virtual_circuit_termination, pb.VirtualCircuitTermination + ) + assigned_object_virtual_circuit_type = convert_to_protobuf( + assigned_object_virtual_circuit_type, pb.VirtualCircuitType + ) + assigned_object_virtual_device_context = convert_to_protobuf( + assigned_object_virtual_device_context, pb.VirtualDeviceContext + ) + assigned_object_virtual_disk = convert_to_protobuf( + assigned_object_virtual_disk, pb.VirtualDisk + ) + assigned_object_virtual_machine = convert_to_protobuf( + assigned_object_virtual_machine, pb.VirtualMachine + ) + assigned_object_wireless_lan = convert_to_protobuf( + assigned_object_wireless_lan, pb.WirelessLAN + ) + assigned_object_wireless_lan_group = convert_to_protobuf( + assigned_object_wireless_lan_group, pb.WirelessLANGroup + ) + assigned_object_wireless_link = convert_to_protobuf( + assigned_object_wireless_link, pb.WirelessLink + ) + assigned_object_custom_link = convert_to_protobuf( + assigned_object_custom_link, pb.CustomLink + ) + assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) + assigned_object_owner_group = convert_to_protobuf( + assigned_object_owner_group, pb.OwnerGroup + ) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.JournalEntry( + assigned_object_asn=assigned_object_asn, + assigned_object_asn_range=assigned_object_asn_range, + assigned_object_aggregate=assigned_object_aggregate, + assigned_object_cable=assigned_object_cable, + assigned_object_cable_path=assigned_object_cable_path, + assigned_object_cable_termination=assigned_object_cable_termination, + assigned_object_circuit=assigned_object_circuit, + assigned_object_circuit_group=assigned_object_circuit_group, + assigned_object_circuit_group_assignment=assigned_object_circuit_group_assignment, + assigned_object_circuit_termination=assigned_object_circuit_termination, + assigned_object_circuit_type=assigned_object_circuit_type, + assigned_object_cluster=assigned_object_cluster, + assigned_object_cluster_group=assigned_object_cluster_group, + assigned_object_cluster_type=assigned_object_cluster_type, + assigned_object_console_port=assigned_object_console_port, + assigned_object_console_server_port=assigned_object_console_server_port, + assigned_object_contact=assigned_object_contact, + assigned_object_contact_assignment=assigned_object_contact_assignment, + assigned_object_contact_group=assigned_object_contact_group, + assigned_object_contact_role=assigned_object_contact_role, + assigned_object_custom_field=assigned_object_custom_field, + assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, + assigned_object_device=assigned_object_device, + assigned_object_device_bay=assigned_object_device_bay, + assigned_object_device_role=assigned_object_device_role, + assigned_object_device_type=assigned_object_device_type, + assigned_object_fhrp_group=assigned_object_fhrp_group, + assigned_object_fhrp_group_assignment=assigned_object_fhrp_group_assignment, + assigned_object_front_port=assigned_object_front_port, + assigned_object_ike_policy=assigned_object_ike_policy, + assigned_object_ike_proposal=assigned_object_ike_proposal, + assigned_object_ip_address=assigned_object_ip_address, + assigned_object_ip_range=assigned_object_ip_range, + assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, + assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, + assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, + assigned_object_interface=assigned_object_interface, + assigned_object_inventory_item=assigned_object_inventory_item, + assigned_object_inventory_item_role=assigned_object_inventory_item_role, + assigned_object_journal_entry=assigned_object_journal_entry, + assigned_object_l2vpn=assigned_object_l2vpn, + assigned_object_l2vpn_termination=assigned_object_l2vpn_termination, + assigned_object_location=assigned_object_location, + assigned_object_mac_address=assigned_object_mac_address, + assigned_object_manufacturer=assigned_object_manufacturer, + assigned_object_module=assigned_object_module, + assigned_object_module_bay=assigned_object_module_bay, + assigned_object_module_type=assigned_object_module_type, + assigned_object_module_type_profile=assigned_object_module_type_profile, + assigned_object_platform=assigned_object_platform, + assigned_object_power_feed=assigned_object_power_feed, + assigned_object_power_outlet=assigned_object_power_outlet, + assigned_object_power_panel=assigned_object_power_panel, + assigned_object_power_port=assigned_object_power_port, + assigned_object_prefix=assigned_object_prefix, + assigned_object_provider=assigned_object_provider, + assigned_object_provider_account=assigned_object_provider_account, + assigned_object_provider_network=assigned_object_provider_network, + assigned_object_rir=assigned_object_rir, + assigned_object_rack=assigned_object_rack, + assigned_object_rack_reservation=assigned_object_rack_reservation, + assigned_object_rack_role=assigned_object_rack_role, + assigned_object_rack_type=assigned_object_rack_type, + assigned_object_rear_port=assigned_object_rear_port, + assigned_object_region=assigned_object_region, + assigned_object_role=assigned_object_role, + assigned_object_route_target=assigned_object_route_target, + assigned_object_service=assigned_object_service, + assigned_object_site=assigned_object_site, + assigned_object_site_group=assigned_object_site_group, + assigned_object_tag=assigned_object_tag, + assigned_object_tenant=assigned_object_tenant, + assigned_object_tenant_group=assigned_object_tenant_group, + assigned_object_tunnel=assigned_object_tunnel, + assigned_object_tunnel_group=assigned_object_tunnel_group, + assigned_object_tunnel_termination=assigned_object_tunnel_termination, + assigned_object_vlan=assigned_object_vlan, + assigned_object_vlan_group=assigned_object_vlan_group, + assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, + assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, + assigned_object_vm_interface=assigned_object_vm_interface, + assigned_object_vrf=assigned_object_vrf, + assigned_object_virtual_chassis=assigned_object_virtual_chassis, + assigned_object_virtual_circuit=assigned_object_virtual_circuit, + assigned_object_virtual_circuit_termination=assigned_object_virtual_circuit_termination, + assigned_object_virtual_circuit_type=assigned_object_virtual_circuit_type, + assigned_object_virtual_device_context=assigned_object_virtual_device_context, + assigned_object_virtual_disk=assigned_object_virtual_disk, + assigned_object_virtual_machine=assigned_object_virtual_machine, + assigned_object_wireless_lan=assigned_object_wireless_lan, + assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, + assigned_object_wireless_link=assigned_object_wireless_link, + assigned_object_custom_link=assigned_object_custom_link, + assigned_object_owner=assigned_object_owner, + assigned_object_owner_group=assigned_object_owner_group, + kind=kind, comments=comments, tags=tags, custom_fields=custom_fields, @@ -7548,268 +7613,131 @@ def __new__( return result -class VirtualDisk: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDisk.""" +class ModuleTypeProfile: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleTypeProfile.""" def __new__( cls, - virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, name: str | None = None, description: str | None = None, - size: int | None = None, - owner: str | Owner | pb.Owner | None = None, + schema: str | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.VirtualDisk: - """Create a new VirtualDisk.""" - virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) - owner = convert_to_protobuf(owner, pb.Owner) + owner: str | Owner | pb.Owner | None = None, + ) -> pb.ModuleTypeProfile: + """Create a new ModuleTypeProfile.""" tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.VirtualDisk( - virtual_machine=virtual_machine, + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.ModuleTypeProfile( name=name, description=description, - size=size, - owner=owner, + schema=schema, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result -class VirtualMachine: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualMachine.""" +class CustomLink: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomLink.""" def __new__( cls, name: str | None = None, - status: str | None = None, - start_on_boot: str | None = None, - site: str | Site | pb.Site | None = None, - cluster: str | Cluster | pb.Cluster | None = None, - device: str | Device | pb.Device | None = None, - serial: str | None = None, - role: str | DeviceRole | pb.DeviceRole | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - platform: str | Platform | pb.Platform | None = None, - primary_ip4: str | IPAddress | pb.IPAddress | None = None, - primary_ip6: str | IPAddress | pb.IPAddress | None = None, - vcpus: float | None = None, - memory: int | None = None, - disk: int | None = None, - description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + enabled: bool | None = None, + link_text: str | None = None, + link_url: str | None = None, + weight: int | None = None, + group_name: str | None = None, + button_class: str | None = None, + new_window: bool | None = None, + object_types: list[str] | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.VirtualMachine: - """Create a new VirtualMachine.""" - site = convert_to_protobuf(site, pb.Site) - cluster = convert_to_protobuf(cluster, pb.Cluster) - device = convert_to_protobuf(device, pb.Device) - role = convert_to_protobuf(role, pb.DeviceRole) - tenant = convert_to_protobuf(tenant, pb.Tenant) - platform = convert_to_protobuf(platform, pb.Platform) - primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) - primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + owner: str | Owner | pb.Owner | None = None, + ) -> pb.CustomLink: + """Create a new CustomLink.""" metadata = convert_dict_to_struct(metadata) - - # apply shortcuts - if platform is not None: - if device is not None and not device.HasField("platform"): - device.platform.CopyFrom(platform) - if site is not None: - if device is not None and not device.HasField("site"): - device.site.CopyFrom(site) - if cluster is not None and not cluster.HasField("scope_site"): - cluster.scope_site.CopyFrom(site) - if role is not None: - if device is not None and not device.HasField("role"): - device.role.CopyFrom(role) - result = pb.VirtualMachine( + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.CustomLink( name=name, - status=status, - start_on_boot=start_on_boot, - site=site, - cluster=cluster, - device=device, - serial=serial, - role=role, - tenant=tenant, - platform=platform, - primary_ip4=primary_ip4, - primary_ip6=primary_ip6, - vcpus=vcpus, - memory=memory, - disk=disk, - description=description, - owner=owner, - comments=comments, - tags=tags, - custom_fields=custom_fields, + enabled=enabled, + link_text=link_text, + link_url=link_url, + weight=weight, + group_name=group_name, + button_class=button_class, + new_window=new_window, + object_types=object_types, metadata=metadata, + owner=owner, ) return result -class WirelessLAN: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLAN.""" +class Owner: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Owner.""" def __new__( cls, - ssid: str | None = None, + name: str | None = None, + group: str | OwnerGroup | pb.OwnerGroup | None = None, description: str | None = None, - group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, - status: str | None = None, - vlan: str | VLAN | pb.VLAN | None = None, - scope_location: str | Location | pb.Location | None = None, - scope_region: str | Region | pb.Region | None = None, - scope_site: str | Site | pb.Site | None = None, - scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - auth_type: str | None = None, - auth_cipher: str | None = None, - auth_psk: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.WirelessLAN: - """Create a new WirelessLAN.""" - group = convert_to_protobuf(group, pb.WirelessLANGroup) - vlan = convert_to_protobuf(vlan, pb.VLAN) - scope_location = convert_to_protobuf(scope_location, pb.Location) - scope_region = convert_to_protobuf(scope_region, pb.Region) - scope_site = convert_to_protobuf(scope_site, pb.Site) - scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) - tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + ) -> pb.Owner: + """Create a new Owner.""" + group = convert_to_protobuf(group, pb.OwnerGroup) metadata = convert_dict_to_struct(metadata) - result = pb.WirelessLAN( - ssid=ssid, - description=description, + result = pb.Owner( + name=name, group=group, - status=status, - vlan=vlan, - scope_location=scope_location, - scope_region=scope_region, - scope_site=scope_site, - scope_site_group=scope_site_group, - tenant=tenant, - auth_type=auth_type, - auth_cipher=auth_cipher, - auth_psk=auth_psk, - owner=owner, - comments=comments, - tags=tags, - custom_fields=custom_fields, + description=description, metadata=metadata, ) return result -class WirelessLANGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLANGroup.""" +class OwnerGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.OwnerGroup.""" def __new__( cls, name: str | None = None, - slug: str | None = None, - parent: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.WirelessLANGroup: - """Create a new WirelessLANGroup.""" - parent = convert_to_protobuf(parent, pb.WirelessLANGroup) - tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + ) -> pb.OwnerGroup: + """Create a new OwnerGroup.""" metadata = convert_dict_to_struct(metadata) - result = pb.WirelessLANGroup( + result = pb.OwnerGroup( name=name, - slug=slug, - parent=parent, description=description, - tags=tags, - owner=owner, - comments=comments, - custom_fields=custom_fields, metadata=metadata, ) return result -class WirelessLink: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLink.""" +class DeviceConfig: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.DeviceConfig.""" def __new__( cls, - interface_a: str | Interface | pb.Interface | None = None, - interface_b: str | Interface | pb.Interface | None = None, - ssid: str | None = None, - status: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - auth_type: str | None = None, - auth_cipher: str | None = None, - auth_psk: str | None = None, - distance: float | None = None, - distance_unit: str | None = None, - description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + startup: bytes | None = None, + running: bytes | None = None, + candidate: bytes | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.WirelessLink: - """Create a new WirelessLink.""" - interface_a = convert_to_protobuf(interface_a, pb.Interface) - interface_b = convert_to_protobuf(interface_b, pb.Interface) - tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + ) -> pb.DeviceConfig: + """Create a new DeviceConfig.""" metadata = convert_dict_to_struct(metadata) - result = pb.WirelessLink( - interface_a=interface_a, - interface_b=interface_b, - ssid=ssid, - status=status, - tenant=tenant, - auth_type=auth_type, - auth_cipher=auth_cipher, - auth_psk=auth_psk, - distance=distance, - distance_unit=distance_unit, - description=description, - owner=owner, - comments=comments, - tags=tags, - custom_fields=custom_fields, + result = pb.DeviceConfig( + startup=startup, + running=running, + candidate=candidate, metadata=metadata, ) return result From 8c607ab5deb49e19cd48d4ea8238f78f30b1b495 Mon Sep 17 00:00:00 2001 From: Paul Stuart Date: Mon, 9 Feb 2026 19:37:44 -0800 Subject: [PATCH 4/8] diode.proto rev'd --- docs/README.md | 2 +- netboxlabs/diode/sdk/ingester.py | 6632 +++++++++++++++--------------- 2 files changed, 3353 insertions(+), 3281 deletions(-) diff --git a/docs/README.md b/docs/README.md index fdb925d..433e409 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,7 +1,7 @@ # Diode Python SDK - Entity Examples Source: NetBox v4.5.0 -Generated: 2026-02-05 00:39:21Z +Generated: 2026-02-10 03:24:52Z ## Prerequisites diff --git a/netboxlabs/diode/sdk/ingester.py b/netboxlabs/diode/sdk/ingester.py index 2ff6094..638c240 100644 --- a/netboxlabs/diode/sdk/ingester.py +++ b/netboxlabs/diode/sdk/ingester.py @@ -2,7 +2,8 @@ # # Generated code. DO NOT EDIT. -# Timestamp: 2026-02-02 16:58:59Z +# Source: NetBox v4.5.0 +# Timestamp: 2026-02-10 03:24:51Z # # ruff: noqa: C901 @@ -31,6 +32,9 @@ "Contact": "name", "ContactGroup": "name", "ContactRole": "name", + "CustomField": "name", + "CustomFieldChoiceSet": "name", + "CustomLink": "name", "Device": "name", "DeviceBay": "name", "DeviceRole": "name", @@ -52,6 +56,9 @@ "Manufacturer": "name", "ModuleBay": "name", "ModuleType": "model", + "ModuleTypeProfile": "name", + "Owner": "name", + "OwnerGroup": "name", "Platform": "name", "PowerFeed": "name", "PowerOutlet": "name", @@ -90,12 +97,6 @@ "VirtualMachine": "name", "WirelessLAN": "ssid", "WirelessLANGroup": "name", - "CustomField": "name", - "CustomFieldChoiceSet": "name", - "ModuleTypeProfile": "name", - "CustomLink": "name", - "Owner": "name", - "OwnerGroup": "name", } @@ -162,16 +163,17 @@ def __new__( timestamp: datetime.datetime | None = None, asn: str | ASN | pb.ASN | None = None, asn_range: str | ASNRange | pb.ASNRange | None = None, - aggregate: Aggregate | pb.Aggregate | None = None, - cable: Cable | pb.Cable | None = None, - cable_path: CablePath | pb.CablePath | None = None, - cable_termination: CableTermination | pb.CableTermination | None = None, + aggregate: str | Aggregate | pb.Aggregate | None = None, + cable: str | Cable | pb.Cable | None = None, + cable_path: str | CablePath | pb.CablePath | None = None, circuit: str | Circuit | pb.Circuit | None = None, circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, circuit_group_assignment: ( - CircuitGroupAssignment | pb.CircuitGroupAssignment | None + str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + ) = None, + circuit_termination: ( + str | CircuitTermination | pb.CircuitTermination | None ) = None, - circuit_termination: CircuitTermination | pb.CircuitTermination | None = None, circuit_type: str | CircuitType | pb.CircuitType | None = None, cluster: str | Cluster | pb.Cluster | None = None, cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, @@ -181,22 +183,29 @@ def __new__( str | ConsoleServerPort | pb.ConsoleServerPort | None ) = None, contact: str | Contact | pb.Contact | None = None, - contact_assignment: ContactAssignment | pb.ContactAssignment | None = None, + contact_assignment: ( + str | ContactAssignment | pb.ContactAssignment | None + ) = None, contact_group: str | ContactGroup | pb.ContactGroup | None = None, contact_role: str | ContactRole | pb.ContactRole | None = None, + custom_field: str | CustomField | pb.CustomField | None = None, + custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + custom_link: str | CustomLink | pb.CustomLink | None = None, device: str | Device | pb.Device | None = None, device_bay: str | DeviceBay | pb.DeviceBay | None = None, device_role: str | DeviceRole | pb.DeviceRole | None = None, device_type: str | DeviceType | pb.DeviceType | None = None, fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, fhrp_group_assignment: ( - FHRPGroupAssignment | pb.FHRPGroupAssignment | None + str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, front_port: str | FrontPort | pb.FrontPort | None = None, ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, ip_address: str | IPAddress | pb.IPAddress | None = None, - ip_range: IPRange | pb.IPRange | None = None, + ip_range: str | IPRange | pb.IPRange | None = None, ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -205,14 +214,20 @@ def __new__( inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, + journal_entry: str | JournalEntry | pb.JournalEntry | None = None, l2vpn: str | L2VPN | pb.L2VPN | None = None, - l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, + l2vpn_termination: str | L2VPNTermination | pb.L2VPNTermination | None = None, location: str | Location | pb.Location | None = None, mac_address: str | MACAddress | pb.MACAddress | None = None, manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - module: Module | pb.Module | None = None, + module: str | Module | pb.Module | None = None, module_bay: str | ModuleBay | pb.ModuleBay | None = None, module_type: str | ModuleType | pb.ModuleType | None = None, + module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + owner: str | Owner | pb.Owner | None = None, + owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, platform: str | Platform | pb.Platform | None = None, power_feed: str | PowerFeed | pb.PowerFeed | None = None, power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -224,7 +239,7 @@ def __new__( provider_network: str | ProviderNetwork | pb.ProviderNetwork | None = None, rir: str | RIR | pb.RIR | None = None, rack: str | Rack | pb.Rack | None = None, - rack_reservation: RackReservation | pb.RackReservation | None = None, + rack_reservation: str | RackReservation | pb.RackReservation | None = None, rack_role: str | RackRole | pb.RackRole | None = None, rack_type: str | RackType | pb.RackType | None = None, rear_port: str | RearPort | pb.RearPort | None = None, @@ -239,21 +254,23 @@ def __new__( tenant_group: str | TenantGroup | pb.TenantGroup | None = None, tunnel: str | Tunnel | pb.Tunnel | None = None, tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - tunnel_termination: TunnelTermination | pb.TunnelTermination | None = None, + tunnel_termination: ( + str | TunnelTermination | pb.TunnelTermination | None + ) = None, vlan: str | VLAN | pb.VLAN | None = None, vlan_group: str | VLANGroup | pb.VLANGroup | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, vlan_translation_rule: ( - VLANTranslationRule | pb.VLANTranslationRule | None + str | VLANTranslationRule | pb.VLANTranslationRule | None ) = None, vm_interface: str | VMInterface | pb.VMInterface | None = None, vrf: str | VRF | pb.VRF | None = None, virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, virtual_circuit_termination: ( - VirtualCircuitTermination | pb.VirtualCircuitTermination | None + str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -265,19 +282,7 @@ def __new__( virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, wireless_lan_group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, - wireless_link: WirelessLink | pb.WirelessLink | None = None, - custom_field: str | CustomField | pb.CustomField | None = None, - custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - journal_entry: JournalEntry | pb.JournalEntry | None = None, - module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - custom_link: str | CustomLink | pb.CustomLink | None = None, - owner: str | Owner | pb.Owner | None = None, - owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, - device_config: DeviceConfig | pb.DeviceConfig | None = None, + wireless_link: str | WirelessLink | pb.WirelessLink | None = None, ) -> pb.Entity: """Create a new Entity.""" asn = convert_to_protobuf(asn, pb.ASN) @@ -285,7 +290,6 @@ def __new__( aggregate = convert_to_protobuf(aggregate, pb.Aggregate) cable = convert_to_protobuf(cable, pb.Cable) cable_path = convert_to_protobuf(cable_path, pb.CablePath) - cable_termination = convert_to_protobuf(cable_termination, pb.CableTermination) circuit = convert_to_protobuf(circuit, pb.Circuit) circuit_group = convert_to_protobuf(circuit_group, pb.CircuitGroup) circuit_group_assignment = convert_to_protobuf( @@ -308,6 +312,11 @@ def __new__( ) contact_group = convert_to_protobuf(contact_group, pb.ContactGroup) contact_role = convert_to_protobuf(contact_role, pb.ContactRole) + custom_field = convert_to_protobuf(custom_field, pb.CustomField) + custom_field_choice_set = convert_to_protobuf( + custom_field_choice_set, pb.CustomFieldChoiceSet + ) + custom_link = convert_to_protobuf(custom_link, pb.CustomLink) device = convert_to_protobuf(device, pb.Device) device_bay = convert_to_protobuf(device_bay, pb.DeviceBay) device_role = convert_to_protobuf(device_role, pb.DeviceRole) @@ -329,6 +338,7 @@ def __new__( inventory_item_role = convert_to_protobuf( inventory_item_role, pb.InventoryItemRole ) + journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) l2vpn_termination = convert_to_protobuf(l2vpn_termination, pb.L2VPNTermination) location = convert_to_protobuf(location, pb.Location) @@ -337,6 +347,11 @@ def __new__( module = convert_to_protobuf(module, pb.Module) module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) module_type = convert_to_protobuf(module_type, pb.ModuleType) + module_type_profile = convert_to_protobuf( + module_type_profile, pb.ModuleTypeProfile + ) + owner = convert_to_protobuf(owner, pb.Owner) + owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) platform = convert_to_protobuf(platform, pb.Platform) power_feed = convert_to_protobuf(power_feed, pb.PowerFeed) power_outlet = convert_to_protobuf(power_outlet, pb.PowerOutlet) @@ -394,18 +409,6 @@ def __new__( wireless_lan_group, pb.WirelessLANGroup ) wireless_link = convert_to_protobuf(wireless_link, pb.WirelessLink) - custom_field = convert_to_protobuf(custom_field, pb.CustomField) - custom_field_choice_set = convert_to_protobuf( - custom_field_choice_set, pb.CustomFieldChoiceSet - ) - journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) - module_type_profile = convert_to_protobuf( - module_type_profile, pb.ModuleTypeProfile - ) - custom_link = convert_to_protobuf(custom_link, pb.CustomLink) - owner = convert_to_protobuf(owner, pb.Owner) - owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) - device_config = convert_to_protobuf(device_config, pb.DeviceConfig) if timestamp is None: ts = _timestamp_pb2.Timestamp() ts.GetCurrentTime() @@ -417,7 +420,6 @@ def __new__( aggregate=aggregate, cable=cable, cable_path=cable_path, - cable_termination=cable_termination, circuit=circuit, circuit_group=circuit_group, circuit_group_assignment=circuit_group_assignment, @@ -432,6 +434,9 @@ def __new__( contact_assignment=contact_assignment, contact_group=contact_group, contact_role=contact_role, + custom_field=custom_field, + custom_field_choice_set=custom_field_choice_set, + custom_link=custom_link, device=device, device_bay=device_bay, device_role=device_role, @@ -449,6 +454,7 @@ def __new__( interface=interface, inventory_item=inventory_item, inventory_item_role=inventory_item_role, + journal_entry=journal_entry, l2vpn=l2vpn, l2vpn_termination=l2vpn_termination, location=location, @@ -457,6 +463,9 @@ def __new__( module=module, module_bay=module_bay, module_type=module_type, + module_type_profile=module_type_profile, + owner=owner, + owner_group=owner_group, platform=platform, power_feed=power_feed, power_outlet=power_outlet, @@ -500,14 +509,6 @@ def __new__( wireless_lan=wireless_lan, wireless_lan_group=wireless_lan_group, wireless_link=wireless_link, - custom_field=custom_field, - custom_field_choice_set=custom_field_choice_set, - journal_entry=journal_entry, - module_type_profile=module_type_profile, - custom_link=custom_link, - owner=owner, - owner_group=owner_group, - device_config=device_config, ) return result @@ -521,32 +522,34 @@ def __new__( rir: str | RIR | pb.RIR | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, sites: list[str | Site | pb.Site] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, ) -> pb.ASN: """Create a new ASN.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) + sites = convert_to_protobuf_list(sites, pb.Site) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - sites = convert_to_protobuf_list(sites, pb.Site) result = pb.ASN( asn=asn, rir=rir, tenant=tenant, description=description, + owner=owner, comments=comments, tags=tags, + sites=sites, custom_fields=custom_fields, metadata=metadata, - owner=owner, - sites=sites, ) return result @@ -563,19 +566,21 @@ def __new__( end: int | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, ) -> pb.ASNRange: """Create a new ASNRange.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ASNRange( name=name, slug=slug, @@ -584,11 +589,11 @@ def __new__( end=end, tenant=tenant, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - comments=comments, ) return result @@ -603,30 +608,32 @@ def __new__( tenant: str | Tenant | pb.Tenant | None = None, date_added: datetime.datetime | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.Aggregate: """Create a new Aggregate.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.Aggregate( prefix=prefix, rir=rir, tenant=tenant, date_added=date_added, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -637,47 +644,49 @@ class Cable: def __new__( cls, type: str | None = None, - a_terminations: list[GenericObject | pb.GenericObject] | None = None, - b_terminations: list[GenericObject | pb.GenericObject] | None = None, + a_terminations: list[str | GenericObject | pb.GenericObject] | None = None, + b_terminations: list[str | GenericObject | pb.GenericObject] | None = None, status: str | None = None, + profile: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, label: str | None = None, color: str | None = None, length: float | None = None, length_unit: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - profile: str | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.Cable: """Create a new Cable.""" a_terminations = convert_to_protobuf_list(a_terminations, pb.GenericObject) b_terminations = convert_to_protobuf_list(b_terminations, pb.GenericObject) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.Cable( type=type, a_terminations=a_terminations, b_terminations=b_terminations, status=status, + profile=profile, tenant=tenant, label=label, color=color, length=length, length_unit=length_unit, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - profile=profile, - owner=owner, ) return result @@ -703,71 +712,6 @@ def __new__( return result -class CableTermination: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CableTermination.""" - - def __new__( - cls, - cable: Cable | pb.Cable | None = None, - cable_end: str | None = None, - termination_circuit_termination: ( - CircuitTermination | pb.CircuitTermination | None - ) = None, - termination_console_port: str | ConsolePort | pb.ConsolePort | None = None, - termination_console_server_port: ( - str | ConsoleServerPort | pb.ConsoleServerPort | None - ) = None, - termination_front_port: str | FrontPort | pb.FrontPort | None = None, - termination_interface: str | Interface | pb.Interface | None = None, - termination_power_feed: str | PowerFeed | pb.PowerFeed | None = None, - termination_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, - termination_power_port: str | PowerPort | pb.PowerPort | None = None, - termination_rear_port: str | RearPort | pb.RearPort | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.CableTermination: - """Create a new CableTermination.""" - cable = convert_to_protobuf(cable, pb.Cable) - termination_circuit_termination = convert_to_protobuf( - termination_circuit_termination, pb.CircuitTermination - ) - termination_console_port = convert_to_protobuf( - termination_console_port, pb.ConsolePort - ) - termination_console_server_port = convert_to_protobuf( - termination_console_server_port, pb.ConsoleServerPort - ) - termination_front_port = convert_to_protobuf( - termination_front_port, pb.FrontPort - ) - termination_interface = convert_to_protobuf(termination_interface, pb.Interface) - termination_power_feed = convert_to_protobuf( - termination_power_feed, pb.PowerFeed - ) - termination_power_outlet = convert_to_protobuf( - termination_power_outlet, pb.PowerOutlet - ) - termination_power_port = convert_to_protobuf( - termination_power_port, pb.PowerPort - ) - termination_rear_port = convert_to_protobuf(termination_rear_port, pb.RearPort) - metadata = convert_dict_to_struct(metadata) - result = pb.CableTermination( - cable=cable, - cable_end=cable_end, - termination_circuit_termination=termination_circuit_termination, - termination_console_port=termination_console_port, - termination_console_server_port=termination_console_server_port, - termination_front_port=termination_front_port, - termination_interface=termination_interface, - termination_power_feed=termination_power_feed, - termination_power_outlet=termination_power_outlet, - termination_power_port=termination_power_port, - termination_rear_port=termination_rear_port, - metadata=metadata, - ) - return result - - class Circuit: """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Circuit.""" @@ -785,25 +729,27 @@ def __new__( description: str | None = None, distance: float | None = None, distance_unit: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, assignments: ( - list[CircuitGroupAssignment | pb.CircuitGroupAssignment] | None + list[str | CircuitGroupAssignment | pb.CircuitGroupAssignment] | None + ) = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None ) = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.Circuit: """Create a new Circuit.""" provider = convert_to_protobuf(provider, pb.Provider) provider_account = convert_to_protobuf(provider_account, pb.ProviderAccount) type = convert_to_protobuf(type, pb.CircuitType) tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) assignments = convert_to_protobuf_list(assignments, pb.CircuitGroupAssignment) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.Circuit( cid=cid, provider=provider, @@ -817,12 +763,12 @@ def __new__( description=description, distance=distance, distance_unit=distance_unit, + owner=owner, comments=comments, tags=tags, assignments=assignments, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -836,28 +782,30 @@ def __new__( slug: str | None = None, description: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, ) -> pb.CircuitGroup: """Create a new CircuitGroup.""" tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.CircuitGroup( name=name, slug=slug, description=description, tenant=tenant, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - comments=comments, ) return result @@ -914,7 +862,9 @@ def __new__( description: str | None = None, mark_connected: bool | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, ) -> pb.CircuitTermination: """Create a new CircuitTermination.""" @@ -961,27 +911,29 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, ) -> pb.CircuitType: """Create a new CircuitType.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.CircuitType( name=name, slug=slug, color=color, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - comments=comments, ) return result @@ -1001,11 +953,13 @@ def __new__( scope_site: str | Site | pb.Site | None = None, scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.Cluster: """Create a new Cluster.""" type = convert_to_protobuf(type, pb.ClusterType) @@ -1015,10 +969,10 @@ def __new__( scope_region = convert_to_protobuf(scope_region, pb.Region) scope_site = convert_to_protobuf(scope_site, pb.Site) scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.Cluster( name=name, type=type, @@ -1030,11 +984,11 @@ def __new__( scope_site=scope_site, scope_site_group=scope_site_group, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -1047,26 +1001,28 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, ) -> pb.ClusterGroup: """Create a new ClusterGroup.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ClusterGroup( name=name, slug=slug, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - comments=comments, ) return result @@ -1079,26 +1035,28 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, ) -> pb.ClusterType: """Create a new ClusterType.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ClusterType( name=name, slug=slug, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - comments=comments, ) return result @@ -1109,25 +1067,27 @@ class ConsolePort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: Module | pb.Module | None = None, + module: str | Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, speed: int | None = None, description: str | None = None, mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.ConsolePort: """Create a new ConsolePort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ConsolePort( device=device, module=module, @@ -1137,10 +1097,10 @@ def __new__( speed=speed, description=description, mark_connected=mark_connected, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -1151,25 +1111,27 @@ class ConsoleServerPort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: Module | pb.Module | None = None, + module: str | Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, speed: int | None = None, description: str | None = None, mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.ConsoleServerPort: """Create a new ConsoleServerPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ConsoleServerPort( device=device, module=module, @@ -1179,10 +1141,10 @@ def __new__( speed=speed, description=description, mark_connected=mark_connected, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -1192,7 +1154,7 @@ class Contact: def __new__( cls, - group: str | ContactGroup | pb.ContactGroup | None = None, + groups: list[str | ContactGroup | pb.ContactGroup] | None = None, name: str | None = None, title: str | None = None, phone: str | None = None, @@ -1200,22 +1162,22 @@ def __new__( address: str | None = None, link: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - groups: list[str | ContactGroup | pb.ContactGroup] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.Contact: """Create a new Contact.""" - group = convert_to_protobuf(group, pb.ContactGroup) + groups = convert_to_protobuf_list(groups, pb.ContactGroup) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - groups = convert_to_protobuf_list(groups, pb.ContactGroup) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.Contact( - group=group, + groups=groups, name=name, title=title, phone=phone, @@ -1223,12 +1185,11 @@ def __new__( address=address, link=link, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, - groups=groups, metadata=metadata, - owner=owner, ) return result @@ -1240,17 +1201,19 @@ def __new__( cls, object_asn: str | ASN | pb.ASN | None = None, object_asn_range: str | ASNRange | pb.ASNRange | None = None, - object_aggregate: Aggregate | pb.Aggregate | None = None, - object_cable: Cable | pb.Cable | None = None, - object_cable_path: CablePath | pb.CablePath | None = None, - object_cable_termination: CableTermination | pb.CableTermination | None = None, + object_aggregate: str | Aggregate | pb.Aggregate | None = None, + object_cable: str | Cable | pb.Cable | None = None, + object_cable_path: str | CablePath | pb.CablePath | None = None, + object_cable_termination: ( + str | CableTermination | pb.CableTermination | None + ) = None, object_circuit: str | Circuit | pb.Circuit | None = None, object_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, object_circuit_group_assignment: ( - CircuitGroupAssignment | pb.CircuitGroupAssignment | None + str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, object_circuit_termination: ( - CircuitTermination | pb.CircuitTermination | None + str | CircuitTermination | pb.CircuitTermination | None ) = None, object_circuit_type: str | CircuitType | pb.CircuitType | None = None, object_cluster: str | Cluster | pb.Cluster | None = None, @@ -1262,23 +1225,28 @@ def __new__( ) = None, object_contact: str | Contact | pb.Contact | None = None, object_contact_assignment: ( - ContactAssignment | pb.ContactAssignment | None + str | ContactAssignment | pb.ContactAssignment | None ) = None, object_contact_group: str | ContactGroup | pb.ContactGroup | None = None, object_contact_role: str | ContactRole | pb.ContactRole | None = None, + object_custom_field: str | CustomField | pb.CustomField | None = None, + object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + object_custom_link: str | CustomLink | pb.CustomLink | None = None, object_device: str | Device | pb.Device | None = None, object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, object_device_role: str | DeviceRole | pb.DeviceRole | None = None, object_device_type: str | DeviceType | pb.DeviceType | None = None, object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, object_fhrp_group_assignment: ( - FHRPGroupAssignment | pb.FHRPGroupAssignment | None + str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, object_front_port: str | FrontPort | pb.FrontPort | None = None, object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, object_ip_address: str | IPAddress | pb.IPAddress | None = None, - object_ip_range: IPRange | pb.IPRange | None = None, + object_ip_range: str | IPRange | pb.IPRange | None = None, object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, object_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, object_ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -1287,14 +1255,22 @@ def __new__( object_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, + object_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, object_l2vpn: str | L2VPN | pb.L2VPN | None = None, - object_l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, + object_l2vpn_termination: ( + str | L2VPNTermination | pb.L2VPNTermination | None + ) = None, object_location: str | Location | pb.Location | None = None, object_mac_address: str | MACAddress | pb.MACAddress | None = None, object_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - object_module: Module | pb.Module | None = None, + object_module: str | Module | pb.Module | None = None, object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, object_module_type: str | ModuleType | pb.ModuleType | None = None, + object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + object_owner: str | Owner | pb.Owner | None = None, + object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, object_platform: str | Platform | pb.Platform | None = None, object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -1310,7 +1286,9 @@ def __new__( ) = None, object_rir: str | RIR | pb.RIR | None = None, object_rack: str | Rack | pb.Rack | None = None, - object_rack_reservation: RackReservation | pb.RackReservation | None = None, + object_rack_reservation: ( + str | RackReservation | pb.RackReservation | None + ) = None, object_rack_role: str | RackRole | pb.RackRole | None = None, object_rack_type: str | RackType | pb.RackType | None = None, object_rear_port: str | RearPort | pb.RearPort | None = None, @@ -1326,7 +1304,7 @@ def __new__( object_tunnel: str | Tunnel | pb.Tunnel | None = None, object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, object_tunnel_termination: ( - TunnelTermination | pb.TunnelTermination | None + str | TunnelTermination | pb.TunnelTermination | None ) = None, object_vlan: str | VLAN | pb.VLAN | None = None, object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, @@ -1334,14 +1312,14 @@ def __new__( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, object_vlan_translation_rule: ( - VLANTranslationRule | pb.VLANTranslationRule | None + str | VLANTranslationRule | pb.VLANTranslationRule | None ) = None, object_vm_interface: str | VMInterface | pb.VMInterface | None = None, object_vrf: str | VRF | pb.VRF | None = None, object_virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, object_virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, object_virtual_circuit_termination: ( - VirtualCircuitTermination | pb.VirtualCircuitTermination | None + str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, object_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -1355,23 +1333,14 @@ def __new__( object_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - object_wireless_link: WirelessLink | pb.WirelessLink | None = None, - object_custom_field: str | CustomField | pb.CustomField | None = None, - object_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - object_journal_entry: JournalEntry | pb.JournalEntry | None = None, - object_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - object_custom_link: str | CustomLink | pb.CustomLink | None = None, - object_owner: str | Owner | pb.Owner | None = None, - object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + object_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, contact: str | Contact | pb.Contact | None = None, role: str | ContactRole | pb.ContactRole | None = None, priority: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, ) -> pb.ContactAssignment: """Create a new ContactAssignment.""" @@ -1380,9 +1349,6 @@ def __new__( object_aggregate = convert_to_protobuf(object_aggregate, pb.Aggregate) object_cable = convert_to_protobuf(object_cable, pb.Cable) object_cable_path = convert_to_protobuf(object_cable_path, pb.CablePath) - object_cable_termination = convert_to_protobuf( - object_cable_termination, pb.CableTermination - ) object_circuit = convert_to_protobuf(object_circuit, pb.Circuit) object_circuit_group = convert_to_protobuf( object_circuit_group, pb.CircuitGroup @@ -1411,6 +1377,11 @@ def __new__( object_contact_group, pb.ContactGroup ) object_contact_role = convert_to_protobuf(object_contact_role, pb.ContactRole) + object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) + object_custom_field_choice_set = convert_to_protobuf( + object_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) object_device = convert_to_protobuf(object_device, pb.Device) object_device_bay = convert_to_protobuf(object_device_bay, pb.DeviceBay) object_device_role = convert_to_protobuf(object_device_role, pb.DeviceRole) @@ -1438,6 +1409,9 @@ def __new__( object_inventory_item_role = convert_to_protobuf( object_inventory_item_role, pb.InventoryItemRole ) + object_journal_entry = convert_to_protobuf( + object_journal_entry, pb.JournalEntry + ) object_l2vpn = convert_to_protobuf(object_l2vpn, pb.L2VPN) object_l2vpn_termination = convert_to_protobuf( object_l2vpn_termination, pb.L2VPNTermination @@ -1448,6 +1422,11 @@ def __new__( object_module = convert_to_protobuf(object_module, pb.Module) object_module_bay = convert_to_protobuf(object_module_bay, pb.ModuleBay) object_module_type = convert_to_protobuf(object_module_type, pb.ModuleType) + object_module_type_profile = convert_to_protobuf( + object_module_type_profile, pb.ModuleTypeProfile + ) + object_owner = convert_to_protobuf(object_owner, pb.Owner) + object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) object_platform = convert_to_protobuf(object_platform, pb.Platform) object_power_feed = convert_to_protobuf(object_power_feed, pb.PowerFeed) object_power_outlet = convert_to_protobuf(object_power_outlet, pb.PowerOutlet) @@ -1519,19 +1498,6 @@ def __new__( object_wireless_link = convert_to_protobuf( object_wireless_link, pb.WirelessLink ) - object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) - object_custom_field_choice_set = convert_to_protobuf( - object_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - object_journal_entry = convert_to_protobuf( - object_journal_entry, pb.JournalEntry - ) - object_module_type_profile = convert_to_protobuf( - object_module_type_profile, pb.ModuleTypeProfile - ) - object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) - object_owner = convert_to_protobuf(object_owner, pb.Owner) - object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) contact = convert_to_protobuf(contact, pb.Contact) role = convert_to_protobuf(role, pb.ContactRole) tags = convert_to_protobuf_list(tags, pb.Tag) @@ -1558,6 +1524,9 @@ def __new__( object_contact_assignment=object_contact_assignment, object_contact_group=object_contact_group, object_contact_role=object_contact_role, + object_custom_field=object_custom_field, + object_custom_field_choice_set=object_custom_field_choice_set, + object_custom_link=object_custom_link, object_device=object_device, object_device_bay=object_device_bay, object_device_role=object_device_role, @@ -1575,6 +1544,7 @@ def __new__( object_interface=object_interface, object_inventory_item=object_inventory_item, object_inventory_item_role=object_inventory_item_role, + object_journal_entry=object_journal_entry, object_l2vpn=object_l2vpn, object_l2vpn_termination=object_l2vpn_termination, object_location=object_location, @@ -1583,6 +1553,9 @@ def __new__( object_module=object_module, object_module_bay=object_module_bay, object_module_type=object_module_type, + object_module_type_profile=object_module_type_profile, + object_owner=object_owner, + object_owner_group=object_owner_group, object_platform=object_platform, object_power_feed=object_power_feed, object_power_outlet=object_power_outlet, @@ -1626,13 +1599,6 @@ def __new__( object_wireless_lan=object_wireless_lan, object_wireless_lan_group=object_wireless_lan_group, object_wireless_link=object_wireless_link, - object_custom_field=object_custom_field, - object_custom_field_choice_set=object_custom_field_choice_set, - object_journal_entry=object_journal_entry, - object_module_type_profile=object_module_type_profile, - object_custom_link=object_custom_link, - object_owner=object_owner, - object_owner_group=object_owner_group, contact=contact, role=role, priority=priority, @@ -1653,27 +1619,29 @@ def __new__( parent: str | ContactGroup | pb.ContactGroup | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.ContactGroup: """Create a new ContactGroup.""" parent = convert_to_protobuf(parent, pb.ContactGroup) tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ContactGroup( name=name, slug=slug, parent=parent, description=description, tags=tags, - custom_fields=custom_fields, + owner=owner, comments=comments, + custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -1686,26 +1654,119 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, ) -> pb.ContactRole: """Create a new ContactRole.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.ContactRole( name=name, slug=slug, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + ) + return result + + +class CustomField: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomField.""" + + def __new__( + cls, + object_types: list[str] | None = None, + type: str | None = None, + related_object_type: str | None = None, + name: str | None = None, + label: str | None = None, + group_name: str | None = None, + description: str | None = None, + required: bool | None = None, + unique: bool | None = None, + search_weight: int | None = None, + filter_logic: str | None = None, + ui_visible: str | None = None, + ui_editable: str | None = None, + is_cloneable: bool | None = None, + default: str | None = None, + related_object_filter: str | None = None, + weight: int | None = None, + validation_minimum: float | None = None, + validation_maximum: float | None = None, + validation_regex: str | None = None, + choice_set: str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.CustomField: + """Create a new CustomField.""" + choice_set = convert_to_protobuf(choice_set, pb.CustomFieldChoiceSet) + owner = convert_to_protobuf(owner, pb.Owner) + metadata = convert_dict_to_struct(metadata) + result = pb.CustomField( + object_types=object_types, + type=type, + related_object_type=related_object_type, + name=name, + label=label, + group_name=group_name, + description=description, + required=required, + unique=unique, + search_weight=search_weight, + filter_logic=filter_logic, + ui_visible=ui_visible, + ui_editable=ui_editable, + is_cloneable=is_cloneable, + default=default, + related_object_filter=related_object_filter, + weight=weight, + validation_minimum=validation_minimum, + validation_maximum=validation_maximum, + validation_regex=validation_regex, + choice_set=choice_set, owner=owner, comments=comments, + metadata=metadata, + ) + return result + + +class CustomFieldChoiceSet: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomFieldChoiceSet.""" + + def __new__( + cls, + name: str | None = None, + description: str | None = None, + base_choices: str | None = None, + extra_choices: list[str] | None = None, + order_alphabetically: bool | None = None, + owner: str | Owner | pb.Owner | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.CustomFieldChoiceSet: + """Create a new CustomFieldChoiceSet.""" + owner = convert_to_protobuf(owner, pb.Owner) + metadata = convert_dict_to_struct(metadata) + result = pb.CustomFieldChoiceSet( + name=name, + description=description, + base_choices=base_choices, + extra_choices=extra_choices, + order_alphabetically=order_alphabetically, + owner=owner, + metadata=metadata, ) return result @@ -1717,16 +1778,17 @@ def __new__( cls, asn: str | ASN | pb.ASN | None = None, asn_range: str | ASNRange | pb.ASNRange | None = None, - aggregate: Aggregate | pb.Aggregate | None = None, - cable: Cable | pb.Cable | None = None, - cable_path: CablePath | pb.CablePath | None = None, - cable_termination: CableTermination | pb.CableTermination | None = None, + aggregate: str | Aggregate | pb.Aggregate | None = None, + cable: str | Cable | pb.Cable | None = None, + cable_path: str | CablePath | pb.CablePath | None = None, circuit: str | Circuit | pb.Circuit | None = None, circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, circuit_group_assignment: ( - CircuitGroupAssignment | pb.CircuitGroupAssignment | None + str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + ) = None, + circuit_termination: ( + str | CircuitTermination | pb.CircuitTermination | None ) = None, - circuit_termination: CircuitTermination | pb.CircuitTermination | None = None, circuit_type: str | CircuitType | pb.CircuitType | None = None, cluster: str | Cluster | pb.Cluster | None = None, cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, @@ -1736,22 +1798,29 @@ def __new__( str | ConsoleServerPort | pb.ConsoleServerPort | None ) = None, contact: str | Contact | pb.Contact | None = None, - contact_assignment: ContactAssignment | pb.ContactAssignment | None = None, + contact_assignment: ( + str | ContactAssignment | pb.ContactAssignment | None + ) = None, contact_group: str | ContactGroup | pb.ContactGroup | None = None, contact_role: str | ContactRole | pb.ContactRole | None = None, + custom_field: str | CustomField | pb.CustomField | None = None, + custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + custom_link: str | CustomLink | pb.CustomLink | None = None, device: str | Device | pb.Device | None = None, device_bay: str | DeviceBay | pb.DeviceBay | None = None, device_role: str | DeviceRole | pb.DeviceRole | None = None, device_type: str | DeviceType | pb.DeviceType | None = None, fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, fhrp_group_assignment: ( - FHRPGroupAssignment | pb.FHRPGroupAssignment | None + str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, front_port: str | FrontPort | pb.FrontPort | None = None, ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, ip_address: str | IPAddress | pb.IPAddress | None = None, - ip_range: IPRange | pb.IPRange | None = None, + ip_range: str | IPRange | pb.IPRange | None = None, ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -1760,14 +1829,20 @@ def __new__( inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, + journal_entry: str | JournalEntry | pb.JournalEntry | None = None, l2vpn: str | L2VPN | pb.L2VPN | None = None, - l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, + l2vpn_termination: str | L2VPNTermination | pb.L2VPNTermination | None = None, location: str | Location | pb.Location | None = None, mac_address: str | MACAddress | pb.MACAddress | None = None, manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - module: Module | pb.Module | None = None, + module: str | Module | pb.Module | None = None, module_bay: str | ModuleBay | pb.ModuleBay | None = None, module_type: str | ModuleType | pb.ModuleType | None = None, + module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + owner: str | Owner | pb.Owner | None = None, + owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, platform: str | Platform | pb.Platform | None = None, power_feed: str | PowerFeed | pb.PowerFeed | None = None, power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -1779,7 +1854,7 @@ def __new__( provider_network: str | ProviderNetwork | pb.ProviderNetwork | None = None, rir: str | RIR | pb.RIR | None = None, rack: str | Rack | pb.Rack | None = None, - rack_reservation: RackReservation | pb.RackReservation | None = None, + rack_reservation: str | RackReservation | pb.RackReservation | None = None, rack_role: str | RackRole | pb.RackRole | None = None, rack_type: str | RackType | pb.RackType | None = None, rear_port: str | RearPort | pb.RearPort | None = None, @@ -1794,21 +1869,23 @@ def __new__( tenant_group: str | TenantGroup | pb.TenantGroup | None = None, tunnel: str | Tunnel | pb.Tunnel | None = None, tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - tunnel_termination: TunnelTermination | pb.TunnelTermination | None = None, + tunnel_termination: ( + str | TunnelTermination | pb.TunnelTermination | None + ) = None, vlan: str | VLAN | pb.VLAN | None = None, vlan_group: str | VLANGroup | pb.VLANGroup | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, vlan_translation_rule: ( - VLANTranslationRule | pb.VLANTranslationRule | None + str | VLANTranslationRule | pb.VLANTranslationRule | None ) = None, vm_interface: str | VMInterface | pb.VMInterface | None = None, vrf: str | VRF | pb.VRF | None = None, virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, virtual_circuit_termination: ( - VirtualCircuitTermination | pb.VirtualCircuitTermination | None + str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -1820,18 +1897,7 @@ def __new__( virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, wireless_lan_group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, - wireless_link: WirelessLink | pb.WirelessLink | None = None, - custom_field: str | CustomField | pb.CustomField | None = None, - custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - journal_entry: JournalEntry | pb.JournalEntry | None = None, - module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - custom_link: str | CustomLink | pb.CustomLink | None = None, - owner: str | Owner | pb.Owner | None = None, - owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + wireless_link: str | WirelessLink | pb.WirelessLink | None = None, ) -> pb.CustomFieldObjectReference: """Create a new CustomFieldObjectReference.""" asn = convert_to_protobuf(asn, pb.ASN) @@ -1839,7 +1905,6 @@ def __new__( aggregate = convert_to_protobuf(aggregate, pb.Aggregate) cable = convert_to_protobuf(cable, pb.Cable) cable_path = convert_to_protobuf(cable_path, pb.CablePath) - cable_termination = convert_to_protobuf(cable_termination, pb.CableTermination) circuit = convert_to_protobuf(circuit, pb.Circuit) circuit_group = convert_to_protobuf(circuit_group, pb.CircuitGroup) circuit_group_assignment = convert_to_protobuf( @@ -1862,6 +1927,11 @@ def __new__( ) contact_group = convert_to_protobuf(contact_group, pb.ContactGroup) contact_role = convert_to_protobuf(contact_role, pb.ContactRole) + custom_field = convert_to_protobuf(custom_field, pb.CustomField) + custom_field_choice_set = convert_to_protobuf( + custom_field_choice_set, pb.CustomFieldChoiceSet + ) + custom_link = convert_to_protobuf(custom_link, pb.CustomLink) device = convert_to_protobuf(device, pb.Device) device_bay = convert_to_protobuf(device_bay, pb.DeviceBay) device_role = convert_to_protobuf(device_role, pb.DeviceRole) @@ -1883,6 +1953,7 @@ def __new__( inventory_item_role = convert_to_protobuf( inventory_item_role, pb.InventoryItemRole ) + journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) l2vpn_termination = convert_to_protobuf(l2vpn_termination, pb.L2VPNTermination) location = convert_to_protobuf(location, pb.Location) @@ -1891,6 +1962,11 @@ def __new__( module = convert_to_protobuf(module, pb.Module) module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) module_type = convert_to_protobuf(module_type, pb.ModuleType) + module_type_profile = convert_to_protobuf( + module_type_profile, pb.ModuleTypeProfile + ) + owner = convert_to_protobuf(owner, pb.Owner) + owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) platform = convert_to_protobuf(platform, pb.Platform) power_feed = convert_to_protobuf(power_feed, pb.PowerFeed) power_outlet = convert_to_protobuf(power_outlet, pb.PowerOutlet) @@ -1948,24 +2024,12 @@ def __new__( wireless_lan_group, pb.WirelessLANGroup ) wireless_link = convert_to_protobuf(wireless_link, pb.WirelessLink) - custom_field = convert_to_protobuf(custom_field, pb.CustomField) - custom_field_choice_set = convert_to_protobuf( - custom_field_choice_set, pb.CustomFieldChoiceSet - ) - journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) - module_type_profile = convert_to_protobuf( - module_type_profile, pb.ModuleTypeProfile - ) - custom_link = convert_to_protobuf(custom_link, pb.CustomLink) - owner = convert_to_protobuf(owner, pb.Owner) - owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) result = pb.CustomFieldObjectReference( asn=asn, asn_range=asn_range, aggregate=aggregate, cable=cable, cable_path=cable_path, - cable_termination=cable_termination, circuit=circuit, circuit_group=circuit_group, circuit_group_assignment=circuit_group_assignment, @@ -1980,6 +2044,9 @@ def __new__( contact_assignment=contact_assignment, contact_group=contact_group, contact_role=contact_role, + custom_field=custom_field, + custom_field_choice_set=custom_field_choice_set, + custom_link=custom_link, device=device, device_bay=device_bay, device_role=device_role, @@ -1997,6 +2064,7 @@ def __new__( interface=interface, inventory_item=inventory_item, inventory_item_role=inventory_item_role, + journal_entry=journal_entry, l2vpn=l2vpn, l2vpn_termination=l2vpn_termination, location=location, @@ -2005,6 +2073,9 @@ def __new__( module=module, module_bay=module_bay, module_type=module_type, + module_type_profile=module_type_profile, + owner=owner, + owner_group=owner_group, platform=platform, power_feed=power_feed, power_outlet=power_outlet, @@ -2048,13 +2119,6 @@ def __new__( wireless_lan=wireless_lan, wireless_lan_group=wireless_lan_group, wireless_link=wireless_link, - custom_field=custom_field, - custom_field_choice_set=custom_field_choice_set, - journal_entry=journal_entry, - module_type_profile=module_type_profile, - custom_link=custom_link, - owner=owner, - owner_group=owner_group, ) return result @@ -2064,10 +2128,6 @@ class CustomFieldValue: def __new__( cls, - multiple_selection: list[str] | None = None, - multiple_objects: ( - list[CustomFieldObjectReference | pb.CustomFieldObjectReference] | None - ) = None, text: str | None = None, long_text: str | None = None, integer: int | None = None, @@ -2079,17 +2139,20 @@ def __new__( json: str | None = None, selection: str | None = None, object: ( - CustomFieldObjectReference | pb.CustomFieldObjectReference | None + str | CustomFieldObjectReference | pb.CustomFieldObjectReference | None + ) = None, + multiple_selection: list[str] | None = None, + multiple_objects: ( + list[str | CustomFieldObjectReference | pb.CustomFieldObjectReference] + | None ) = None, ) -> pb.CustomFieldValue: """Create a new CustomFieldValue.""" + object = convert_to_protobuf(object, pb.CustomFieldObjectReference) multiple_objects = convert_to_protobuf_list( multiple_objects, pb.CustomFieldObjectReference ) - object = convert_to_protobuf(object, pb.CustomFieldObjectReference) result = pb.CustomFieldValue( - multiple_selection=multiple_selection, - multiple_objects=multiple_objects, text=text, long_text=long_text, integer=integer, @@ -2101,24 +2164,62 @@ def __new__( json=json, selection=selection, object=object, + multiple_selection=multiple_selection, + multiple_objects=multiple_objects, ) return result -class Device: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Device.""" +class CustomLink: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomLink.""" def __new__( cls, + object_types: list[str] | None = None, name: str | None = None, - device_type: str | DeviceType | pb.DeviceType | None = None, - role: str | DeviceRole | pb.DeviceRole | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - platform: str | Platform | pb.Platform | None = None, - serial: str | None = None, - asset_tag: str | None = None, - site: str | Site | pb.Site | None = None, - location: str | Location | pb.Location | None = None, + enabled: bool | None = None, + link_text: str | None = None, + link_url: str | None = None, + weight: int | None = None, + group_name: str | None = None, + button_class: str | None = None, + new_window: bool | None = None, + owner: str | Owner | pb.Owner | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.CustomLink: + """Create a new CustomLink.""" + owner = convert_to_protobuf(owner, pb.Owner) + metadata = convert_dict_to_struct(metadata) + result = pb.CustomLink( + object_types=object_types, + name=name, + enabled=enabled, + link_text=link_text, + link_url=link_url, + weight=weight, + group_name=group_name, + button_class=button_class, + new_window=new_window, + owner=owner, + metadata=metadata, + ) + return result + + +class Device: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Device.""" + + def __new__( + cls, + name: str | None = None, + device_type: str | DeviceType | pb.DeviceType | None = None, + role: str | DeviceRole | pb.DeviceRole | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + platform: str | Platform | pb.Platform | None = None, + serial: str | None = None, + asset_tag: str | None = None, + site: str | Site | pb.Site | None = None, + location: str | Location | pb.Location | None = None, rack: str | Rack | pb.Rack | None = None, position: float | None = None, face: str | None = None, @@ -2134,12 +2235,13 @@ def __new__( vc_position: int | None = None, vc_priority: int | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - config: DeviceConfig | pb.DeviceConfig | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, ) -> pb.Device: @@ -2156,11 +2258,10 @@ def __new__( oob_ip = convert_to_protobuf(oob_ip, pb.IPAddress) cluster = convert_to_protobuf(cluster, pb.Cluster) virtual_chassis = convert_to_protobuf(virtual_chassis, pb.VirtualChassis) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - config = convert_to_protobuf(config, pb.DeviceConfig) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -2196,12 +2297,11 @@ def __new__( vc_position=vc_position, vc_priority=vc_priority, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - config=config, ) return result @@ -2216,28 +2316,30 @@ def __new__( label: str | None = None, description: str | None = None, installed_device: str | Device | pb.Device | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceBay: """Create a new DeviceBay.""" device = convert_to_protobuf(device, pb.Device) installed_device = convert_to_protobuf(installed_device, pb.Device) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceBay( device=device, name=name, label=label, description=description, installed_device=installed_device, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -2251,32 +2353,34 @@ def __new__( slug: str | None = None, color: str | None = None, vm_role: bool | None = None, + parent: str | DeviceRole | pb.DeviceRole | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - parent: str | DeviceRole | pb.DeviceRole | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceRole: """Create a new DeviceRole.""" + parent = convert_to_protobuf(parent, pb.DeviceRole) tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - parent = convert_to_protobuf(parent, pb.DeviceRole) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceRole( name=name, slug=slug, color=color, vm_role=vm_role, + parent=parent, description=description, tags=tags, - custom_fields=custom_fields, - parent=parent, + owner=owner, comments=comments, + custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -2299,19 +2403,21 @@ def __new__( weight: float | None = None, weight_unit: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceType: """Create a new DeviceType.""" manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) default_platform = convert_to_protobuf(default_platform, pb.Platform) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceType( manufacturer=manufacturer, default_platform=default_platform, @@ -2326,11 +2432,11 @@ def __new__( weight=weight, weight_unit=weight_unit, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -2346,17 +2452,19 @@ def __new__( auth_type: str | None = None, auth_key: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.FHRPGroup: """Create a new FHRPGroup.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.FHRPGroup( name=name, protocol=protocol, @@ -2364,11 +2472,11 @@ def __new__( auth_type=auth_type, auth_key=auth_key, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -2381,19 +2489,19 @@ def __new__( group: str | FHRPGroup | pb.FHRPGroup | None = None, interface_asn: str | ASN | pb.ASN | None = None, interface_asn_range: str | ASNRange | pb.ASNRange | None = None, - interface_aggregate: Aggregate | pb.Aggregate | None = None, - interface_cable: Cable | pb.Cable | None = None, - interface_cable_path: CablePath | pb.CablePath | None = None, + interface_aggregate: str | Aggregate | pb.Aggregate | None = None, + interface_cable: str | Cable | pb.Cable | None = None, + interface_cable_path: str | CablePath | pb.CablePath | None = None, interface_cable_termination: ( - CableTermination | pb.CableTermination | None + str | CableTermination | pb.CableTermination | None ) = None, interface_circuit: str | Circuit | pb.Circuit | None = None, interface_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, interface_circuit_group_assignment: ( - CircuitGroupAssignment | pb.CircuitGroupAssignment | None + str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, interface_circuit_termination: ( - CircuitTermination | pb.CircuitTermination | None + str | CircuitTermination | pb.CircuitTermination | None ) = None, interface_circuit_type: str | CircuitType | pb.CircuitType | None = None, interface_cluster: str | Cluster | pb.Cluster | None = None, @@ -2405,23 +2513,28 @@ def __new__( ) = None, interface_contact: str | Contact | pb.Contact | None = None, interface_contact_assignment: ( - ContactAssignment | pb.ContactAssignment | None + str | ContactAssignment | pb.ContactAssignment | None ) = None, interface_contact_group: str | ContactGroup | pb.ContactGroup | None = None, interface_contact_role: str | ContactRole | pb.ContactRole | None = None, + interface_custom_field: str | CustomField | pb.CustomField | None = None, + interface_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + interface_custom_link: str | CustomLink | pb.CustomLink | None = None, interface_device: str | Device | pb.Device | None = None, interface_device_bay: str | DeviceBay | pb.DeviceBay | None = None, interface_device_role: str | DeviceRole | pb.DeviceRole | None = None, interface_device_type: str | DeviceType | pb.DeviceType | None = None, interface_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, interface_fhrp_group_assignment: ( - FHRPGroupAssignment | pb.FHRPGroupAssignment | None + str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, interface_front_port: str | FrontPort | pb.FrontPort | None = None, interface_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, interface_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, interface_ip_address: str | IPAddress | pb.IPAddress | None = None, - interface_ip_range: IPRange | pb.IPRange | None = None, + interface_ip_range: str | IPRange | pb.IPRange | None = None, interface_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, interface_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, interface_ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -2430,16 +2543,22 @@ def __new__( interface_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, + interface_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, interface_l2vpn: str | L2VPN | pb.L2VPN | None = None, interface_l2vpn_termination: ( - L2VPNTermination | pb.L2VPNTermination | None + str | L2VPNTermination | pb.L2VPNTermination | None ) = None, interface_location: str | Location | pb.Location | None = None, interface_mac_address: str | MACAddress | pb.MACAddress | None = None, interface_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - interface_module: Module | pb.Module | None = None, + interface_module: str | Module | pb.Module | None = None, interface_module_bay: str | ModuleBay | pb.ModuleBay | None = None, interface_module_type: str | ModuleType | pb.ModuleType | None = None, + interface_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + interface_owner: str | Owner | pb.Owner | None = None, + interface_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, interface_platform: str | Platform | pb.Platform | None = None, interface_power_feed: str | PowerFeed | pb.PowerFeed | None = None, interface_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -2455,7 +2574,9 @@ def __new__( ) = None, interface_rir: str | RIR | pb.RIR | None = None, interface_rack: str | Rack | pb.Rack | None = None, - interface_rack_reservation: RackReservation | pb.RackReservation | None = None, + interface_rack_reservation: ( + str | RackReservation | pb.RackReservation | None + ) = None, interface_rack_role: str | RackRole | pb.RackRole | None = None, interface_rack_type: str | RackType | pb.RackType | None = None, interface_rear_port: str | RearPort | pb.RearPort | None = None, @@ -2471,7 +2592,7 @@ def __new__( interface_tunnel: str | Tunnel | pb.Tunnel | None = None, interface_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, interface_tunnel_termination: ( - TunnelTermination | pb.TunnelTermination | None + str | TunnelTermination | pb.TunnelTermination | None ) = None, interface_vlan: str | VLAN | pb.VLAN | None = None, interface_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, @@ -2479,7 +2600,7 @@ def __new__( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, interface_vlan_translation_rule: ( - VLANTranslationRule | pb.VLANTranslationRule | None + str | VLANTranslationRule | pb.VLANTranslationRule | None ) = None, interface_vm_interface: str | VMInterface | pb.VMInterface | None = None, interface_vrf: str | VRF | pb.VRF | None = None, @@ -2490,7 +2611,7 @@ def __new__( str | VirtualCircuit | pb.VirtualCircuit | None ) = None, interface_virtual_circuit_termination: ( - VirtualCircuitTermination | pb.VirtualCircuitTermination | None + str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, interface_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -2506,18 +2627,7 @@ def __new__( interface_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - interface_wireless_link: WirelessLink | pb.WirelessLink | None = None, - interface_custom_field: str | CustomField | pb.CustomField | None = None, - interface_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - interface_journal_entry: JournalEntry | pb.JournalEntry | None = None, - interface_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - interface_custom_link: str | CustomLink | pb.CustomLink | None = None, - interface_owner: str | Owner | pb.Owner | None = None, - interface_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + interface_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, priority: int | None = None, metadata: dict[str, Any] | None = None, ) -> pb.FHRPGroupAssignment: @@ -2528,9 +2638,6 @@ def __new__( interface_aggregate = convert_to_protobuf(interface_aggregate, pb.Aggregate) interface_cable = convert_to_protobuf(interface_cable, pb.Cable) interface_cable_path = convert_to_protobuf(interface_cable_path, pb.CablePath) - interface_cable_termination = convert_to_protobuf( - interface_cable_termination, pb.CableTermination - ) interface_circuit = convert_to_protobuf(interface_circuit, pb.Circuit) interface_circuit_group = convert_to_protobuf( interface_circuit_group, pb.CircuitGroup @@ -2567,6 +2674,15 @@ def __new__( interface_contact_role = convert_to_protobuf( interface_contact_role, pb.ContactRole ) + interface_custom_field = convert_to_protobuf( + interface_custom_field, pb.CustomField + ) + interface_custom_field_choice_set = convert_to_protobuf( + interface_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + interface_custom_link = convert_to_protobuf( + interface_custom_link, pb.CustomLink + ) interface_device = convert_to_protobuf(interface_device, pb.Device) interface_device_bay = convert_to_protobuf(interface_device_bay, pb.DeviceBay) interface_device_role = convert_to_protobuf( @@ -2602,6 +2718,9 @@ def __new__( interface_inventory_item_role = convert_to_protobuf( interface_inventory_item_role, pb.InventoryItemRole ) + interface_journal_entry = convert_to_protobuf( + interface_journal_entry, pb.JournalEntry + ) interface_l2vpn = convert_to_protobuf(interface_l2vpn, pb.L2VPN) interface_l2vpn_termination = convert_to_protobuf( interface_l2vpn_termination, pb.L2VPNTermination @@ -2618,6 +2737,13 @@ def __new__( interface_module_type = convert_to_protobuf( interface_module_type, pb.ModuleType ) + interface_module_type_profile = convert_to_protobuf( + interface_module_type_profile, pb.ModuleTypeProfile + ) + interface_owner = convert_to_protobuf(interface_owner, pb.Owner) + interface_owner_group = convert_to_protobuf( + interface_owner_group, pb.OwnerGroup + ) interface_platform = convert_to_protobuf(interface_platform, pb.Platform) interface_power_feed = convert_to_protobuf(interface_power_feed, pb.PowerFeed) interface_power_outlet = convert_to_protobuf( @@ -2705,25 +2831,6 @@ def __new__( interface_wireless_link = convert_to_protobuf( interface_wireless_link, pb.WirelessLink ) - interface_custom_field = convert_to_protobuf( - interface_custom_field, pb.CustomField - ) - interface_custom_field_choice_set = convert_to_protobuf( - interface_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - interface_journal_entry = convert_to_protobuf( - interface_journal_entry, pb.JournalEntry - ) - interface_module_type_profile = convert_to_protobuf( - interface_module_type_profile, pb.ModuleTypeProfile - ) - interface_custom_link = convert_to_protobuf( - interface_custom_link, pb.CustomLink - ) - interface_owner = convert_to_protobuf(interface_owner, pb.Owner) - interface_owner_group = convert_to_protobuf( - interface_owner_group, pb.OwnerGroup - ) metadata = convert_dict_to_struct(metadata) result = pb.FHRPGroupAssignment( group=group, @@ -2747,6 +2854,9 @@ def __new__( interface_contact_assignment=interface_contact_assignment, interface_contact_group=interface_contact_group, interface_contact_role=interface_contact_role, + interface_custom_field=interface_custom_field, + interface_custom_field_choice_set=interface_custom_field_choice_set, + interface_custom_link=interface_custom_link, interface_device=interface_device, interface_device_bay=interface_device_bay, interface_device_role=interface_device_role, @@ -2764,6 +2874,7 @@ def __new__( interface_interface=interface_interface, interface_inventory_item=interface_inventory_item, interface_inventory_item_role=interface_inventory_item_role, + interface_journal_entry=interface_journal_entry, interface_l2vpn=interface_l2vpn, interface_l2vpn_termination=interface_l2vpn_termination, interface_location=interface_location, @@ -2772,6 +2883,9 @@ def __new__( interface_module=interface_module, interface_module_bay=interface_module_bay, interface_module_type=interface_module_type, + interface_module_type_profile=interface_module_type_profile, + interface_owner=interface_owner, + interface_owner_group=interface_owner_group, interface_platform=interface_platform, interface_power_feed=interface_power_feed, interface_power_outlet=interface_power_outlet, @@ -2815,13 +2929,6 @@ def __new__( interface_wireless_lan=interface_wireless_lan, interface_wireless_lan_group=interface_wireless_lan_group, interface_wireless_link=interface_wireless_link, - interface_custom_field=interface_custom_field, - interface_custom_field_choice_set=interface_custom_field_choice_set, - interface_journal_entry=interface_journal_entry, - interface_module_type_profile=interface_module_type_profile, - interface_custom_link=interface_custom_link, - interface_owner=interface_owner, - interface_owner_group=interface_owner_group, priority=priority, metadata=metadata, ) @@ -2834,29 +2941,28 @@ class FrontPort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: Module | pb.Module | None = None, + module: str | Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, color: str | None = None, - rear_port: str | RearPort | pb.RearPort | None = None, - rear_port_position: int | None = None, + positions: int | None = None, description: str | None = None, mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - positions: int | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.FrontPort: """Create a new FrontPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - rear_port = convert_to_protobuf(rear_port, pb.RearPort) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.FrontPort( device=device, module=module, @@ -2864,15 +2970,13 @@ def __new__( label=label, type=type, color=color, - rear_port=rear_port, - rear_port_position=rear_port_position, + positions=positions, description=description, mark_connected=mark_connected, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - positions=positions, - owner=owner, ) return result @@ -2884,17 +2988,19 @@ def __new__( cls, object_asn: str | ASN | pb.ASN | None = None, object_asn_range: str | ASNRange | pb.ASNRange | None = None, - object_aggregate: Aggregate | pb.Aggregate | None = None, - object_cable: Cable | pb.Cable | None = None, - object_cable_path: CablePath | pb.CablePath | None = None, - object_cable_termination: CableTermination | pb.CableTermination | None = None, + object_aggregate: str | Aggregate | pb.Aggregate | None = None, + object_cable: str | Cable | pb.Cable | None = None, + object_cable_path: str | CablePath | pb.CablePath | None = None, + object_cable_termination: ( + str | CableTermination | pb.CableTermination | None + ) = None, object_circuit: str | Circuit | pb.Circuit | None = None, object_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, object_circuit_group_assignment: ( - CircuitGroupAssignment | pb.CircuitGroupAssignment | None + str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, object_circuit_termination: ( - CircuitTermination | pb.CircuitTermination | None + str | CircuitTermination | pb.CircuitTermination | None ) = None, object_circuit_type: str | CircuitType | pb.CircuitType | None = None, object_cluster: str | Cluster | pb.Cluster | None = None, @@ -2906,23 +3012,28 @@ def __new__( ) = None, object_contact: str | Contact | pb.Contact | None = None, object_contact_assignment: ( - ContactAssignment | pb.ContactAssignment | None + str | ContactAssignment | pb.ContactAssignment | None ) = None, object_contact_group: str | ContactGroup | pb.ContactGroup | None = None, object_contact_role: str | ContactRole | pb.ContactRole | None = None, + object_custom_field: str | CustomField | pb.CustomField | None = None, + object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + object_custom_link: str | CustomLink | pb.CustomLink | None = None, object_device: str | Device | pb.Device | None = None, object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, object_device_role: str | DeviceRole | pb.DeviceRole | None = None, object_device_type: str | DeviceType | pb.DeviceType | None = None, object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, object_fhrp_group_assignment: ( - FHRPGroupAssignment | pb.FHRPGroupAssignment | None + str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, object_front_port: str | FrontPort | pb.FrontPort | None = None, object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, object_ip_address: str | IPAddress | pb.IPAddress | None = None, - object_ip_range: IPRange | pb.IPRange | None = None, + object_ip_range: str | IPRange | pb.IPRange | None = None, object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, object_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, object_ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -2931,14 +3042,22 @@ def __new__( object_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, + object_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, object_l2vpn: str | L2VPN | pb.L2VPN | None = None, - object_l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, + object_l2vpn_termination: ( + str | L2VPNTermination | pb.L2VPNTermination | None + ) = None, object_location: str | Location | pb.Location | None = None, object_mac_address: str | MACAddress | pb.MACAddress | None = None, object_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - object_module: Module | pb.Module | None = None, + object_module: str | Module | pb.Module | None = None, object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, object_module_type: str | ModuleType | pb.ModuleType | None = None, + object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + object_owner: str | Owner | pb.Owner | None = None, + object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, object_platform: str | Platform | pb.Platform | None = None, object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -2954,7 +3073,9 @@ def __new__( ) = None, object_rir: str | RIR | pb.RIR | None = None, object_rack: str | Rack | pb.Rack | None = None, - object_rack_reservation: RackReservation | pb.RackReservation | None = None, + object_rack_reservation: ( + str | RackReservation | pb.RackReservation | None + ) = None, object_rack_role: str | RackRole | pb.RackRole | None = None, object_rack_type: str | RackType | pb.RackType | None = None, object_rear_port: str | RearPort | pb.RearPort | None = None, @@ -2970,7 +3091,7 @@ def __new__( object_tunnel: str | Tunnel | pb.Tunnel | None = None, object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, object_tunnel_termination: ( - TunnelTermination | pb.TunnelTermination | None + str | TunnelTermination | pb.TunnelTermination | None ) = None, object_vlan: str | VLAN | pb.VLAN | None = None, object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, @@ -2978,14 +3099,14 @@ def __new__( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, object_vlan_translation_rule: ( - VLANTranslationRule | pb.VLANTranslationRule | None + str | VLANTranslationRule | pb.VLANTranslationRule | None ) = None, object_vm_interface: str | VMInterface | pb.VMInterface | None = None, object_vrf: str | VRF | pb.VRF | None = None, object_virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, object_virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, object_virtual_circuit_termination: ( - VirtualCircuitTermination | pb.VirtualCircuitTermination | None + str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, object_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -2999,18 +3120,7 @@ def __new__( object_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - object_wireless_link: WirelessLink | pb.WirelessLink | None = None, - object_custom_field: str | CustomField | pb.CustomField | None = None, - object_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - object_journal_entry: JournalEntry | pb.JournalEntry | None = None, - object_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - object_custom_link: str | CustomLink | pb.CustomLink | None = None, - object_owner: str | Owner | pb.Owner | None = None, - object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + object_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, ) -> pb.GenericObject: """Create a new GenericObject.""" object_asn = convert_to_protobuf(object_asn, pb.ASN) @@ -3018,9 +3128,6 @@ def __new__( object_aggregate = convert_to_protobuf(object_aggregate, pb.Aggregate) object_cable = convert_to_protobuf(object_cable, pb.Cable) object_cable_path = convert_to_protobuf(object_cable_path, pb.CablePath) - object_cable_termination = convert_to_protobuf( - object_cable_termination, pb.CableTermination - ) object_circuit = convert_to_protobuf(object_circuit, pb.Circuit) object_circuit_group = convert_to_protobuf( object_circuit_group, pb.CircuitGroup @@ -3049,6 +3156,11 @@ def __new__( object_contact_group, pb.ContactGroup ) object_contact_role = convert_to_protobuf(object_contact_role, pb.ContactRole) + object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) + object_custom_field_choice_set = convert_to_protobuf( + object_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) object_device = convert_to_protobuf(object_device, pb.Device) object_device_bay = convert_to_protobuf(object_device_bay, pb.DeviceBay) object_device_role = convert_to_protobuf(object_device_role, pb.DeviceRole) @@ -3076,6 +3188,9 @@ def __new__( object_inventory_item_role = convert_to_protobuf( object_inventory_item_role, pb.InventoryItemRole ) + object_journal_entry = convert_to_protobuf( + object_journal_entry, pb.JournalEntry + ) object_l2vpn = convert_to_protobuf(object_l2vpn, pb.L2VPN) object_l2vpn_termination = convert_to_protobuf( object_l2vpn_termination, pb.L2VPNTermination @@ -3086,6 +3201,11 @@ def __new__( object_module = convert_to_protobuf(object_module, pb.Module) object_module_bay = convert_to_protobuf(object_module_bay, pb.ModuleBay) object_module_type = convert_to_protobuf(object_module_type, pb.ModuleType) + object_module_type_profile = convert_to_protobuf( + object_module_type_profile, pb.ModuleTypeProfile + ) + object_owner = convert_to_protobuf(object_owner, pb.Owner) + object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) object_platform = convert_to_protobuf(object_platform, pb.Platform) object_power_feed = convert_to_protobuf(object_power_feed, pb.PowerFeed) object_power_outlet = convert_to_protobuf(object_power_outlet, pb.PowerOutlet) @@ -3157,19 +3277,6 @@ def __new__( object_wireless_link = convert_to_protobuf( object_wireless_link, pb.WirelessLink ) - object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) - object_custom_field_choice_set = convert_to_protobuf( - object_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - object_journal_entry = convert_to_protobuf( - object_journal_entry, pb.JournalEntry - ) - object_module_type_profile = convert_to_protobuf( - object_module_type_profile, pb.ModuleTypeProfile - ) - object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) - object_owner = convert_to_protobuf(object_owner, pb.Owner) - object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) result = pb.GenericObject( object_asn=object_asn, object_asn_range=object_asn_range, @@ -3191,6 +3298,9 @@ def __new__( object_contact_assignment=object_contact_assignment, object_contact_group=object_contact_group, object_contact_role=object_contact_role, + object_custom_field=object_custom_field, + object_custom_field_choice_set=object_custom_field_choice_set, + object_custom_link=object_custom_link, object_device=object_device, object_device_bay=object_device_bay, object_device_role=object_device_role, @@ -3208,6 +3318,7 @@ def __new__( object_interface=object_interface, object_inventory_item=object_inventory_item, object_inventory_item_role=object_inventory_item_role, + object_journal_entry=object_journal_entry, object_l2vpn=object_l2vpn, object_l2vpn_termination=object_l2vpn_termination, object_location=object_location, @@ -3216,6 +3327,9 @@ def __new__( object_module=object_module, object_module_bay=object_module_bay, object_module_type=object_module_type, + object_module_type_profile=object_module_type_profile, + object_owner=object_owner, + object_owner_group=object_owner_group, object_platform=object_platform, object_power_feed=object_power_feed, object_power_outlet=object_power_outlet, @@ -3259,13 +3373,6 @@ def __new__( object_wireless_lan=object_wireless_lan, object_wireless_lan_group=object_wireless_lan_group, object_wireless_link=object_wireless_link, - object_custom_field=object_custom_field, - object_custom_field_choice_set=object_custom_field_choice_set, - object_journal_entry=object_journal_entry, - object_module_type_profile=object_module_type_profile, - object_custom_link=object_custom_link, - object_owner=object_owner, - object_owner_group=object_owner_group, ) return result @@ -3279,32 +3386,34 @@ def __new__( description: str | None = None, version: int | None = None, mode: str | None = None, + proposals: list[str | IKEProposal | pb.IKEProposal] | None = None, preshared_key: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - proposals: list[str | IKEProposal | pb.IKEProposal] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IKEPolicy: """Create a new IKEPolicy.""" + proposals = convert_to_protobuf_list(proposals, pb.IKEProposal) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - proposals = convert_to_protobuf_list(proposals, pb.IKEProposal) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IKEPolicy( name=name, description=description, version=version, mode=mode, + proposals=proposals, preshared_key=preshared_key, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, - proposals=proposals, metadata=metadata, - owner=owner, ) return result @@ -3321,17 +3430,19 @@ def __new__( authentication_algorithm: str | None = None, group: int | None = None, sa_lifetime: int | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IKEProposal: """Create a new IKEProposal.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IKEProposal( name=name, description=description, @@ -3340,11 +3451,11 @@ def __new__( authentication_algorithm=authentication_algorithm, group=group, sa_lifetime=sa_lifetime, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -3365,11 +3476,13 @@ def __new__( nat_inside: str | IPAddress | pb.IPAddress | None = None, dns_name: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, device_type: str | DeviceType | pb.DeviceType = None, @@ -3391,10 +3504,10 @@ def __new__( assigned_object_vm_interface, pb.VMInterface ) nat_inside = convert_to_protobuf(nat_inside, pb.IPAddress) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -3445,11 +3558,11 @@ def __new__( nat_inside=nat_inside, dns_name=dns_name, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -3466,22 +3579,24 @@ def __new__( status: str | None = None, role: str | Role | pb.Role | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - mark_utilized: bool | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, mark_populated: bool | None = None, + mark_utilized: bool | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IPRange: """Create a new IPRange.""" vrf = convert_to_protobuf(vrf, pb.VRF) tenant = convert_to_protobuf(tenant, pb.Tenant) role = convert_to_protobuf(role, pb.Role) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPRange( start_address=start_address, end_address=end_address, @@ -3490,13 +3605,13 @@ def __new__( status=status, role=role, description=description, + owner=owner, comments=comments, tags=tags, + mark_populated=mark_populated, mark_utilized=mark_utilized, custom_fields=custom_fields, - mark_populated=mark_populated, metadata=metadata, - owner=owner, ) return result @@ -3508,30 +3623,32 @@ def __new__( cls, name: str | None = None, description: str | None = None, + proposals: list[str | IPSecProposal | pb.IPSecProposal] | None = None, pfs_group: int | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - proposals: list[str | IPSecProposal | pb.IPSecProposal] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecPolicy: """Create a new IPSecPolicy.""" + proposals = convert_to_protobuf_list(proposals, pb.IPSecProposal) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - proposals = convert_to_protobuf_list(proposals, pb.IPSecProposal) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecPolicy( name=name, description=description, + proposals=proposals, pfs_group=pfs_group, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, - proposals=proposals, metadata=metadata, - owner=owner, ) return result @@ -3546,30 +3663,32 @@ def __new__( mode: str | None = None, ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, ipsec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecProfile: """Create a new IPSecProfile.""" ike_policy = convert_to_protobuf(ike_policy, pb.IKEPolicy) ipsec_policy = convert_to_protobuf(ipsec_policy, pb.IPSecPolicy) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecProfile( name=name, description=description, mode=mode, ike_policy=ike_policy, ipsec_policy=ipsec_policy, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -3585,17 +3704,19 @@ def __new__( authentication_algorithm: str | None = None, sa_lifetime_seconds: int | None = None, sa_lifetime_data: int | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecProposal: """Create a new IPSecProposal.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecProposal( name=name, description=description, @@ -3603,11 +3724,11 @@ def __new__( authentication_algorithm=authentication_algorithm, sa_lifetime_seconds=sa_lifetime_seconds, sa_lifetime_data=sa_lifetime_data, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -3618,7 +3739,8 @@ class Interface: def __new__( cls, device: str | Device | pb.Device | None = None, - module: Module | pb.Module | None = None, + vdcs: list[str | VirtualDeviceContext | pb.VirtualDeviceContext] | None = None, + module: str | Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, @@ -3642,19 +3764,20 @@ def __new__( rf_channel_width: float | None = None, tx_power: int | None = None, untagged_vlan: str | VLAN | pb.VLAN | None = None, + tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, qinq_svlan: str | VLAN | pb.VLAN | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, mark_connected: bool | None = None, + wireless_lans: list[str | WirelessLAN | pb.WirelessLAN] | None = None, vrf: str | VRF | pb.VRF | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - vdcs: list[str | VirtualDeviceContext | pb.VirtualDeviceContext] | None = None, - tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, - wireless_lans: list[str | WirelessLAN | pb.WirelessLAN] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, device_type: str | DeviceType | pb.DeviceType = None, @@ -3664,24 +3787,24 @@ def __new__( ) -> pb.Interface: """Create a new Interface.""" device = convert_to_protobuf(device, pb.Device) + vdcs = convert_to_protobuf_list(vdcs, pb.VirtualDeviceContext) module = convert_to_protobuf(module, pb.Module) parent = convert_to_protobuf(parent, pb.Interface) bridge = convert_to_protobuf(bridge, pb.Interface) lag = convert_to_protobuf(lag, pb.Interface) primary_mac_address = convert_to_protobuf(primary_mac_address, pb.MACAddress) untagged_vlan = convert_to_protobuf(untagged_vlan, pb.VLAN) + tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) vlan_translation_policy = convert_to_protobuf( vlan_translation_policy, pb.VLANTranslationPolicy ) + wireless_lans = convert_to_protobuf_list(wireless_lans, pb.WirelessLAN) vrf = convert_to_protobuf(vrf, pb.VRF) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - vdcs = convert_to_protobuf_list(vdcs, pb.VirtualDeviceContext) - tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) - wireless_lans = convert_to_protobuf_list(wireless_lans, pb.WirelessLAN) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -3710,6 +3833,7 @@ def __new__( device.role.CopyFrom(role) result = pb.Interface( device=device, + vdcs=vdcs, module=module, name=name, label=label, @@ -3734,17 +3858,16 @@ def __new__( rf_channel_width=rf_channel_width, tx_power=tx_power, untagged_vlan=untagged_vlan, + tagged_vlans=tagged_vlans, qinq_svlan=qinq_svlan, vlan_translation_policy=vlan_translation_policy, mark_connected=mark_connected, + wireless_lans=wireless_lans, vrf=vrf, + owner=owner, tags=tags, custom_fields=custom_fields, - vdcs=vdcs, - tagged_vlans=tagged_vlans, - wireless_lans=wireless_lans, metadata=metadata, - owner=owner, ) return result @@ -3775,10 +3898,12 @@ def __new__( component_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, component_power_port: str | PowerPort | pb.PowerPort | None = None, component_rear_port: str | RearPort | pb.RearPort | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, ) -> pb.InventoryItem: """Create a new InventoryItem.""" device = convert_to_protobuf(device, pb.Device) @@ -3798,10 +3923,10 @@ def __new__( ) component_power_port = convert_to_protobuf(component_power_port, pb.PowerPort) component_rear_port = convert_to_protobuf(component_rear_port, pb.RearPort) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.InventoryItem( device=device, parent=parent, @@ -3822,10 +3947,10 @@ def __new__( component_power_outlet=component_power_outlet, component_power_port=component_power_port, component_rear_port=component_rear_port, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result @@ -3839,104 +3964,55 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, ) -> pb.InventoryItemRole: """Create a new InventoryItemRole.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) result = pb.InventoryItemRole( name=name, slug=slug, color=color, description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, owner=owner, comments=comments, - ) - return result - - -class L2VPN: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPN.""" - - def __new__( - cls, - identifier: int | None = None, - name: str | None = None, - slug: str | None = None, - type: str | None = None, - description: str | None = None, - comments: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - status: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.L2VPN: - """Create a new L2VPN.""" - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) - export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.L2VPN( - identifier=identifier, - name=name, - slug=slug, - type=type, - description=description, - comments=comments, - tenant=tenant, tags=tags, custom_fields=custom_fields, - import_targets=import_targets, - export_targets=export_targets, - status=status, metadata=metadata, - owner=owner, ) return result -class L2VPNTermination: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPNTermination.""" +class JournalEntry: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.JournalEntry.""" def __new__( cls, - l2vpn: str | L2VPN | pb.L2VPN | None = None, - assigned_object_interface: str | Interface | pb.Interface | None = None, - assigned_object_vlan: str | VLAN | pb.VLAN | None = None, - assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, assigned_object_asn: str | ASN | pb.ASN | None = None, assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, - assigned_object_aggregate: Aggregate | pb.Aggregate | None = None, - assigned_object_cable: Cable | pb.Cable | None = None, - assigned_object_cable_path: CablePath | pb.CablePath | None = None, + assigned_object_aggregate: str | Aggregate | pb.Aggregate | None = None, + assigned_object_cable: str | Cable | pb.Cable | None = None, + assigned_object_cable_path: str | CablePath | pb.CablePath | None = None, assigned_object_cable_termination: ( - CableTermination | pb.CableTermination | None + str | CableTermination | pb.CableTermination | None ) = None, assigned_object_circuit: str | Circuit | pb.Circuit | None = None, assigned_object_circuit_group: ( str | CircuitGroup | pb.CircuitGroup | None ) = None, assigned_object_circuit_group_assignment: ( - CircuitGroupAssignment | pb.CircuitGroupAssignment | None + str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, assigned_object_circuit_termination: ( - CircuitTermination | pb.CircuitTermination | None + str | CircuitTermination | pb.CircuitTermination | None ) = None, assigned_object_circuit_type: str | CircuitType | pb.CircuitType | None = None, assigned_object_cluster: str | Cluster | pb.Cluster | None = None, @@ -3950,7 +4026,7 @@ def __new__( ) = None, assigned_object_contact: str | Contact | pb.Contact | None = None, assigned_object_contact_assignment: ( - ContactAssignment | pb.ContactAssignment | None + str | ContactAssignment | pb.ContactAssignment | None ) = None, assigned_object_contact_group: ( str | ContactGroup | pb.ContactGroup | None @@ -3960,19 +4036,20 @@ def __new__( assigned_object_custom_field_choice_set: ( str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None ) = None, + assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, assigned_object_device: str | Device | pb.Device | None = None, assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, assigned_object_device_type: str | DeviceType | pb.DeviceType | None = None, assigned_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, assigned_object_fhrp_group_assignment: ( - FHRPGroupAssignment | pb.FHRPGroupAssignment | None + str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, assigned_object_front_port: str | FrontPort | pb.FrontPort | None = None, assigned_object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, assigned_object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, assigned_object_ip_address: str | IPAddress | pb.IPAddress | None = None, - assigned_object_ip_range: IPRange | pb.IPRange | None = None, + assigned_object_ip_range: str | IPRange | pb.IPRange | None = None, assigned_object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, assigned_object_ip_sec_profile: ( str | IPSecProfile | pb.IPSecProfile | None @@ -3980,28 +4057,33 @@ def __new__( assigned_object_ip_sec_proposal: ( str | IPSecProposal | pb.IPSecProposal | None ) = None, + assigned_object_interface: str | Interface | pb.Interface | None = None, assigned_object_inventory_item: ( str | InventoryItem | pb.InventoryItem | None ) = None, assigned_object_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - assigned_object_journal_entry: JournalEntry | pb.JournalEntry | None = None, + assigned_object_journal_entry: ( + str | JournalEntry | pb.JournalEntry | None + ) = None, assigned_object_l2vpn: str | L2VPN | pb.L2VPN | None = None, assigned_object_l2vpn_termination: ( - L2VPNTermination | pb.L2VPNTermination | None + str | L2VPNTermination | pb.L2VPNTermination | None ) = None, assigned_object_location: str | Location | pb.Location | None = None, assigned_object_mac_address: str | MACAddress | pb.MACAddress | None = None, assigned_object_manufacturer: ( str | Manufacturer | pb.Manufacturer | None ) = None, - assigned_object_module: Module | pb.Module | None = None, + assigned_object_module: str | Module | pb.Module | None = None, assigned_object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, assigned_object_module_type: str | ModuleType | pb.ModuleType | None = None, assigned_object_module_type_profile: ( str | ModuleTypeProfile | pb.ModuleTypeProfile | None ) = None, + assigned_object_owner: str | Owner | pb.Owner | None = None, + assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, assigned_object_platform: str | Platform | pb.Platform | None = None, assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -4018,7 +4100,7 @@ def __new__( assigned_object_rir: str | RIR | pb.RIR | None = None, assigned_object_rack: str | Rack | pb.Rack | None = None, assigned_object_rack_reservation: ( - RackReservation | pb.RackReservation | None + str | RackReservation | pb.RackReservation | None ) = None, assigned_object_rack_role: str | RackRole | pb.RackRole | None = None, assigned_object_rack_type: str | RackType | pb.RackType | None = None, @@ -4035,15 +4117,17 @@ def __new__( assigned_object_tunnel: str | Tunnel | pb.Tunnel | None = None, assigned_object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, assigned_object_tunnel_termination: ( - TunnelTermination | pb.TunnelTermination | None + str | TunnelTermination | pb.TunnelTermination | None ) = None, + assigned_object_vlan: str | VLAN | pb.VLAN | None = None, assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, assigned_object_vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, assigned_object_vlan_translation_rule: ( - VLANTranslationRule | pb.VLANTranslationRule | None + str | VLANTranslationRule | pb.VLANTranslationRule | None ) = None, + assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, assigned_object_vrf: str | VRF | pb.VRF | None = None, assigned_object_virtual_chassis: ( str | VirtualChassis | pb.VirtualChassis | None @@ -4052,7 +4136,7 @@ def __new__( str | VirtualCircuit | pb.VirtualCircuit | None ) = None, assigned_object_virtual_circuit_termination: ( - VirtualCircuitTermination | pb.VirtualCircuitTermination | None + str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, assigned_object_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -4068,23 +4152,18 @@ def __new__( assigned_object_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - assigned_object_wireless_link: WirelessLink | pb.WirelessLink | None = None, - assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, - assigned_object_owner: str | Owner | pb.Owner | None = None, - assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + assigned_object_wireless_link: ( + str | WirelessLink | pb.WirelessLink | None + ) = None, + kind: str | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.L2VPNTermination: - """Create a new L2VPNTermination.""" - l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) - assigned_object_interface = convert_to_protobuf( - assigned_object_interface, pb.Interface - ) - assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface - ) + ) -> pb.JournalEntry: + """Create a new JournalEntry.""" assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) assigned_object_asn_range = convert_to_protobuf( assigned_object_asn_range, pb.ASNRange @@ -4096,9 +4175,6 @@ def __new__( assigned_object_cable_path = convert_to_protobuf( assigned_object_cable_path, pb.CablePath ) - assigned_object_cable_termination = convert_to_protobuf( - assigned_object_cable_termination, pb.CableTermination - ) assigned_object_circuit = convert_to_protobuf( assigned_object_circuit, pb.Circuit ) @@ -4147,6 +4223,9 @@ def __new__( assigned_object_custom_field_choice_set = convert_to_protobuf( assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet ) + assigned_object_custom_link = convert_to_protobuf( + assigned_object_custom_link, pb.CustomLink + ) assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) assigned_object_device_bay = convert_to_protobuf( assigned_object_device_bay, pb.DeviceBay @@ -4187,6 +4266,9 @@ def __new__( assigned_object_ip_sec_proposal = convert_to_protobuf( assigned_object_ip_sec_proposal, pb.IPSecProposal ) + assigned_object_interface = convert_to_protobuf( + assigned_object_interface, pb.Interface + ) assigned_object_inventory_item = convert_to_protobuf( assigned_object_inventory_item, pb.InventoryItem ) @@ -4219,6 +4301,10 @@ def __new__( assigned_object_module_type_profile = convert_to_protobuf( assigned_object_module_type_profile, pb.ModuleTypeProfile ) + assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) + assigned_object_owner_group = convert_to_protobuf( + assigned_object_owner_group, pb.OwnerGroup + ) assigned_object_platform = convert_to_protobuf( assigned_object_platform, pb.Platform ) @@ -4282,6 +4368,7 @@ def __new__( assigned_object_tunnel_termination = convert_to_protobuf( assigned_object_tunnel_termination, pb.TunnelTermination ) + assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) assigned_object_vlan_group = convert_to_protobuf( assigned_object_vlan_group, pb.VLANGroup ) @@ -4291,6 +4378,9 @@ def __new__( assigned_object_vlan_translation_rule = convert_to_protobuf( assigned_object_vlan_translation_rule, pb.VLANTranslationRule ) + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface + ) assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) assigned_object_virtual_chassis = convert_to_protobuf( assigned_object_virtual_chassis, pb.VirtualChassis @@ -4322,21 +4412,10 @@ def __new__( assigned_object_wireless_link = convert_to_protobuf( assigned_object_wireless_link, pb.WirelessLink ) - assigned_object_custom_link = convert_to_protobuf( - assigned_object_custom_link, pb.CustomLink - ) - assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) - assigned_object_owner_group = convert_to_protobuf( - assigned_object_owner_group, pb.OwnerGroup - ) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.L2VPNTermination( - l2vpn=l2vpn, - assigned_object_interface=assigned_object_interface, - assigned_object_vlan=assigned_object_vlan, - assigned_object_vm_interface=assigned_object_vm_interface, + result = pb.JournalEntry( assigned_object_asn=assigned_object_asn, assigned_object_asn_range=assigned_object_asn_range, assigned_object_aggregate=assigned_object_aggregate, @@ -4359,6 +4438,7 @@ def __new__( assigned_object_contact_role=assigned_object_contact_role, assigned_object_custom_field=assigned_object_custom_field, assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, + assigned_object_custom_link=assigned_object_custom_link, assigned_object_device=assigned_object_device, assigned_object_device_bay=assigned_object_device_bay, assigned_object_device_role=assigned_object_device_role, @@ -4373,6 +4453,7 @@ def __new__( assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, + assigned_object_interface=assigned_object_interface, assigned_object_inventory_item=assigned_object_inventory_item, assigned_object_inventory_item_role=assigned_object_inventory_item_role, assigned_object_journal_entry=assigned_object_journal_entry, @@ -4385,6 +4466,8 @@ def __new__( assigned_object_module_bay=assigned_object_module_bay, assigned_object_module_type=assigned_object_module_type, assigned_object_module_type_profile=assigned_object_module_type_profile, + assigned_object_owner=assigned_object_owner, + assigned_object_owner_group=assigned_object_owner_group, assigned_object_platform=assigned_object_platform, assigned_object_power_feed=assigned_object_power_feed, assigned_object_power_outlet=assigned_object_power_outlet, @@ -4412,9 +4495,11 @@ def __new__( assigned_object_tunnel=assigned_object_tunnel, assigned_object_tunnel_group=assigned_object_tunnel_group, assigned_object_tunnel_termination=assigned_object_tunnel_termination, + assigned_object_vlan=assigned_object_vlan, assigned_object_vlan_group=assigned_object_vlan_group, assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, + assigned_object_vm_interface=assigned_object_vm_interface, assigned_object_vrf=assigned_object_vrf, assigned_object_virtual_chassis=assigned_object_virtual_chassis, assigned_object_virtual_circuit=assigned_object_virtual_circuit, @@ -4426,9 +4511,8 @@ def __new__( assigned_object_wireless_lan=assigned_object_wireless_lan, assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, assigned_object_wireless_link=assigned_object_wireless_link, - assigned_object_custom_link=assigned_object_custom_link, - assigned_object_owner=assigned_object_owner, - assigned_object_owner_group=assigned_object_owner_group, + kind=kind, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, @@ -4436,1847 +4520,1142 @@ def __new__( return result -class Location: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Location.""" +class L2VPN: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPN.""" def __new__( cls, + identifier: int | None = None, name: str | None = None, slug: str | None = None, - site: str | Site | pb.Site | None = None, - parent: str | Location | pb.Location | None = None, + type: str | None = None, status: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - facility: str | None = None, + import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, + export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Location: - """Create a new Location.""" - site = convert_to_protobuf(site, pb.Site) - parent = convert_to_protobuf(parent, pb.Location) + ) -> pb.L2VPN: + """Create a new L2VPN.""" + import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) + export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) + owner = convert_to_protobuf(owner, pb.Owner) tenant = convert_to_protobuf(tenant, pb.Tenant) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Location( + result = pb.L2VPN( + identifier=identifier, name=name, slug=slug, - site=site, - parent=parent, + type=type, status=status, - tenant=tenant, - facility=facility, + import_targets=import_targets, + export_targets=export_targets, description=description, + owner=owner, + comments=comments, + tenant=tenant, tags=tags, custom_fields=custom_fields, - comments=comments, metadata=metadata, - owner=owner, ) return result -class MACAddress: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.MACAddress.""" +class L2VPNTermination: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPNTermination.""" def __new__( cls, - mac_address: str | None = None, - assigned_object_interface: str | Interface | pb.Interface | None = None, - assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, - description: str | None = None, - comments: str | None = None, + l2vpn: str | L2VPN | pb.L2VPN | None = None, + assigned_object_asn: str | ASN | pb.ASN | None = None, + assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, + assigned_object_aggregate: str | Aggregate | pb.Aggregate | None = None, + assigned_object_cable: str | Cable | pb.Cable | None = None, + assigned_object_cable_path: str | CablePath | pb.CablePath | None = None, + assigned_object_cable_termination: ( + str | CableTermination | pb.CableTermination | None + ) = None, + assigned_object_circuit: str | Circuit | pb.Circuit | None = None, + assigned_object_circuit_group: ( + str | CircuitGroup | pb.CircuitGroup | None + ) = None, + assigned_object_circuit_group_assignment: ( + str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + ) = None, + assigned_object_circuit_termination: ( + str | CircuitTermination | pb.CircuitTermination | None + ) = None, + assigned_object_circuit_type: str | CircuitType | pb.CircuitType | None = None, + assigned_object_cluster: str | Cluster | pb.Cluster | None = None, + assigned_object_cluster_group: ( + str | ClusterGroup | pb.ClusterGroup | None + ) = None, + assigned_object_cluster_type: str | ClusterType | pb.ClusterType | None = None, + assigned_object_console_port: str | ConsolePort | pb.ConsolePort | None = None, + assigned_object_console_server_port: ( + str | ConsoleServerPort | pb.ConsoleServerPort | None + ) = None, + assigned_object_contact: str | Contact | pb.Contact | None = None, + assigned_object_contact_assignment: ( + str | ContactAssignment | pb.ContactAssignment | None + ) = None, + assigned_object_contact_group: ( + str | ContactGroup | pb.ContactGroup | None + ) = None, + assigned_object_contact_role: str | ContactRole | pb.ContactRole | None = None, + assigned_object_custom_field: str | CustomField | pb.CustomField | None = None, + assigned_object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, + assigned_object_device: str | Device | pb.Device | None = None, + assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, + assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, + assigned_object_device_type: str | DeviceType | pb.DeviceType | None = None, + assigned_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, + assigned_object_fhrp_group_assignment: ( + str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + ) = None, + assigned_object_front_port: str | FrontPort | pb.FrontPort | None = None, + assigned_object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, + assigned_object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, + assigned_object_ip_address: str | IPAddress | pb.IPAddress | None = None, + assigned_object_ip_range: str | IPRange | pb.IPRange | None = None, + assigned_object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, + assigned_object_ip_sec_profile: ( + str | IPSecProfile | pb.IPSecProfile | None + ) = None, + assigned_object_ip_sec_proposal: ( + str | IPSecProposal | pb.IPSecProposal | None + ) = None, + assigned_object_interface: str | Interface | pb.Interface | None = None, + assigned_object_inventory_item: ( + str | InventoryItem | pb.InventoryItem | None + ) = None, + assigned_object_inventory_item_role: ( + str | InventoryItemRole | pb.InventoryItemRole | None + ) = None, + assigned_object_journal_entry: ( + str | JournalEntry | pb.JournalEntry | None + ) = None, + assigned_object_l2vpn: str | L2VPN | pb.L2VPN | None = None, + assigned_object_l2vpn_termination: ( + str | L2VPNTermination | pb.L2VPNTermination | None + ) = None, + assigned_object_location: str | Location | pb.Location | None = None, + assigned_object_mac_address: str | MACAddress | pb.MACAddress | None = None, + assigned_object_manufacturer: ( + str | Manufacturer | pb.Manufacturer | None + ) = None, + assigned_object_module: str | Module | pb.Module | None = None, + assigned_object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, + assigned_object_module_type: str | ModuleType | pb.ModuleType | None = None, + assigned_object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + assigned_object_owner: str | Owner | pb.Owner | None = None, + assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + assigned_object_platform: str | Platform | pb.Platform | None = None, + assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, + assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, + assigned_object_power_panel: str | PowerPanel | pb.PowerPanel | None = None, + assigned_object_power_port: str | PowerPort | pb.PowerPort | None = None, + assigned_object_prefix: str | Prefix | pb.Prefix | None = None, + assigned_object_provider: str | Provider | pb.Provider | None = None, + assigned_object_provider_account: ( + str | ProviderAccount | pb.ProviderAccount | None + ) = None, + assigned_object_provider_network: ( + str | ProviderNetwork | pb.ProviderNetwork | None + ) = None, + assigned_object_rir: str | RIR | pb.RIR | None = None, + assigned_object_rack: str | Rack | pb.Rack | None = None, + assigned_object_rack_reservation: ( + str | RackReservation | pb.RackReservation | None + ) = None, + assigned_object_rack_role: str | RackRole | pb.RackRole | None = None, + assigned_object_rack_type: str | RackType | pb.RackType | None = None, + assigned_object_rear_port: str | RearPort | pb.RearPort | None = None, + assigned_object_region: str | Region | pb.Region | None = None, + assigned_object_role: str | Role | pb.Role | None = None, + assigned_object_route_target: str | RouteTarget | pb.RouteTarget | None = None, + assigned_object_service: str | Service | pb.Service | None = None, + assigned_object_site: str | Site | pb.Site | None = None, + assigned_object_site_group: str | SiteGroup | pb.SiteGroup | None = None, + assigned_object_tag: str | Tag | pb.Tag | None = None, + assigned_object_tenant: str | Tenant | pb.Tenant | None = None, + assigned_object_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, + assigned_object_tunnel: str | Tunnel | pb.Tunnel | None = None, + assigned_object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, + assigned_object_tunnel_termination: ( + str | TunnelTermination | pb.TunnelTermination | None + ) = None, + assigned_object_vlan: str | VLAN | pb.VLAN | None = None, + assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, + assigned_object_vlan_translation_policy: ( + str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None + ) = None, + assigned_object_vlan_translation_rule: ( + str | VLANTranslationRule | pb.VLANTranslationRule | None + ) = None, + assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, + assigned_object_vrf: str | VRF | pb.VRF | None = None, + assigned_object_virtual_chassis: ( + str | VirtualChassis | pb.VirtualChassis | None + ) = None, + assigned_object_virtual_circuit: ( + str | VirtualCircuit | pb.VirtualCircuit | None + ) = None, + assigned_object_virtual_circuit_termination: ( + str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + ) = None, + assigned_object_virtual_circuit_type: ( + str | VirtualCircuitType | pb.VirtualCircuitType | None + ) = None, + assigned_object_virtual_device_context: ( + str | VirtualDeviceContext | pb.VirtualDeviceContext | None + ) = None, + assigned_object_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, + assigned_object_virtual_machine: ( + str | VirtualMachine | pb.VirtualMachine | None + ) = None, + assigned_object_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, + assigned_object_wireless_lan_group: ( + str | WirelessLANGroup | pb.WirelessLANGroup | None + ) = None, + assigned_object_wireless_link: ( + str | WirelessLink | pb.WirelessLink | None + ) = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.MACAddress: - """Create a new MACAddress.""" - assigned_object_interface = convert_to_protobuf( - assigned_object_interface, pb.Interface + ) -> pb.L2VPNTermination: + """Create a new L2VPNTermination.""" + l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) + assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) + assigned_object_asn_range = convert_to_protobuf( + assigned_object_asn_range, pb.ASNRange ) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface + assigned_object_aggregate = convert_to_protobuf( + assigned_object_aggregate, pb.Aggregate ) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.MACAddress( - mac_address=mac_address, - assigned_object_interface=assigned_object_interface, - assigned_object_vm_interface=assigned_object_vm_interface, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, + assigned_object_cable = convert_to_protobuf(assigned_object_cable, pb.Cable) + assigned_object_cable_path = convert_to_protobuf( + assigned_object_cable_path, pb.CablePath ) - return result - - -class Manufacturer: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Manufacturer.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.Manufacturer: - """Create a new Manufacturer.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Manufacturer( - name=name, - slug=slug, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - comments=comments, + assigned_object_circuit = convert_to_protobuf( + assigned_object_circuit, pb.Circuit ) - return result - - -class Module: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Module.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - module_bay: str | ModuleBay | pb.ModuleBay | None = None, - module_type: str | ModuleType | pb.ModuleType | None = None, - status: str | None = None, - serial: str | None = None, - asset_tag: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Module: - """Create a new Module.""" - device = convert_to_protobuf(device, pb.Device) - module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) - module_type = convert_to_protobuf(module_type, pb.ModuleType) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Module( - device=device, - module_bay=module_bay, - module_type=module_type, - status=status, - serial=serial, - asset_tag=asset_tag, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, + assigned_object_circuit_group = convert_to_protobuf( + assigned_object_circuit_group, pb.CircuitGroup ) - return result - - -class ModuleBay: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleBay.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - module: Module | pb.Module | None = None, - name: str | None = None, - installed_module: Module | pb.Module | None = None, - label: str | None = None, - position: str | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.ModuleBay: - """Create a new ModuleBay.""" - device = convert_to_protobuf(device, pb.Device) - module = convert_to_protobuf(module, pb.Module) - installed_module = convert_to_protobuf(installed_module, pb.Module) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.ModuleBay( - device=device, - module=module, - name=name, - installed_module=installed_module, - label=label, - position=position, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class ModuleType: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleType.""" - - def __new__( - cls, - manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - model: str | None = None, - part_number: str | None = None, - airflow: str | None = None, - weight: float | None = None, - weight_unit: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - profile: str | ModuleTypeProfile | pb.ModuleTypeProfile | None = None, - attributes: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.ModuleType: - """Create a new ModuleType.""" - manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - profile = convert_to_protobuf(profile, pb.ModuleTypeProfile) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.ModuleType( - manufacturer=manufacturer, - model=model, - part_number=part_number, - airflow=airflow, - weight=weight, - weight_unit=weight_unit, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - profile=profile, - attributes=attributes, - metadata=metadata, - owner=owner, - ) - return result - - -class Platform: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Platform.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - parent: str | Platform | pb.Platform | None = None, - comments: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Platform: - """Create a new Platform.""" - manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - parent = convert_to_protobuf(parent, pb.Platform) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Platform( - name=name, - slug=slug, - manufacturer=manufacturer, - description=description, - tags=tags, - custom_fields=custom_fields, - parent=parent, - comments=comments, - metadata=metadata, - owner=owner, - ) - return result - - -class PowerFeed: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerFeed.""" - - def __new__( - cls, - power_panel: str | PowerPanel | pb.PowerPanel | None = None, - rack: str | Rack | pb.Rack | None = None, - name: str | None = None, - status: str | None = None, - type: str | None = None, - supply: str | None = None, - phase: str | None = None, - voltage: int | None = None, - amperage: int | None = None, - max_utilization: int | None = None, - mark_connected: bool | None = None, - description: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.PowerFeed: - """Create a new PowerFeed.""" - power_panel = convert_to_protobuf(power_panel, pb.PowerPanel) - rack = convert_to_protobuf(rack, pb.Rack) - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.PowerFeed( - power_panel=power_panel, - rack=rack, - name=name, - status=status, - type=type, - supply=supply, - phase=phase, - voltage=voltage, - amperage=amperage, - max_utilization=max_utilization, - mark_connected=mark_connected, - description=description, - tenant=tenant, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class PowerOutlet: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerOutlet.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - module: Module | pb.Module | None = None, - name: str | None = None, - label: str | None = None, - type: str | None = None, - color: str | None = None, - power_port: str | PowerPort | pb.PowerPort | None = None, - feed_leg: str | None = None, - description: str | None = None, - mark_connected: bool | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - status: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.PowerOutlet: - """Create a new PowerOutlet.""" - device = convert_to_protobuf(device, pb.Device) - module = convert_to_protobuf(module, pb.Module) - power_port = convert_to_protobuf(power_port, pb.PowerPort) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.PowerOutlet( - device=device, - module=module, - name=name, - label=label, - type=type, - color=color, - power_port=power_port, - feed_leg=feed_leg, - description=description, - mark_connected=mark_connected, - tags=tags, - custom_fields=custom_fields, - status=status, - metadata=metadata, - owner=owner, - ) - return result - - -class PowerPanel: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerPanel.""" - - def __new__( - cls, - site: str | Site | pb.Site | None = None, - location: str | Location | pb.Location | None = None, - name: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.PowerPanel: - """Create a new PowerPanel.""" - site = convert_to_protobuf(site, pb.Site) - location = convert_to_protobuf(location, pb.Location) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.PowerPanel( - site=site, - location=location, - name=name, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class PowerPort: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerPort.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - module: Module | pb.Module | None = None, - name: str | None = None, - label: str | None = None, - type: str | None = None, - maximum_draw: int | None = None, - allocated_draw: int | None = None, - description: str | None = None, - mark_connected: bool | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.PowerPort: - """Create a new PowerPort.""" - device = convert_to_protobuf(device, pb.Device) - module = convert_to_protobuf(module, pb.Module) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.PowerPort( - device=device, - module=module, - name=name, - label=label, - type=type, - maximum_draw=maximum_draw, - allocated_draw=allocated_draw, - description=description, - mark_connected=mark_connected, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class Prefix: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Prefix.""" - - def __new__( - cls, - prefix: str | None = None, - vrf: str | VRF | pb.VRF | None = None, - scope_location: str | Location | pb.Location | None = None, - scope_region: str | Region | pb.Region | None = None, - scope_site: str | Site | pb.Site | None = None, - scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - vlan: str | VLAN | pb.VLAN | None = None, - status: str | None = None, - role: str | Role | pb.Role | None = None, - is_pool: bool | None = None, - mark_utilized: bool | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Prefix: - """Create a new Prefix.""" - vrf = convert_to_protobuf(vrf, pb.VRF) - scope_location = convert_to_protobuf(scope_location, pb.Location) - scope_region = convert_to_protobuf(scope_region, pb.Region) - scope_site = convert_to_protobuf(scope_site, pb.Site) - scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) - tenant = convert_to_protobuf(tenant, pb.Tenant) - vlan = convert_to_protobuf(vlan, pb.VLAN) - role = convert_to_protobuf(role, pb.Role) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Prefix( - prefix=prefix, - vrf=vrf, - scope_location=scope_location, - scope_region=scope_region, - scope_site=scope_site, - scope_site_group=scope_site_group, - tenant=tenant, - vlan=vlan, - status=status, - role=role, - is_pool=is_pool, - mark_utilized=mark_utilized, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class Provider: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Provider.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - accounts: list[str | ProviderAccount | pb.ProviderAccount] | None = None, - asns: list[str | ASN | pb.ASN] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Provider: - """Create a new Provider.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - accounts = convert_to_protobuf_list(accounts, pb.ProviderAccount) - asns = convert_to_protobuf_list(asns, pb.ASN) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Provider( - name=name, - slug=slug, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - accounts=accounts, - asns=asns, - metadata=metadata, - owner=owner, - ) - return result - - -class ProviderAccount: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ProviderAccount.""" - - def __new__( - cls, - provider: str | Provider | pb.Provider | None = None, - name: str | None = None, - account: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.ProviderAccount: - """Create a new ProviderAccount.""" - provider = convert_to_protobuf(provider, pb.Provider) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.ProviderAccount( - provider=provider, - name=name, - account=account, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - ) - return result - - -class ProviderNetwork: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ProviderNetwork.""" - - def __new__( - cls, - provider: str | Provider | pb.Provider | None = None, - name: str | None = None, - service_id: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.ProviderNetwork: - """Create a new ProviderNetwork.""" - provider = convert_to_protobuf(provider, pb.Provider) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.ProviderNetwork( - provider=provider, - name=name, - service_id=service_id, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, + assigned_object_circuit_group_assignment = convert_to_protobuf( + assigned_object_circuit_group_assignment, pb.CircuitGroupAssignment ) - return result - - -class RIR: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RIR.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - is_private: bool | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.RIR: - """Create a new RIR.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RIR( - name=name, - slug=slug, - is_private=is_private, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - comments=comments, + assigned_object_circuit_termination = convert_to_protobuf( + assigned_object_circuit_termination, pb.CircuitTermination ) - return result - - -class Rack: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Rack.""" - - def __new__( - cls, - name: str | None = None, - facility_id: str | None = None, - site: str | Site | pb.Site | None = None, - location: str | Location | pb.Location | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - status: str | None = None, - role: str | RackRole | pb.RackRole | None = None, - serial: str | None = None, - asset_tag: str | None = None, - rack_type: str | RackType | pb.RackType | None = None, - form_factor: str | None = None, - width: int | None = None, - u_height: int | None = None, - starting_unit: int | None = None, - weight: float | None = None, - max_weight: int | None = None, - weight_unit: str | None = None, - desc_units: bool | None = None, - outer_width: int | None = None, - outer_depth: int | None = None, - outer_unit: str | None = None, - mounting_depth: int | None = None, - airflow: str | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - outer_height: int | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Rack: - """Create a new Rack.""" - site = convert_to_protobuf(site, pb.Site) - location = convert_to_protobuf(location, pb.Location) - tenant = convert_to_protobuf(tenant, pb.Tenant) - role = convert_to_protobuf(role, pb.RackRole) - rack_type = convert_to_protobuf(rack_type, pb.RackType) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Rack( - name=name, - facility_id=facility_id, - site=site, - location=location, - tenant=tenant, - status=status, - role=role, - serial=serial, - asset_tag=asset_tag, - rack_type=rack_type, - form_factor=form_factor, - width=width, - u_height=u_height, - starting_unit=starting_unit, - weight=weight, - max_weight=max_weight, - weight_unit=weight_unit, - desc_units=desc_units, - outer_width=outer_width, - outer_depth=outer_depth, - outer_unit=outer_unit, - mounting_depth=mounting_depth, - airflow=airflow, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - outer_height=outer_height, - metadata=metadata, - owner=owner, + assigned_object_circuit_type = convert_to_protobuf( + assigned_object_circuit_type, pb.CircuitType ) - return result - - -class RackReservation: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackReservation.""" - - def __new__( - cls, - rack: str | Rack | pb.Rack | None = None, - units: list[int] | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - status: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.RackReservation: - """Create a new RackReservation.""" - rack = convert_to_protobuf(rack, pb.Rack) - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RackReservation( - rack=rack, - units=units, - tenant=tenant, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - status=status, - metadata=metadata, - owner=owner, + assigned_object_cluster = convert_to_protobuf( + assigned_object_cluster, pb.Cluster ) - return result - - -class RackRole: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackRole.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - color: str | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.RackRole: - """Create a new RackRole.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RackRole( - name=name, - slug=slug, - color=color, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - comments=comments, + assigned_object_cluster_group = convert_to_protobuf( + assigned_object_cluster_group, pb.ClusterGroup ) - return result - - -class RackType: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackType.""" - - def __new__( - cls, - manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - model: str | None = None, - slug: str | None = None, - description: str | None = None, - form_factor: str | None = None, - width: int | None = None, - u_height: int | None = None, - starting_unit: int | None = None, - desc_units: bool | None = None, - outer_width: int | None = None, - outer_depth: int | None = None, - outer_unit: str | None = None, - weight: float | None = None, - max_weight: int | None = None, - weight_unit: str | None = None, - mounting_depth: int | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - outer_height: int | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.RackType: - """Create a new RackType.""" - manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RackType( - manufacturer=manufacturer, - model=model, - slug=slug, - description=description, - form_factor=form_factor, - width=width, - u_height=u_height, - starting_unit=starting_unit, - desc_units=desc_units, - outer_width=outer_width, - outer_depth=outer_depth, - outer_unit=outer_unit, - weight=weight, - max_weight=max_weight, - weight_unit=weight_unit, - mounting_depth=mounting_depth, - comments=comments, - tags=tags, - custom_fields=custom_fields, - outer_height=outer_height, - metadata=metadata, - owner=owner, + assigned_object_cluster_type = convert_to_protobuf( + assigned_object_cluster_type, pb.ClusterType ) - return result - - -class RearPort: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RearPort.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - module: Module | pb.Module | None = None, - name: str | None = None, - label: str | None = None, - type: str | None = None, - color: str | None = None, - positions: int | None = None, - description: str | None = None, - mark_connected: bool | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.RearPort: - """Create a new RearPort.""" - device = convert_to_protobuf(device, pb.Device) - module = convert_to_protobuf(module, pb.Module) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RearPort( - device=device, - module=module, - name=name, - label=label, - type=type, - color=color, - positions=positions, - description=description, - mark_connected=mark_connected, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, + assigned_object_console_port = convert_to_protobuf( + assigned_object_console_port, pb.ConsolePort ) - return result - - -class Region: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Region.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - parent: str | Region | pb.Region | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - comments: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Region: - """Create a new Region.""" - parent = convert_to_protobuf(parent, pb.Region) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Region( - name=name, - slug=slug, - parent=parent, - description=description, - tags=tags, - custom_fields=custom_fields, - comments=comments, - metadata=metadata, - owner=owner, + assigned_object_console_server_port = convert_to_protobuf( + assigned_object_console_server_port, pb.ConsoleServerPort ) - return result - - -class Role: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Role.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - weight: int | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.Role: - """Create a new Role.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Role( - name=name, - slug=slug, - weight=weight, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - comments=comments, + assigned_object_contact = convert_to_protobuf( + assigned_object_contact, pb.Contact ) - return result - - -class RouteTarget: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RouteTarget.""" - - def __new__( - cls, - name: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.RouteTarget: - """Create a new RouteTarget.""" - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.RouteTarget( - name=name, - tenant=tenant, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, + assigned_object_contact_assignment = convert_to_protobuf( + assigned_object_contact_assignment, pb.ContactAssignment ) - return result - - -class Service: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Service.""" - - def __new__( - cls, - device: str | Device | pb.Device | None = None, - virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, - name: str | None = None, - protocol: str | None = None, - ports: list[int] | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - ipaddresses: list[str | IPAddress | pb.IPAddress] | None = None, - parent_object_device: str | Device | pb.Device | None = None, - parent_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, - parent_object_virtual_machine: ( - str | VirtualMachine | pb.VirtualMachine | None - ) = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Service: - """Create a new Service.""" - device = convert_to_protobuf(device, pb.Device) - virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - ipaddresses = convert_to_protobuf_list(ipaddresses, pb.IPAddress) - parent_object_device = convert_to_protobuf(parent_object_device, pb.Device) - parent_object_fhrp_group = convert_to_protobuf( - parent_object_fhrp_group, pb.FHRPGroup + assigned_object_contact_group = convert_to_protobuf( + assigned_object_contact_group, pb.ContactGroup ) - parent_object_virtual_machine = convert_to_protobuf( - parent_object_virtual_machine, pb.VirtualMachine + assigned_object_contact_role = convert_to_protobuf( + assigned_object_contact_role, pb.ContactRole + ) + assigned_object_custom_field = convert_to_protobuf( + assigned_object_custom_field, pb.CustomField + ) + assigned_object_custom_field_choice_set = convert_to_protobuf( + assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + assigned_object_custom_link = convert_to_protobuf( + assigned_object_custom_link, pb.CustomLink ) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Service( - device=device, - virtual_machine=virtual_machine, - name=name, - protocol=protocol, - ports=ports, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - ipaddresses=ipaddresses, - parent_object_device=parent_object_device, - parent_object_fhrp_group=parent_object_fhrp_group, - parent_object_virtual_machine=parent_object_virtual_machine, - metadata=metadata, - owner=owner, + assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) + assigned_object_device_bay = convert_to_protobuf( + assigned_object_device_bay, pb.DeviceBay ) - return result - - -class Site: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Site.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - status: str | None = None, - region: str | Region | pb.Region | None = None, - group: str | SiteGroup | pb.SiteGroup | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - facility: str | None = None, - time_zone: str | None = None, - description: str | None = None, - physical_address: str | None = None, - shipping_address: str | None = None, - latitude: float | None = None, - longitude: float | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - asns: list[str | ASN | pb.ASN] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Site: - """Create a new Site.""" - region = convert_to_protobuf(region, pb.Region) - group = convert_to_protobuf(group, pb.SiteGroup) - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - asns = convert_to_protobuf_list(asns, pb.ASN) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Site( - name=name, - slug=slug, - status=status, - region=region, - group=group, - tenant=tenant, - facility=facility, - time_zone=time_zone, - description=description, - physical_address=physical_address, - shipping_address=shipping_address, - latitude=latitude, - longitude=longitude, - comments=comments, - tags=tags, - custom_fields=custom_fields, - asns=asns, - metadata=metadata, - owner=owner, + assigned_object_device_role = convert_to_protobuf( + assigned_object_device_role, pb.DeviceRole ) - return result - - -class SiteGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.SiteGroup.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - parent: str | SiteGroup | pb.SiteGroup | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - comments: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.SiteGroup: - """Create a new SiteGroup.""" - parent = convert_to_protobuf(parent, pb.SiteGroup) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.SiteGroup( - name=name, - slug=slug, - parent=parent, - description=description, - tags=tags, - custom_fields=custom_fields, - comments=comments, - metadata=metadata, - owner=owner, + assigned_object_device_type = convert_to_protobuf( + assigned_object_device_type, pb.DeviceType ) - return result - - -class Tag: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tag.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - color: str | None = None, - description: str | None = None, - weight: int | None = None, - object_types: list[str] | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.Tag: - """Create a new Tag.""" - metadata = convert_dict_to_struct(metadata) - result = pb.Tag( - name=name, - slug=slug, - color=color, - description=description, - weight=weight, - object_types=object_types, - metadata=metadata, + assigned_object_fhrp_group = convert_to_protobuf( + assigned_object_fhrp_group, pb.FHRPGroup ) - return result - - -class Tenant: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tenant.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - group: str | TenantGroup | pb.TenantGroup | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Tenant: - """Create a new Tenant.""" - group = convert_to_protobuf(group, pb.TenantGroup) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Tenant( - name=name, - slug=slug, - group=group, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, + assigned_object_fhrp_group_assignment = convert_to_protobuf( + assigned_object_fhrp_group_assignment, pb.FHRPGroupAssignment ) - return result - - -class TenantGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TenantGroup.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - parent: str | TenantGroup | pb.TenantGroup | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - comments: str | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.TenantGroup: - """Create a new TenantGroup.""" - parent = convert_to_protobuf(parent, pb.TenantGroup) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.TenantGroup( - name=name, - slug=slug, - parent=parent, - description=description, - tags=tags, - custom_fields=custom_fields, - comments=comments, - metadata=metadata, - owner=owner, + assigned_object_front_port = convert_to_protobuf( + assigned_object_front_port, pb.FrontPort ) - return result - - -class Tunnel: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tunnel.""" - - def __new__( - cls, - name: str | None = None, - status: str | None = None, - group: str | TunnelGroup | pb.TunnelGroup | None = None, - encapsulation: str | None = None, - ipsec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - tunnel_id: int | None = None, - description: str | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.Tunnel: - """Create a new Tunnel.""" - group = convert_to_protobuf(group, pb.TunnelGroup) - ipsec_profile = convert_to_protobuf(ipsec_profile, pb.IPSecProfile) - tenant = convert_to_protobuf(tenant, pb.Tenant) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.Tunnel( - name=name, - status=status, - group=group, - encapsulation=encapsulation, - ipsec_profile=ipsec_profile, - tenant=tenant, - tunnel_id=tunnel_id, - description=description, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, + assigned_object_ike_policy = convert_to_protobuf( + assigned_object_ike_policy, pb.IKEPolicy ) - return result - - -class TunnelGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TunnelGroup.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - ) -> pb.TunnelGroup: - """Create a new TunnelGroup.""" - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.TunnelGroup( - name=name, - slug=slug, - description=description, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - owner=owner, - comments=comments, + assigned_object_ike_proposal = convert_to_protobuf( + assigned_object_ike_proposal, pb.IKEProposal ) - return result - - -class TunnelTermination: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TunnelTermination.""" - - def __new__( - cls, - tunnel: str | Tunnel | pb.Tunnel | None = None, - role: str | None = None, - termination_asn: str | ASN | pb.ASN | None = None, - termination_asn_range: str | ASNRange | pb.ASNRange | None = None, - termination_aggregate: Aggregate | pb.Aggregate | None = None, - termination_cable: Cable | pb.Cable | None = None, - termination_cable_path: CablePath | pb.CablePath | None = None, - termination_cable_termination: ( - CableTermination | pb.CableTermination | None - ) = None, - termination_circuit: str | Circuit | pb.Circuit | None = None, - termination_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, - termination_circuit_group_assignment: ( - CircuitGroupAssignment | pb.CircuitGroupAssignment | None - ) = None, - termination_circuit_termination: ( - CircuitTermination | pb.CircuitTermination | None - ) = None, - termination_circuit_type: str | CircuitType | pb.CircuitType | None = None, - termination_cluster: str | Cluster | pb.Cluster | None = None, - termination_cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, - termination_cluster_type: str | ClusterType | pb.ClusterType | None = None, - termination_console_port: str | ConsolePort | pb.ConsolePort | None = None, - termination_console_server_port: ( - str | ConsoleServerPort | pb.ConsoleServerPort | None - ) = None, - termination_contact: str | Contact | pb.Contact | None = None, - termination_contact_assignment: ( - ContactAssignment | pb.ContactAssignment | None - ) = None, - termination_contact_group: str | ContactGroup | pb.ContactGroup | None = None, - termination_contact_role: str | ContactRole | pb.ContactRole | None = None, - termination_device: str | Device | pb.Device | None = None, - termination_device_bay: str | DeviceBay | pb.DeviceBay | None = None, - termination_device_role: str | DeviceRole | pb.DeviceRole | None = None, - termination_device_type: str | DeviceType | pb.DeviceType | None = None, - termination_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, - termination_fhrp_group_assignment: ( - FHRPGroupAssignment | pb.FHRPGroupAssignment | None - ) = None, - termination_front_port: str | FrontPort | pb.FrontPort | None = None, - termination_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, - termination_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, - termination_ip_address: str | IPAddress | pb.IPAddress | None = None, - termination_ip_range: IPRange | pb.IPRange | None = None, - termination_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, - termination_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, - termination_ip_sec_proposal: ( - str | IPSecProposal | pb.IPSecProposal | None - ) = None, - termination_interface: str | Interface | pb.Interface | None = None, - termination_inventory_item: ( - str | InventoryItem | pb.InventoryItem | None - ) = None, - termination_inventory_item_role: ( - str | InventoryItemRole | pb.InventoryItemRole | None - ) = None, - termination_l2vpn: str | L2VPN | pb.L2VPN | None = None, - termination_l2vpn_termination: ( - L2VPNTermination | pb.L2VPNTermination | None - ) = None, - termination_location: str | Location | pb.Location | None = None, - termination_mac_address: str | MACAddress | pb.MACAddress | None = None, - termination_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - termination_module: Module | pb.Module | None = None, - termination_module_bay: str | ModuleBay | pb.ModuleBay | None = None, - termination_module_type: str | ModuleType | pb.ModuleType | None = None, - termination_platform: str | Platform | pb.Platform | None = None, - termination_power_feed: str | PowerFeed | pb.PowerFeed | None = None, - termination_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, - termination_power_panel: str | PowerPanel | pb.PowerPanel | None = None, - termination_power_port: str | PowerPort | pb.PowerPort | None = None, - termination_prefix: str | Prefix | pb.Prefix | None = None, - termination_provider: str | Provider | pb.Provider | None = None, - termination_provider_account: ( - str | ProviderAccount | pb.ProviderAccount | None - ) = None, - termination_provider_network: ( - str | ProviderNetwork | pb.ProviderNetwork | None - ) = None, - termination_rir: str | RIR | pb.RIR | None = None, - termination_rack: str | Rack | pb.Rack | None = None, - termination_rack_reservation: ( - RackReservation | pb.RackReservation | None - ) = None, - termination_rack_role: str | RackRole | pb.RackRole | None = None, - termination_rack_type: str | RackType | pb.RackType | None = None, - termination_rear_port: str | RearPort | pb.RearPort | None = None, - termination_region: str | Region | pb.Region | None = None, - termination_role: str | Role | pb.Role | None = None, - termination_route_target: str | RouteTarget | pb.RouteTarget | None = None, - termination_service: str | Service | pb.Service | None = None, - termination_site: str | Site | pb.Site | None = None, - termination_site_group: str | SiteGroup | pb.SiteGroup | None = None, - termination_tag: str | Tag | pb.Tag | None = None, - termination_tenant: str | Tenant | pb.Tenant | None = None, - termination_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, - termination_tunnel: str | Tunnel | pb.Tunnel | None = None, - termination_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - termination_tunnel_termination: ( - TunnelTermination | pb.TunnelTermination | None - ) = None, - termination_vlan: str | VLAN | pb.VLAN | None = None, - termination_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, - termination_vlan_translation_policy: ( - str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None - ) = None, - termination_vlan_translation_rule: ( - VLANTranslationRule | pb.VLANTranslationRule | None - ) = None, - termination_vm_interface: str | VMInterface | pb.VMInterface | None = None, - termination_vrf: str | VRF | pb.VRF | None = None, - termination_virtual_chassis: ( - str | VirtualChassis | pb.VirtualChassis | None - ) = None, - termination_virtual_circuit: ( - str | VirtualCircuit | pb.VirtualCircuit | None - ) = None, - termination_virtual_circuit_termination: ( - VirtualCircuitTermination | pb.VirtualCircuitTermination | None - ) = None, - termination_virtual_circuit_type: ( - str | VirtualCircuitType | pb.VirtualCircuitType | None - ) = None, - termination_virtual_device_context: ( - str | VirtualDeviceContext | pb.VirtualDeviceContext | None - ) = None, - termination_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, - termination_virtual_machine: ( - str | VirtualMachine | pb.VirtualMachine | None - ) = None, - termination_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, - termination_wireless_lan_group: ( - str | WirelessLANGroup | pb.WirelessLANGroup | None - ) = None, - termination_wireless_link: WirelessLink | pb.WirelessLink | None = None, - termination_custom_field: str | CustomField | pb.CustomField | None = None, - termination_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - termination_journal_entry: JournalEntry | pb.JournalEntry | None = None, - termination_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - termination_custom_link: str | CustomLink | pb.CustomLink | None = None, - termination_owner: str | Owner | pb.Owner | None = None, - termination_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, - outside_ip: str | IPAddress | pb.IPAddress | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.TunnelTermination: - """Create a new TunnelTermination.""" - tunnel = convert_to_protobuf(tunnel, pb.Tunnel) - termination_asn = convert_to_protobuf(termination_asn, pb.ASN) - termination_asn_range = convert_to_protobuf(termination_asn_range, pb.ASNRange) - termination_aggregate = convert_to_protobuf(termination_aggregate, pb.Aggregate) - termination_cable = convert_to_protobuf(termination_cable, pb.Cable) - termination_cable_path = convert_to_protobuf( - termination_cable_path, pb.CablePath + assigned_object_ip_address = convert_to_protobuf( + assigned_object_ip_address, pb.IPAddress ) - termination_cable_termination = convert_to_protobuf( - termination_cable_termination, pb.CableTermination + assigned_object_ip_range = convert_to_protobuf( + assigned_object_ip_range, pb.IPRange ) - termination_circuit = convert_to_protobuf(termination_circuit, pb.Circuit) - termination_circuit_group = convert_to_protobuf( - termination_circuit_group, pb.CircuitGroup + assigned_object_ip_sec_policy = convert_to_protobuf( + assigned_object_ip_sec_policy, pb.IPSecPolicy ) - termination_circuit_group_assignment = convert_to_protobuf( - termination_circuit_group_assignment, pb.CircuitGroupAssignment + assigned_object_ip_sec_profile = convert_to_protobuf( + assigned_object_ip_sec_profile, pb.IPSecProfile ) - termination_circuit_termination = convert_to_protobuf( - termination_circuit_termination, pb.CircuitTermination + assigned_object_ip_sec_proposal = convert_to_protobuf( + assigned_object_ip_sec_proposal, pb.IPSecProposal ) - termination_circuit_type = convert_to_protobuf( - termination_circuit_type, pb.CircuitType + assigned_object_interface = convert_to_protobuf( + assigned_object_interface, pb.Interface ) - termination_cluster = convert_to_protobuf(termination_cluster, pb.Cluster) - termination_cluster_group = convert_to_protobuf( - termination_cluster_group, pb.ClusterGroup + assigned_object_inventory_item = convert_to_protobuf( + assigned_object_inventory_item, pb.InventoryItem ) - termination_cluster_type = convert_to_protobuf( - termination_cluster_type, pb.ClusterType + assigned_object_inventory_item_role = convert_to_protobuf( + assigned_object_inventory_item_role, pb.InventoryItemRole ) - termination_console_port = convert_to_protobuf( - termination_console_port, pb.ConsolePort + assigned_object_journal_entry = convert_to_protobuf( + assigned_object_journal_entry, pb.JournalEntry ) - termination_console_server_port = convert_to_protobuf( - termination_console_server_port, pb.ConsoleServerPort + assigned_object_l2vpn = convert_to_protobuf(assigned_object_l2vpn, pb.L2VPN) + assigned_object_l2vpn_termination = convert_to_protobuf( + assigned_object_l2vpn_termination, pb.L2VPNTermination ) - termination_contact = convert_to_protobuf(termination_contact, pb.Contact) - termination_contact_assignment = convert_to_protobuf( - termination_contact_assignment, pb.ContactAssignment + assigned_object_location = convert_to_protobuf( + assigned_object_location, pb.Location ) - termination_contact_group = convert_to_protobuf( - termination_contact_group, pb.ContactGroup + assigned_object_mac_address = convert_to_protobuf( + assigned_object_mac_address, pb.MACAddress ) - termination_contact_role = convert_to_protobuf( - termination_contact_role, pb.ContactRole + assigned_object_manufacturer = convert_to_protobuf( + assigned_object_manufacturer, pb.Manufacturer ) - termination_device = convert_to_protobuf(termination_device, pb.Device) - termination_device_bay = convert_to_protobuf( - termination_device_bay, pb.DeviceBay + assigned_object_module = convert_to_protobuf(assigned_object_module, pb.Module) + assigned_object_module_bay = convert_to_protobuf( + assigned_object_module_bay, pb.ModuleBay ) - termination_device_role = convert_to_protobuf( - termination_device_role, pb.DeviceRole + assigned_object_module_type = convert_to_protobuf( + assigned_object_module_type, pb.ModuleType ) - termination_device_type = convert_to_protobuf( - termination_device_type, pb.DeviceType + assigned_object_module_type_profile = convert_to_protobuf( + assigned_object_module_type_profile, pb.ModuleTypeProfile ) - termination_fhrp_group = convert_to_protobuf( - termination_fhrp_group, pb.FHRPGroup + assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) + assigned_object_owner_group = convert_to_protobuf( + assigned_object_owner_group, pb.OwnerGroup + ) + assigned_object_platform = convert_to_protobuf( + assigned_object_platform, pb.Platform ) - termination_fhrp_group_assignment = convert_to_protobuf( - termination_fhrp_group_assignment, pb.FHRPGroupAssignment + assigned_object_power_feed = convert_to_protobuf( + assigned_object_power_feed, pb.PowerFeed ) - termination_front_port = convert_to_protobuf( - termination_front_port, pb.FrontPort + assigned_object_power_outlet = convert_to_protobuf( + assigned_object_power_outlet, pb.PowerOutlet ) - termination_ike_policy = convert_to_protobuf( - termination_ike_policy, pb.IKEPolicy + assigned_object_power_panel = convert_to_protobuf( + assigned_object_power_panel, pb.PowerPanel ) - termination_ike_proposal = convert_to_protobuf( - termination_ike_proposal, pb.IKEProposal + assigned_object_power_port = convert_to_protobuf( + assigned_object_power_port, pb.PowerPort ) - termination_ip_address = convert_to_protobuf( - termination_ip_address, pb.IPAddress + assigned_object_prefix = convert_to_protobuf(assigned_object_prefix, pb.Prefix) + assigned_object_provider = convert_to_protobuf( + assigned_object_provider, pb.Provider ) - termination_ip_range = convert_to_protobuf(termination_ip_range, pb.IPRange) - termination_ip_sec_policy = convert_to_protobuf( - termination_ip_sec_policy, pb.IPSecPolicy + assigned_object_provider_account = convert_to_protobuf( + assigned_object_provider_account, pb.ProviderAccount ) - termination_ip_sec_profile = convert_to_protobuf( - termination_ip_sec_profile, pb.IPSecProfile + assigned_object_provider_network = convert_to_protobuf( + assigned_object_provider_network, pb.ProviderNetwork ) - termination_ip_sec_proposal = convert_to_protobuf( - termination_ip_sec_proposal, pb.IPSecProposal + assigned_object_rir = convert_to_protobuf(assigned_object_rir, pb.RIR) + assigned_object_rack = convert_to_protobuf(assigned_object_rack, pb.Rack) + assigned_object_rack_reservation = convert_to_protobuf( + assigned_object_rack_reservation, pb.RackReservation ) - termination_interface = convert_to_protobuf(termination_interface, pb.Interface) - termination_inventory_item = convert_to_protobuf( - termination_inventory_item, pb.InventoryItem + assigned_object_rack_role = convert_to_protobuf( + assigned_object_rack_role, pb.RackRole ) - termination_inventory_item_role = convert_to_protobuf( - termination_inventory_item_role, pb.InventoryItemRole + assigned_object_rack_type = convert_to_protobuf( + assigned_object_rack_type, pb.RackType ) - termination_l2vpn = convert_to_protobuf(termination_l2vpn, pb.L2VPN) - termination_l2vpn_termination = convert_to_protobuf( - termination_l2vpn_termination, pb.L2VPNTermination + assigned_object_rear_port = convert_to_protobuf( + assigned_object_rear_port, pb.RearPort ) - termination_location = convert_to_protobuf(termination_location, pb.Location) - termination_mac_address = convert_to_protobuf( - termination_mac_address, pb.MACAddress + assigned_object_region = convert_to_protobuf(assigned_object_region, pb.Region) + assigned_object_role = convert_to_protobuf(assigned_object_role, pb.Role) + assigned_object_route_target = convert_to_protobuf( + assigned_object_route_target, pb.RouteTarget ) - termination_manufacturer = convert_to_protobuf( - termination_manufacturer, pb.Manufacturer + assigned_object_service = convert_to_protobuf( + assigned_object_service, pb.Service ) - termination_module = convert_to_protobuf(termination_module, pb.Module) - termination_module_bay = convert_to_protobuf( - termination_module_bay, pb.ModuleBay + assigned_object_site = convert_to_protobuf(assigned_object_site, pb.Site) + assigned_object_site_group = convert_to_protobuf( + assigned_object_site_group, pb.SiteGroup ) - termination_module_type = convert_to_protobuf( - termination_module_type, pb.ModuleType + assigned_object_tag = convert_to_protobuf(assigned_object_tag, pb.Tag) + assigned_object_tenant = convert_to_protobuf(assigned_object_tenant, pb.Tenant) + assigned_object_tenant_group = convert_to_protobuf( + assigned_object_tenant_group, pb.TenantGroup ) - termination_platform = convert_to_protobuf(termination_platform, pb.Platform) - termination_power_feed = convert_to_protobuf( - termination_power_feed, pb.PowerFeed + assigned_object_tunnel = convert_to_protobuf(assigned_object_tunnel, pb.Tunnel) + assigned_object_tunnel_group = convert_to_protobuf( + assigned_object_tunnel_group, pb.TunnelGroup ) - termination_power_outlet = convert_to_protobuf( - termination_power_outlet, pb.PowerOutlet + assigned_object_tunnel_termination = convert_to_protobuf( + assigned_object_tunnel_termination, pb.TunnelTermination ) - termination_power_panel = convert_to_protobuf( - termination_power_panel, pb.PowerPanel + assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) + assigned_object_vlan_group = convert_to_protobuf( + assigned_object_vlan_group, pb.VLANGroup ) - termination_power_port = convert_to_protobuf( - termination_power_port, pb.PowerPort + assigned_object_vlan_translation_policy = convert_to_protobuf( + assigned_object_vlan_translation_policy, pb.VLANTranslationPolicy ) - termination_prefix = convert_to_protobuf(termination_prefix, pb.Prefix) - termination_provider = convert_to_protobuf(termination_provider, pb.Provider) - termination_provider_account = convert_to_protobuf( - termination_provider_account, pb.ProviderAccount + assigned_object_vlan_translation_rule = convert_to_protobuf( + assigned_object_vlan_translation_rule, pb.VLANTranslationRule ) - termination_provider_network = convert_to_protobuf( - termination_provider_network, pb.ProviderNetwork + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface ) - termination_rir = convert_to_protobuf(termination_rir, pb.RIR) - termination_rack = convert_to_protobuf(termination_rack, pb.Rack) - termination_rack_reservation = convert_to_protobuf( - termination_rack_reservation, pb.RackReservation + assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) + assigned_object_virtual_chassis = convert_to_protobuf( + assigned_object_virtual_chassis, pb.VirtualChassis ) - termination_rack_role = convert_to_protobuf(termination_rack_role, pb.RackRole) - termination_rack_type = convert_to_protobuf(termination_rack_type, pb.RackType) - termination_rear_port = convert_to_protobuf(termination_rear_port, pb.RearPort) - termination_region = convert_to_protobuf(termination_region, pb.Region) - termination_role = convert_to_protobuf(termination_role, pb.Role) - termination_route_target = convert_to_protobuf( - termination_route_target, pb.RouteTarget + assigned_object_virtual_circuit = convert_to_protobuf( + assigned_object_virtual_circuit, pb.VirtualCircuit ) - termination_service = convert_to_protobuf(termination_service, pb.Service) - termination_site = convert_to_protobuf(termination_site, pb.Site) - termination_site_group = convert_to_protobuf( - termination_site_group, pb.SiteGroup + assigned_object_virtual_circuit_termination = convert_to_protobuf( + assigned_object_virtual_circuit_termination, pb.VirtualCircuitTermination ) - termination_tag = convert_to_protobuf(termination_tag, pb.Tag) - termination_tenant = convert_to_protobuf(termination_tenant, pb.Tenant) - termination_tenant_group = convert_to_protobuf( - termination_tenant_group, pb.TenantGroup + assigned_object_virtual_circuit_type = convert_to_protobuf( + assigned_object_virtual_circuit_type, pb.VirtualCircuitType ) - termination_tunnel = convert_to_protobuf(termination_tunnel, pb.Tunnel) - termination_tunnel_group = convert_to_protobuf( - termination_tunnel_group, pb.TunnelGroup + assigned_object_virtual_device_context = convert_to_protobuf( + assigned_object_virtual_device_context, pb.VirtualDeviceContext ) - termination_tunnel_termination = convert_to_protobuf( - termination_tunnel_termination, pb.TunnelTermination + assigned_object_virtual_disk = convert_to_protobuf( + assigned_object_virtual_disk, pb.VirtualDisk ) - termination_vlan = convert_to_protobuf(termination_vlan, pb.VLAN) - termination_vlan_group = convert_to_protobuf( - termination_vlan_group, pb.VLANGroup + assigned_object_virtual_machine = convert_to_protobuf( + assigned_object_virtual_machine, pb.VirtualMachine ) - termination_vlan_translation_policy = convert_to_protobuf( - termination_vlan_translation_policy, pb.VLANTranslationPolicy + assigned_object_wireless_lan = convert_to_protobuf( + assigned_object_wireless_lan, pb.WirelessLAN ) - termination_vlan_translation_rule = convert_to_protobuf( - termination_vlan_translation_rule, pb.VLANTranslationRule + assigned_object_wireless_lan_group = convert_to_protobuf( + assigned_object_wireless_lan_group, pb.WirelessLANGroup ) - termination_vm_interface = convert_to_protobuf( - termination_vm_interface, pb.VMInterface + assigned_object_wireless_link = convert_to_protobuf( + assigned_object_wireless_link, pb.WirelessLink ) - termination_vrf = convert_to_protobuf(termination_vrf, pb.VRF) - termination_virtual_chassis = convert_to_protobuf( - termination_virtual_chassis, pb.VirtualChassis + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.L2VPNTermination( + l2vpn=l2vpn, + assigned_object_asn=assigned_object_asn, + assigned_object_asn_range=assigned_object_asn_range, + assigned_object_aggregate=assigned_object_aggregate, + assigned_object_cable=assigned_object_cable, + assigned_object_cable_path=assigned_object_cable_path, + assigned_object_cable_termination=assigned_object_cable_termination, + assigned_object_circuit=assigned_object_circuit, + assigned_object_circuit_group=assigned_object_circuit_group, + assigned_object_circuit_group_assignment=assigned_object_circuit_group_assignment, + assigned_object_circuit_termination=assigned_object_circuit_termination, + assigned_object_circuit_type=assigned_object_circuit_type, + assigned_object_cluster=assigned_object_cluster, + assigned_object_cluster_group=assigned_object_cluster_group, + assigned_object_cluster_type=assigned_object_cluster_type, + assigned_object_console_port=assigned_object_console_port, + assigned_object_console_server_port=assigned_object_console_server_port, + assigned_object_contact=assigned_object_contact, + assigned_object_contact_assignment=assigned_object_contact_assignment, + assigned_object_contact_group=assigned_object_contact_group, + assigned_object_contact_role=assigned_object_contact_role, + assigned_object_custom_field=assigned_object_custom_field, + assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, + assigned_object_custom_link=assigned_object_custom_link, + assigned_object_device=assigned_object_device, + assigned_object_device_bay=assigned_object_device_bay, + assigned_object_device_role=assigned_object_device_role, + assigned_object_device_type=assigned_object_device_type, + assigned_object_fhrp_group=assigned_object_fhrp_group, + assigned_object_fhrp_group_assignment=assigned_object_fhrp_group_assignment, + assigned_object_front_port=assigned_object_front_port, + assigned_object_ike_policy=assigned_object_ike_policy, + assigned_object_ike_proposal=assigned_object_ike_proposal, + assigned_object_ip_address=assigned_object_ip_address, + assigned_object_ip_range=assigned_object_ip_range, + assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, + assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, + assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, + assigned_object_interface=assigned_object_interface, + assigned_object_inventory_item=assigned_object_inventory_item, + assigned_object_inventory_item_role=assigned_object_inventory_item_role, + assigned_object_journal_entry=assigned_object_journal_entry, + assigned_object_l2vpn=assigned_object_l2vpn, + assigned_object_l2vpn_termination=assigned_object_l2vpn_termination, + assigned_object_location=assigned_object_location, + assigned_object_mac_address=assigned_object_mac_address, + assigned_object_manufacturer=assigned_object_manufacturer, + assigned_object_module=assigned_object_module, + assigned_object_module_bay=assigned_object_module_bay, + assigned_object_module_type=assigned_object_module_type, + assigned_object_module_type_profile=assigned_object_module_type_profile, + assigned_object_owner=assigned_object_owner, + assigned_object_owner_group=assigned_object_owner_group, + assigned_object_platform=assigned_object_platform, + assigned_object_power_feed=assigned_object_power_feed, + assigned_object_power_outlet=assigned_object_power_outlet, + assigned_object_power_panel=assigned_object_power_panel, + assigned_object_power_port=assigned_object_power_port, + assigned_object_prefix=assigned_object_prefix, + assigned_object_provider=assigned_object_provider, + assigned_object_provider_account=assigned_object_provider_account, + assigned_object_provider_network=assigned_object_provider_network, + assigned_object_rir=assigned_object_rir, + assigned_object_rack=assigned_object_rack, + assigned_object_rack_reservation=assigned_object_rack_reservation, + assigned_object_rack_role=assigned_object_rack_role, + assigned_object_rack_type=assigned_object_rack_type, + assigned_object_rear_port=assigned_object_rear_port, + assigned_object_region=assigned_object_region, + assigned_object_role=assigned_object_role, + assigned_object_route_target=assigned_object_route_target, + assigned_object_service=assigned_object_service, + assigned_object_site=assigned_object_site, + assigned_object_site_group=assigned_object_site_group, + assigned_object_tag=assigned_object_tag, + assigned_object_tenant=assigned_object_tenant, + assigned_object_tenant_group=assigned_object_tenant_group, + assigned_object_tunnel=assigned_object_tunnel, + assigned_object_tunnel_group=assigned_object_tunnel_group, + assigned_object_tunnel_termination=assigned_object_tunnel_termination, + assigned_object_vlan=assigned_object_vlan, + assigned_object_vlan_group=assigned_object_vlan_group, + assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, + assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, + assigned_object_vm_interface=assigned_object_vm_interface, + assigned_object_vrf=assigned_object_vrf, + assigned_object_virtual_chassis=assigned_object_virtual_chassis, + assigned_object_virtual_circuit=assigned_object_virtual_circuit, + assigned_object_virtual_circuit_termination=assigned_object_virtual_circuit_termination, + assigned_object_virtual_circuit_type=assigned_object_virtual_circuit_type, + assigned_object_virtual_device_context=assigned_object_virtual_device_context, + assigned_object_virtual_disk=assigned_object_virtual_disk, + assigned_object_virtual_machine=assigned_object_virtual_machine, + assigned_object_wireless_lan=assigned_object_wireless_lan, + assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, + assigned_object_wireless_link=assigned_object_wireless_link, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_virtual_circuit = convert_to_protobuf( - termination_virtual_circuit, pb.VirtualCircuit + return result + + +class Location: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Location.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + site: str | Site | pb.Site | None = None, + parent: str | Location | pb.Location | None = None, + status: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + facility: str | None = None, + description: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Location: + """Create a new Location.""" + site = convert_to_protobuf(site, pb.Site) + parent = convert_to_protobuf(parent, pb.Location) + tenant = convert_to_protobuf(tenant, pb.Tenant) + tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Location( + name=name, + slug=slug, + site=site, + parent=parent, + status=status, + tenant=tenant, + facility=facility, + description=description, + tags=tags, + owner=owner, + comments=comments, + custom_fields=custom_fields, + metadata=metadata, ) - termination_virtual_circuit_termination = convert_to_protobuf( - termination_virtual_circuit_termination, pb.VirtualCircuitTermination + return result + + +class MACAddress: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.MACAddress.""" + + def __new__( + cls, + mac_address: str | None = None, + assigned_object_interface: str | Interface | pb.Interface | None = None, + assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.MACAddress: + """Create a new MACAddress.""" + assigned_object_interface = convert_to_protobuf( + assigned_object_interface, pb.Interface ) - termination_virtual_circuit_type = convert_to_protobuf( - termination_virtual_circuit_type, pb.VirtualCircuitType + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface ) - termination_virtual_device_context = convert_to_protobuf( - termination_virtual_device_context, pb.VirtualDeviceContext + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.MACAddress( + mac_address=mac_address, + assigned_object_interface=assigned_object_interface, + assigned_object_vm_interface=assigned_object_vm_interface, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_virtual_disk = convert_to_protobuf( - termination_virtual_disk, pb.VirtualDisk + return result + + +class Manufacturer: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Manufacturer.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Manufacturer: + """Create a new Manufacturer.""" + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Manufacturer( + name=name, + slug=slug, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_virtual_machine = convert_to_protobuf( - termination_virtual_machine, pb.VirtualMachine + return result + + +class Module: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Module.""" + + def __new__( + cls, + device: str | Device | pb.Device | None = None, + module_bay: str | ModuleBay | pb.ModuleBay | None = None, + module_type: str | ModuleType | pb.ModuleType | None = None, + status: str | None = None, + serial: str | None = None, + asset_tag: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Module: + """Create a new Module.""" + device = convert_to_protobuf(device, pb.Device) + module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) + module_type = convert_to_protobuf(module_type, pb.ModuleType) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Module( + device=device, + module_bay=module_bay, + module_type=module_type, + status=status, + serial=serial, + asset_tag=asset_tag, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_wireless_lan = convert_to_protobuf( - termination_wireless_lan, pb.WirelessLAN + return result + + +class ModuleBay: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleBay.""" + + def __new__( + cls, + device: str | Device | pb.Device | None = None, + module: str | Module | pb.Module | None = None, + name: str | None = None, + installed_module: str | Module | pb.Module | None = None, + label: str | None = None, + position: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.ModuleBay: + """Create a new ModuleBay.""" + device = convert_to_protobuf(device, pb.Device) + module = convert_to_protobuf(module, pb.Module) + installed_module = convert_to_protobuf(installed_module, pb.Module) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.ModuleBay( + device=device, + module=module, + name=name, + installed_module=installed_module, + label=label, + position=position, + description=description, + owner=owner, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_wireless_lan_group = convert_to_protobuf( - termination_wireless_lan_group, pb.WirelessLANGroup + return result + + +class ModuleType: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleType.""" + + def __new__( + cls, + profile: str | ModuleTypeProfile | pb.ModuleTypeProfile | None = None, + manufacturer: str | Manufacturer | pb.Manufacturer | None = None, + model: str | None = None, + part_number: str | None = None, + airflow: str | None = None, + weight: float | None = None, + weight_unit: str | None = None, + description: str | None = None, + attributes: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.ModuleType: + """Create a new ModuleType.""" + profile = convert_to_protobuf(profile, pb.ModuleTypeProfile) + manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.ModuleType( + profile=profile, + manufacturer=manufacturer, + model=model, + part_number=part_number, + airflow=airflow, + weight=weight, + weight_unit=weight_unit, + description=description, + attributes=attributes, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_wireless_link = convert_to_protobuf( - termination_wireless_link, pb.WirelessLink + return result + + +class ModuleTypeProfile: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleTypeProfile.""" + + def __new__( + cls, + name: str | None = None, + description: str | None = None, + schema: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.ModuleTypeProfile: + """Create a new ModuleTypeProfile.""" + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.ModuleTypeProfile( + name=name, + description=description, + schema=schema, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_custom_field = convert_to_protobuf( - termination_custom_field, pb.CustomField + return result + + +class Owner: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Owner.""" + + def __new__( + cls, + name: str | None = None, + group: str | OwnerGroup | pb.OwnerGroup | None = None, + description: str | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Owner: + """Create a new Owner.""" + group = convert_to_protobuf(group, pb.OwnerGroup) + metadata = convert_dict_to_struct(metadata) + result = pb.Owner( + name=name, + group=group, + description=description, + metadata=metadata, ) - termination_custom_field_choice_set = convert_to_protobuf( - termination_custom_field_choice_set, pb.CustomFieldChoiceSet + return result + + +class OwnerGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.OwnerGroup.""" + + def __new__( + cls, + name: str | None = None, + description: str | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.OwnerGroup: + """Create a new OwnerGroup.""" + metadata = convert_dict_to_struct(metadata) + result = pb.OwnerGroup( + name=name, + description=description, + metadata=metadata, ) - termination_journal_entry = convert_to_protobuf( - termination_journal_entry, pb.JournalEntry + return result + + +class Platform: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Platform.""" + + def __new__( + cls, + parent: str | Platform | pb.Platform | None = None, + name: str | None = None, + slug: str | None = None, + manufacturer: str | Manufacturer | pb.Manufacturer | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Platform: + """Create a new Platform.""" + parent = convert_to_protobuf(parent, pb.Platform) + manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Platform( + parent=parent, + name=name, + slug=slug, + manufacturer=manufacturer, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_module_type_profile = convert_to_protobuf( - termination_module_type_profile, pb.ModuleTypeProfile + return result + + +class PowerFeed: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerFeed.""" + + def __new__( + cls, + power_panel: str | PowerPanel | pb.PowerPanel | None = None, + rack: str | Rack | pb.Rack | None = None, + name: str | None = None, + status: str | None = None, + type: str | None = None, + supply: str | None = None, + phase: str | None = None, + voltage: int | None = None, + amperage: int | None = None, + max_utilization: int | None = None, + mark_connected: bool | None = None, + description: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.PowerFeed: + """Create a new PowerFeed.""" + power_panel = convert_to_protobuf(power_panel, pb.PowerPanel) + rack = convert_to_protobuf(rack, pb.Rack) + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.PowerFeed( + power_panel=power_panel, + rack=rack, + name=name, + status=status, + type=type, + supply=supply, + phase=phase, + voltage=voltage, + amperage=amperage, + max_utilization=max_utilization, + mark_connected=mark_connected, + description=description, + tenant=tenant, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_custom_link = convert_to_protobuf( - termination_custom_link, pb.CustomLink + return result + + +class PowerOutlet: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerOutlet.""" + + def __new__( + cls, + device: str | Device | pb.Device | None = None, + module: str | Module | pb.Module | None = None, + name: str | None = None, + label: str | None = None, + type: str | None = None, + status: str | None = None, + color: str | None = None, + power_port: str | PowerPort | pb.PowerPort | None = None, + feed_leg: str | None = None, + description: str | None = None, + mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.PowerOutlet: + """Create a new PowerOutlet.""" + device = convert_to_protobuf(device, pb.Device) + module = convert_to_protobuf(module, pb.Module) + power_port = convert_to_protobuf(power_port, pb.PowerPort) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.PowerOutlet( + device=device, + module=module, + name=name, + label=label, + type=type, + status=status, + color=color, + power_port=power_port, + feed_leg=feed_leg, + description=description, + mark_connected=mark_connected, + owner=owner, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - termination_owner = convert_to_protobuf(termination_owner, pb.Owner) - termination_owner_group = convert_to_protobuf( - termination_owner_group, pb.OwnerGroup + return result + + +class PowerPanel: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerPanel.""" + + def __new__( + cls, + site: str | Site | pb.Site | None = None, + location: str | Location | pb.Location | None = None, + name: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.PowerPanel: + """Create a new PowerPanel.""" + site = convert_to_protobuf(site, pb.Site) + location = convert_to_protobuf(location, pb.Location) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.PowerPanel( + site=site, + location=location, + name=name, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - outside_ip = convert_to_protobuf(outside_ip, pb.IPAddress) + return result + + +class PowerPort: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.PowerPort.""" + + def __new__( + cls, + device: str | Device | pb.Device | None = None, + module: str | Module | pb.Module | None = None, + name: str | None = None, + label: str | None = None, + type: str | None = None, + maximum_draw: int | None = None, + allocated_draw: int | None = None, + description: str | None = None, + mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.PowerPort: + """Create a new PowerPort.""" + device = convert_to_protobuf(device, pb.Device) + module = convert_to_protobuf(module, pb.Module) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.TunnelTermination( - tunnel=tunnel, - role=role, - termination_asn=termination_asn, - termination_asn_range=termination_asn_range, - termination_aggregate=termination_aggregate, - termination_cable=termination_cable, - termination_cable_path=termination_cable_path, - termination_cable_termination=termination_cable_termination, - termination_circuit=termination_circuit, - termination_circuit_group=termination_circuit_group, - termination_circuit_group_assignment=termination_circuit_group_assignment, - termination_circuit_termination=termination_circuit_termination, - termination_circuit_type=termination_circuit_type, - termination_cluster=termination_cluster, - termination_cluster_group=termination_cluster_group, - termination_cluster_type=termination_cluster_type, - termination_console_port=termination_console_port, - termination_console_server_port=termination_console_server_port, - termination_contact=termination_contact, - termination_contact_assignment=termination_contact_assignment, - termination_contact_group=termination_contact_group, - termination_contact_role=termination_contact_role, - termination_device=termination_device, - termination_device_bay=termination_device_bay, - termination_device_role=termination_device_role, - termination_device_type=termination_device_type, - termination_fhrp_group=termination_fhrp_group, - termination_fhrp_group_assignment=termination_fhrp_group_assignment, - termination_front_port=termination_front_port, - termination_ike_policy=termination_ike_policy, - termination_ike_proposal=termination_ike_proposal, - termination_ip_address=termination_ip_address, - termination_ip_range=termination_ip_range, - termination_ip_sec_policy=termination_ip_sec_policy, - termination_ip_sec_profile=termination_ip_sec_profile, - termination_ip_sec_proposal=termination_ip_sec_proposal, - termination_interface=termination_interface, - termination_inventory_item=termination_inventory_item, - termination_inventory_item_role=termination_inventory_item_role, - termination_l2vpn=termination_l2vpn, - termination_l2vpn_termination=termination_l2vpn_termination, - termination_location=termination_location, - termination_mac_address=termination_mac_address, - termination_manufacturer=termination_manufacturer, - termination_module=termination_module, - termination_module_bay=termination_module_bay, - termination_module_type=termination_module_type, - termination_platform=termination_platform, - termination_power_feed=termination_power_feed, - termination_power_outlet=termination_power_outlet, - termination_power_panel=termination_power_panel, - termination_power_port=termination_power_port, - termination_prefix=termination_prefix, - termination_provider=termination_provider, - termination_provider_account=termination_provider_account, - termination_provider_network=termination_provider_network, - termination_rir=termination_rir, - termination_rack=termination_rack, - termination_rack_reservation=termination_rack_reservation, - termination_rack_role=termination_rack_role, - termination_rack_type=termination_rack_type, - termination_rear_port=termination_rear_port, - termination_region=termination_region, - termination_role=termination_role, - termination_route_target=termination_route_target, - termination_service=termination_service, - termination_site=termination_site, - termination_site_group=termination_site_group, - termination_tag=termination_tag, - termination_tenant=termination_tenant, - termination_tenant_group=termination_tenant_group, - termination_tunnel=termination_tunnel, - termination_tunnel_group=termination_tunnel_group, - termination_tunnel_termination=termination_tunnel_termination, - termination_vlan=termination_vlan, - termination_vlan_group=termination_vlan_group, - termination_vlan_translation_policy=termination_vlan_translation_policy, - termination_vlan_translation_rule=termination_vlan_translation_rule, - termination_vm_interface=termination_vm_interface, - termination_vrf=termination_vrf, - termination_virtual_chassis=termination_virtual_chassis, - termination_virtual_circuit=termination_virtual_circuit, - termination_virtual_circuit_termination=termination_virtual_circuit_termination, - termination_virtual_circuit_type=termination_virtual_circuit_type, - termination_virtual_device_context=termination_virtual_device_context, - termination_virtual_disk=termination_virtual_disk, - termination_virtual_machine=termination_virtual_machine, - termination_wireless_lan=termination_wireless_lan, - termination_wireless_lan_group=termination_wireless_lan_group, - termination_wireless_link=termination_wireless_link, - termination_custom_field=termination_custom_field, - termination_custom_field_choice_set=termination_custom_field_choice_set, - termination_journal_entry=termination_journal_entry, - termination_module_type_profile=termination_module_type_profile, - termination_custom_link=termination_custom_link, - termination_owner=termination_owner, - termination_owner_group=termination_owner_group, - outside_ip=outside_ip, + result = pb.PowerPort( + device=device, + module=module, + name=name, + label=label, + type=type, + maximum_draw=maximum_draw, + allocated_draw=allocated_draw, + description=description, + mark_connected=mark_connected, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, @@ -6284,1327 +5663,1883 @@ def __new__( return result -class VLAN: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLAN.""" +class Prefix: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Prefix.""" def __new__( cls, - site: str | Site | pb.Site | None = None, - group: str | VLANGroup | pb.VLANGroup | None = None, - vid: int | None = None, - name: str | None = None, + prefix: str | None = None, + vrf: str | VRF | pb.VRF | None = None, + scope_location: str | Location | pb.Location | None = None, + scope_region: str | Region | pb.Region | None = None, + scope_site: str | Site | pb.Site | None = None, + scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, tenant: str | Tenant | pb.Tenant | None = None, + vlan: str | VLAN | pb.VLAN | None = None, status: str | None = None, role: str | Role | pb.Role | None = None, + is_pool: bool | None = None, + mark_utilized: bool | None = None, description: str | None = None, - qinq_role: str | None = None, - qinq_svlan: str | VLAN | pb.VLAN | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VLAN: - """Create a new VLAN.""" - site = convert_to_protobuf(site, pb.Site) - group = convert_to_protobuf(group, pb.VLANGroup) + ) -> pb.Prefix: + """Create a new Prefix.""" + vrf = convert_to_protobuf(vrf, pb.VRF) + scope_location = convert_to_protobuf(scope_location, pb.Location) + scope_region = convert_to_protobuf(scope_region, pb.Region) + scope_site = convert_to_protobuf(scope_site, pb.Site) + scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) tenant = convert_to_protobuf(tenant, pb.Tenant) + vlan = convert_to_protobuf(vlan, pb.VLAN) role = convert_to_protobuf(role, pb.Role) - qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Prefix( + prefix=prefix, + vrf=vrf, + scope_location=scope_location, + scope_region=scope_region, + scope_site=scope_site, + scope_site_group=scope_site_group, + tenant=tenant, + vlan=vlan, + status=status, + role=role, + is_pool=is_pool, + mark_utilized=mark_utilized, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + ) + return result + + +class Provider: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Provider.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + accounts: list[str | ProviderAccount | pb.ProviderAccount] | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + asns: list[str | ASN | pb.ASN] | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Provider: + """Create a new Provider.""" + accounts = convert_to_protobuf_list(accounts, pb.ProviderAccount) + owner = convert_to_protobuf(owner, pb.Owner) + asns = convert_to_protobuf_list(asns, pb.ASN) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Provider( + name=name, + slug=slug, + accounts=accounts, + description=description, + owner=owner, + comments=comments, + asns=asns, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + ) + return result + + +class ProviderAccount: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ProviderAccount.""" + + def __new__( + cls, + provider: str | Provider | pb.Provider | None = None, + name: str | None = None, + account: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.ProviderAccount: + """Create a new ProviderAccount.""" + provider = convert_to_protobuf(provider, pb.Provider) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VLAN( - site=site, - group=group, - vid=vid, + result = pb.ProviderAccount( + provider=provider, name=name, - tenant=tenant, - status=status, - role=role, + account=account, description=description, - qinq_role=qinq_role, - qinq_svlan=qinq_svlan, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class VLANGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANGroup.""" +class ProviderNetwork: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ProviderNetwork.""" def __new__( cls, + provider: str | Provider | pb.Provider | None = None, name: str | None = None, - slug: str | None = None, - scope_cluster: str | Cluster | pb.Cluster | None = None, - scope_cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, - scope_location: str | Location | pb.Location | None = None, - scope_rack: str | Rack | pb.Rack | None = None, - scope_region: str | Region | pb.Region | None = None, - scope_site: str | Site | pb.Site | None = None, - scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, - vid_ranges: list[int] | None = None, + service_id: str | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - ) -> pb.VLANGroup: - """Create a new VLANGroup.""" - scope_cluster = convert_to_protobuf(scope_cluster, pb.Cluster) - scope_cluster_group = convert_to_protobuf(scope_cluster_group, pb.ClusterGroup) - scope_location = convert_to_protobuf(scope_location, pb.Location) - scope_rack = convert_to_protobuf(scope_rack, pb.Rack) - scope_region = convert_to_protobuf(scope_region, pb.Region) - scope_site = convert_to_protobuf(scope_site, pb.Site) - scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.ProviderNetwork: + """Create a new ProviderNetwork.""" + provider = convert_to_protobuf(provider, pb.Provider) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - tenant = convert_to_protobuf(tenant, pb.Tenant) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VLANGroup( + result = pb.ProviderNetwork( + provider=provider, name=name, - slug=slug, - scope_cluster=scope_cluster, - scope_cluster_group=scope_cluster_group, - scope_location=scope_location, - scope_rack=scope_rack, - scope_region=scope_region, - scope_site=scope_site, - scope_site_group=scope_site_group, - vid_ranges=vid_ranges, + service_id=service_id, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, - tenant=tenant, metadata=metadata, - owner=owner, - comments=comments, ) return result -class VLANTranslationPolicy: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANTranslationPolicy.""" +class RIR: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RIR.""" def __new__( cls, name: str | None = None, + slug: str | None = None, + is_private: bool | None = None, description: str | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - ) -> pb.VLANTranslationPolicy: - """Create a new VLANTranslationPolicy.""" - metadata = convert_dict_to_struct(metadata) + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.RIR: + """Create a new RIR.""" owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VLANTranslationPolicy( + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.RIR( name=name, + slug=slug, + is_private=is_private, description=description, - metadata=metadata, owner=owner, comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) return result -class VLANTranslationRule: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANTranslationRule.""" +class Rack: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Rack.""" def __new__( cls, - policy: str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None = None, - local_vid: int | None = None, - remote_vid: int | None = None, + name: str | None = None, + facility_id: str | None = None, + site: str | Site | pb.Site | None = None, + location: str | Location | pb.Location | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + status: str | None = None, + role: str | RackRole | pb.RackRole | None = None, + serial: str | None = None, + asset_tag: str | None = None, + rack_type: str | RackType | pb.RackType | None = None, + form_factor: str | None = None, + width: int | None = None, + u_height: int | None = None, + starting_unit: int | None = None, + weight: float | None = None, + max_weight: int | None = None, + weight_unit: str | None = None, + desc_units: bool | None = None, + outer_width: int | None = None, + outer_height: int | None = None, + outer_depth: int | None = None, + outer_unit: str | None = None, + mounting_depth: int | None = None, + airflow: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.VLANTranslationRule: - """Create a new VLANTranslationRule.""" - policy = convert_to_protobuf(policy, pb.VLANTranslationPolicy) + ) -> pb.Rack: + """Create a new Rack.""" + site = convert_to_protobuf(site, pb.Site) + location = convert_to_protobuf(location, pb.Location) + tenant = convert_to_protobuf(tenant, pb.Tenant) + role = convert_to_protobuf(role, pb.RackRole) + rack_type = convert_to_protobuf(rack_type, pb.RackType) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.VLANTranslationRule( - policy=policy, - local_vid=local_vid, - remote_vid=remote_vid, + result = pb.Rack( + name=name, + facility_id=facility_id, + site=site, + location=location, + tenant=tenant, + status=status, + role=role, + serial=serial, + asset_tag=asset_tag, + rack_type=rack_type, + form_factor=form_factor, + width=width, + u_height=u_height, + starting_unit=starting_unit, + weight=weight, + max_weight=max_weight, + weight_unit=weight_unit, + desc_units=desc_units, + outer_width=outer_width, + outer_height=outer_height, + outer_depth=outer_depth, + outer_unit=outer_unit, + mounting_depth=mounting_depth, + airflow=airflow, description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, metadata=metadata, ) return result -class VMInterface: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VMInterface.""" +class RackReservation: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackReservation.""" def __new__( cls, - virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, - name: str | None = None, - enabled: bool | None = None, - parent: str | VMInterface | pb.VMInterface | None = None, - bridge: str | VMInterface | pb.VMInterface | None = None, - mtu: int | None = None, - primary_mac_address: str | MACAddress | pb.MACAddress | None = None, + rack: str | Rack | pb.Rack | None = None, + units: list[int] | None = None, + status: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - mode: str | None = None, - untagged_vlan: str | VLAN | pb.VLAN | None = None, - qinq_svlan: str | VLAN | pb.VLAN | None = None, - vlan_translation_policy: ( - str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None - ) = None, - vrf: str | VRF | pb.VRF | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VMInterface: - """Create a new VMInterface.""" - virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) - parent = convert_to_protobuf(parent, pb.VMInterface) - bridge = convert_to_protobuf(bridge, pb.VMInterface) - primary_mac_address = convert_to_protobuf(primary_mac_address, pb.MACAddress) - untagged_vlan = convert_to_protobuf(untagged_vlan, pb.VLAN) - qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) - vlan_translation_policy = convert_to_protobuf( - vlan_translation_policy, pb.VLANTranslationPolicy - ) - vrf = convert_to_protobuf(vrf, pb.VRF) + ) -> pb.RackReservation: + """Create a new RackReservation.""" + rack = convert_to_protobuf(rack, pb.Rack) + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VMInterface( - virtual_machine=virtual_machine, - name=name, - enabled=enabled, - parent=parent, - bridge=bridge, - mtu=mtu, - primary_mac_address=primary_mac_address, + result = pb.RackReservation( + rack=rack, + units=units, + status=status, + tenant=tenant, description=description, - mode=mode, - untagged_vlan=untagged_vlan, - qinq_svlan=qinq_svlan, - vlan_translation_policy=vlan_translation_policy, - vrf=vrf, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, - tagged_vlans=tagged_vlans, metadata=metadata, - owner=owner, ) return result -class VRF: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VRF.""" +class RackRole: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackRole.""" def __new__( cls, name: str | None = None, - rd: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - enforce_unique: bool | None = None, + slug: str | None = None, + color: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VRF: - """Create a new VRF.""" - tenant = convert_to_protobuf(tenant, pb.Tenant) + ) -> pb.RackRole: + """Create a new RackRole.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) - export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VRF( + result = pb.RackRole( name=name, - rd=rd, - tenant=tenant, - enforce_unique=enforce_unique, + slug=slug, + color=color, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, - import_targets=import_targets, - export_targets=export_targets, metadata=metadata, - owner=owner, ) return result -class VirtualChassis: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualChassis.""" +class RackType: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RackType.""" def __new__( cls, - name: str | None = None, - domain: str | None = None, - master: str | Device | pb.Device | None = None, + manufacturer: str | Manufacturer | pb.Manufacturer | None = None, + model: str | None = None, + slug: str | None = None, description: str | None = None, + form_factor: str | None = None, + width: int | None = None, + u_height: int | None = None, + starting_unit: int | None = None, + desc_units: bool | None = None, + outer_width: int | None = None, + outer_height: int | None = None, + outer_depth: int | None = None, + outer_unit: str | None = None, + weight: float | None = None, + max_weight: int | None = None, + weight_unit: str | None = None, + mounting_depth: int | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VirtualChassis: - """Create a new VirtualChassis.""" - master = convert_to_protobuf(master, pb.Device) + ) -> pb.RackType: + """Create a new RackType.""" + manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VirtualChassis( - name=name, - domain=domain, - master=master, + result = pb.RackType( + manufacturer=manufacturer, + model=model, + slug=slug, description=description, + form_factor=form_factor, + width=width, + u_height=u_height, + starting_unit=starting_unit, + desc_units=desc_units, + outer_width=outer_width, + outer_height=outer_height, + outer_depth=outer_depth, + outer_unit=outer_unit, + weight=weight, + max_weight=max_weight, + weight_unit=weight_unit, + mounting_depth=mounting_depth, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class VirtualCircuit: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuit.""" +class RearPort: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RearPort.""" def __new__( cls, - cid: str | None = None, - provider_network: str | ProviderNetwork | pb.ProviderNetwork | None = None, - provider_account: str | ProviderAccount | pb.ProviderAccount | None = None, - type: str | VirtualCircuitType | pb.VirtualCircuitType | None = None, - status: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, + device: str | Device | pb.Device | None = None, + module: str | Module | pb.Module | None = None, + name: str | None = None, + label: str | None = None, + type: str | None = None, + color: str | None = None, + positions: int | None = None, description: str | None = None, - comments: str | None = None, + mark_connected: bool | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VirtualCircuit: - """Create a new VirtualCircuit.""" - provider_network = convert_to_protobuf(provider_network, pb.ProviderNetwork) - provider_account = convert_to_protobuf(provider_account, pb.ProviderAccount) - type = convert_to_protobuf(type, pb.VirtualCircuitType) - tenant = convert_to_protobuf(tenant, pb.Tenant) + ) -> pb.RearPort: + """Create a new RearPort.""" + device = convert_to_protobuf(device, pb.Device) + module = convert_to_protobuf(module, pb.Module) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VirtualCircuit( - cid=cid, - provider_network=provider_network, - provider_account=provider_account, + result = pb.RearPort( + device=device, + module=module, + name=name, + label=label, type=type, - status=status, - tenant=tenant, + color=color, + positions=positions, description=description, - comments=comments, + mark_connected=mark_connected, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class VirtualCircuitTermination: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuitTermination.""" +class Region: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Region.""" def __new__( cls, - virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, - role: str | None = None, - interface: str | Interface | pb.Interface | None = None, + name: str | None = None, + slug: str | None = None, + parent: str | Region | pb.Region | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.VirtualCircuitTermination: - """Create a new VirtualCircuitTermination.""" - virtual_circuit = convert_to_protobuf(virtual_circuit, pb.VirtualCircuit) - interface = convert_to_protobuf(interface, pb.Interface) + ) -> pb.Region: + """Create a new Region.""" + parent = convert_to_protobuf(parent, pb.Region) tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.VirtualCircuitTermination( - virtual_circuit=virtual_circuit, - role=role, - interface=interface, + result = pb.Region( + name=name, + slug=slug, + parent=parent, description=description, tags=tags, + owner=owner, + comments=comments, custom_fields=custom_fields, metadata=metadata, ) return result -class VirtualCircuitType: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuitType.""" +class Role: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Role.""" def __new__( cls, name: str | None = None, slug: str | None = None, - color: str | None = None, + weight: int | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - ) -> pb.VirtualCircuitType: - """Create a new VirtualCircuitType.""" + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Role: + """Create a new Role.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VirtualCircuitType( + result = pb.Role( name=name, slug=slug, - color=color, + weight=weight, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, - comments=comments, ) return result -class VirtualDeviceContext: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDeviceContext.""" +class RouteTarget: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.RouteTarget.""" def __new__( cls, name: str | None = None, - device: str | Device | pb.Device | None = None, - identifier: int | None = None, tenant: str | Tenant | pb.Tenant | None = None, - primary_ip4: str | IPAddress | pb.IPAddress | None = None, - primary_ip6: str | IPAddress | pb.IPAddress | None = None, - status: str | None = None, description: str | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VirtualDeviceContext: - """Create a new VirtualDeviceContext.""" - device = convert_to_protobuf(device, pb.Device) + ) -> pb.RouteTarget: + """Create a new RouteTarget.""" tenant = convert_to_protobuf(tenant, pb.Tenant) - primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) - primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VirtualDeviceContext( + result = pb.RouteTarget( name=name, - device=device, - identifier=identifier, tenant=tenant, - primary_ip4=primary_ip4, - primary_ip6=primary_ip6, - status=status, description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class VirtualDisk: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDisk.""" +class Service: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Service.""" def __new__( cls, - virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, + parent_object_device: str | Device | pb.Device | None = None, + parent_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, + parent_object_virtual_machine: ( + str | VirtualMachine | pb.VirtualMachine | None + ) = None, name: str | None = None, + protocol: str | None = None, + ports: list[int] | None = None, + ipaddresses: list[str | IPAddress | pb.IPAddress] | None = None, description: str | None = None, - size: int | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VirtualDisk: - """Create a new VirtualDisk.""" - virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) + ) -> pb.Service: + """Create a new Service.""" + parent_object_device = convert_to_protobuf(parent_object_device, pb.Device) + parent_object_fhrp_group = convert_to_protobuf( + parent_object_fhrp_group, pb.FHRPGroup + ) + parent_object_virtual_machine = convert_to_protobuf( + parent_object_virtual_machine, pb.VirtualMachine + ) + ipaddresses = convert_to_protobuf_list(ipaddresses, pb.IPAddress) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.VirtualDisk( - virtual_machine=virtual_machine, + metadata = convert_dict_to_struct(metadata) + result = pb.Service( + parent_object_device=parent_object_device, + parent_object_fhrp_group=parent_object_fhrp_group, + parent_object_virtual_machine=parent_object_virtual_machine, name=name, + protocol=protocol, + ports=ports, + ipaddresses=ipaddresses, description=description, - size=size, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class VirtualMachine: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualMachine.""" +class Site: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Site.""" def __new__( cls, name: str | None = None, + slug: str | None = None, status: str | None = None, - site: str | Site | pb.Site | None = None, - cluster: str | Cluster | pb.Cluster | None = None, - device: str | Device | pb.Device | None = None, - serial: str | None = None, - role: str | DeviceRole | pb.DeviceRole | None = None, + region: str | Region | pb.Region | None = None, + group: str | SiteGroup | pb.SiteGroup | None = None, tenant: str | Tenant | pb.Tenant | None = None, - platform: str | Platform | pb.Platform | None = None, - primary_ip4: str | IPAddress | pb.IPAddress | None = None, - primary_ip6: str | IPAddress | pb.IPAddress | None = None, - vcpus: float | None = None, - memory: int | None = None, - disk: int | None = None, + facility: str | None = None, + time_zone: str | None = None, description: str | None = None, + physical_address: str | None = None, + shipping_address: str | None = None, + latitude: float | None = None, + longitude: float | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + asns: list[str | ASN | pb.ASN] | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - start_on_boot: str | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.VirtualMachine: - """Create a new VirtualMachine.""" - site = convert_to_protobuf(site, pb.Site) - cluster = convert_to_protobuf(cluster, pb.Cluster) - device = convert_to_protobuf(device, pb.Device) - role = convert_to_protobuf(role, pb.DeviceRole) + ) -> pb.Site: + """Create a new Site.""" + region = convert_to_protobuf(region, pb.Region) + group = convert_to_protobuf(group, pb.SiteGroup) tenant = convert_to_protobuf(tenant, pb.Tenant) - platform = convert_to_protobuf(platform, pb.Platform) - primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) - primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) + owner = convert_to_protobuf(owner, pb.Owner) + asns = convert_to_protobuf_list(asns, pb.ASN) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - - # apply shortcuts - if platform is not None: - if device is not None and not device.HasField("platform"): - device.platform.CopyFrom(platform) - if site is not None: - if device is not None and not device.HasField("site"): - device.site.CopyFrom(site) - if cluster is not None and not cluster.HasField("scope_site"): - cluster.scope_site.CopyFrom(site) - if role is not None: - if device is not None and not device.HasField("role"): - device.role.CopyFrom(role) - result = pb.VirtualMachine( + result = pb.Site( name=name, + slug=slug, status=status, - site=site, - cluster=cluster, - device=device, - serial=serial, - role=role, + region=region, + group=group, tenant=tenant, - platform=platform, - primary_ip4=primary_ip4, - primary_ip6=primary_ip6, - vcpus=vcpus, - memory=memory, - disk=disk, + facility=facility, + time_zone=time_zone, description=description, + physical_address=physical_address, + shipping_address=shipping_address, + latitude=latitude, + longitude=longitude, + owner=owner, comments=comments, + asns=asns, tags=tags, custom_fields=custom_fields, metadata=metadata, - start_on_boot=start_on_boot, - owner=owner, ) return result -class WirelessLAN: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLAN.""" +class SiteGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.SiteGroup.""" def __new__( cls, - ssid: str | None = None, + name: str | None = None, + slug: str | None = None, + parent: str | SiteGroup | pb.SiteGroup | None = None, description: str | None = None, - group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, - status: str | None = None, - vlan: str | VLAN | pb.VLAN | None = None, - scope_location: str | Location | pb.Location | None = None, - scope_region: str | Region | pb.Region | None = None, - scope_site: str | Site | pb.Site | None = None, - scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - auth_type: str | None = None, - auth_cipher: str | None = None, - auth_psk: str | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, - ) -> pb.WirelessLAN: - """Create a new WirelessLAN.""" - group = convert_to_protobuf(group, pb.WirelessLANGroup) - vlan = convert_to_protobuf(vlan, pb.VLAN) - scope_location = convert_to_protobuf(scope_location, pb.Location) - scope_region = convert_to_protobuf(scope_region, pb.Region) - scope_site = convert_to_protobuf(scope_site, pb.Site) - scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) - tenant = convert_to_protobuf(tenant, pb.Tenant) + comments: str | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.SiteGroup: + """Create a new SiteGroup.""" + parent = convert_to_protobuf(parent, pb.SiteGroup) tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.WirelessLAN( - ssid=ssid, + result = pb.SiteGroup( + name=name, + slug=slug, + parent=parent, description=description, - group=group, - status=status, - vlan=vlan, - scope_location=scope_location, - scope_region=scope_region, - scope_site=scope_site, - scope_site_group=scope_site_group, - tenant=tenant, - auth_type=auth_type, - auth_cipher=auth_cipher, - auth_psk=auth_psk, - comments=comments, tags=tags, + owner=owner, + comments=comments, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class WirelessLANGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLANGroup.""" +class Tag: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tag.""" def __new__( cls, name: str | None = None, slug: str | None = None, - parent: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, + color: str | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - comments: str | None = None, + weight: int | None = None, + object_types: list[str] | None = None, metadata: dict[str, Any] | None = None, + ) -> pb.Tag: + """Create a new Tag.""" + metadata = convert_dict_to_struct(metadata) + result = pb.Tag( + name=name, + slug=slug, + color=color, + description=description, + weight=weight, + object_types=object_types, + metadata=metadata, + ) + return result + + +class Tenant: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tenant.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + group: str | TenantGroup | pb.TenantGroup | None = None, + description: str | None = None, owner: str | Owner | pb.Owner | None = None, - ) -> pb.WirelessLANGroup: - """Create a new WirelessLANGroup.""" - parent = convert_to_protobuf(parent, pb.WirelessLANGroup) + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.Tenant: + """Create a new Tenant.""" + group = convert_to_protobuf(group, pb.TenantGroup) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.WirelessLANGroup( + result = pb.Tenant( name=name, slug=slug, - parent=parent, + group=group, description=description, + owner=owner, + comments=comments, tags=tags, custom_fields=custom_fields, - comments=comments, metadata=metadata, - owner=owner, ) return result -class WirelessLink: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLink.""" +class TenantGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TenantGroup.""" def __new__( cls, - interface_a: str | Interface | pb.Interface | None = None, - interface_b: str | Interface | pb.Interface | None = None, - ssid: str | None = None, - status: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - auth_type: str | None = None, - auth_cipher: str | None = None, - auth_psk: str | None = None, - distance: float | None = None, - distance_unit: str | None = None, + name: str | None = None, + slug: str | None = None, + parent: str | TenantGroup | pb.TenantGroup | None = None, description: str | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, - ) -> pb.WirelessLink: - """Create a new WirelessLink.""" - interface_a = convert_to_protobuf(interface_a, pb.Interface) - interface_b = convert_to_protobuf(interface_b, pb.Interface) - tenant = convert_to_protobuf(tenant, pb.Tenant) + comments: str | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.TenantGroup: + """Create a new TenantGroup.""" + parent = convert_to_protobuf(parent, pb.TenantGroup) tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.WirelessLink( - interface_a=interface_a, - interface_b=interface_b, - ssid=ssid, - status=status, - tenant=tenant, - auth_type=auth_type, - auth_cipher=auth_cipher, - auth_psk=auth_psk, - distance=distance, - distance_unit=distance_unit, + result = pb.TenantGroup( + name=name, + slug=slug, + parent=parent, description=description, - comments=comments, tags=tags, + owner=owner, + comments=comments, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class CustomField: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomField.""" +class Tunnel: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Tunnel.""" def __new__( cls, - type: str | None = None, - related_object_type: str | None = None, name: str | None = None, - label: str | None = None, - group_name: str | None = None, + status: str | None = None, + group: str | TunnelGroup | pb.TunnelGroup | None = None, + encapsulation: str | None = None, + ipsec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + tunnel_id: int | None = None, description: str | None = None, - required: bool | None = None, - unique: bool | None = None, - search_weight: int | None = None, - filter_logic: str | None = None, - ui_visible: str | None = None, - ui_editable: str | None = None, - is_cloneable: bool | None = None, - default: str | None = None, - related_object_filter: str | None = None, - weight: int | None = None, - validation_minimum: float | None = None, - validation_maximum: float | None = None, - validation_regex: str | None = None, - choice_set: str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None = None, + owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - object_types: list[str] | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.CustomField: - """Create a new CustomField.""" - choice_set = convert_to_protobuf(choice_set, pb.CustomFieldChoiceSet) - metadata = convert_dict_to_struct(metadata) + ) -> pb.Tunnel: + """Create a new Tunnel.""" + group = convert_to_protobuf(group, pb.TunnelGroup) + ipsec_profile = convert_to_protobuf(ipsec_profile, pb.IPSecProfile) + tenant = convert_to_protobuf(tenant, pb.Tenant) owner = convert_to_protobuf(owner, pb.Owner) - result = pb.CustomField( - type=type, - related_object_type=related_object_type, + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.Tunnel( name=name, - label=label, - group_name=group_name, + status=status, + group=group, + encapsulation=encapsulation, + ipsec_profile=ipsec_profile, + tenant=tenant, + tunnel_id=tunnel_id, description=description, - required=required, - unique=unique, - search_weight=search_weight, - filter_logic=filter_logic, - ui_visible=ui_visible, - ui_editable=ui_editable, - is_cloneable=is_cloneable, - default=default, - related_object_filter=related_object_filter, - weight=weight, - validation_minimum=validation_minimum, - validation_maximum=validation_maximum, - validation_regex=validation_regex, - choice_set=choice_set, + owner=owner, comments=comments, - object_types=object_types, + tags=tags, + custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class CustomFieldChoiceSet: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomFieldChoiceSet.""" +class TunnelGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TunnelGroup.""" def __new__( cls, name: str | None = None, + slug: str | None = None, description: str | None = None, - base_choices: str | None = None, - order_alphabetically: bool | None = None, - extra_choices: list[str] | None = None, - metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, - ) -> pb.CustomFieldChoiceSet: - """Create a new CustomFieldChoiceSet.""" - metadata = convert_dict_to_struct(metadata) + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.TunnelGroup: + """Create a new TunnelGroup.""" owner = convert_to_protobuf(owner, pb.Owner) - result = pb.CustomFieldChoiceSet( + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.TunnelGroup( name=name, + slug=slug, description=description, - base_choices=base_choices, - order_alphabetically=order_alphabetically, - extra_choices=extra_choices, - metadata=metadata, owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) return result -class JournalEntry: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.JournalEntry.""" +class TunnelTermination: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.TunnelTermination.""" def __new__( cls, - assigned_object_asn: str | ASN | pb.ASN | None = None, - assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, - assigned_object_aggregate: Aggregate | pb.Aggregate | None = None, - assigned_object_cable: Cable | pb.Cable | None = None, - assigned_object_cable_path: CablePath | pb.CablePath | None = None, - assigned_object_cable_termination: ( - CableTermination | pb.CableTermination | None - ) = None, - assigned_object_circuit: str | Circuit | pb.Circuit | None = None, - assigned_object_circuit_group: ( - str | CircuitGroup | pb.CircuitGroup | None - ) = None, - assigned_object_circuit_group_assignment: ( - CircuitGroupAssignment | pb.CircuitGroupAssignment | None + tunnel: str | Tunnel | pb.Tunnel | None = None, + role: str | None = None, + termination_asn: str | ASN | pb.ASN | None = None, + termination_asn_range: str | ASNRange | pb.ASNRange | None = None, + termination_aggregate: str | Aggregate | pb.Aggregate | None = None, + termination_cable: str | Cable | pb.Cable | None = None, + termination_cable_path: str | CablePath | pb.CablePath | None = None, + termination_cable_termination: ( + str | CableTermination | pb.CableTermination | None ) = None, - assigned_object_circuit_termination: ( - CircuitTermination | pb.CircuitTermination | None + termination_circuit: str | Circuit | pb.Circuit | None = None, + termination_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, + termination_circuit_group_assignment: ( + str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, - assigned_object_circuit_type: str | CircuitType | pb.CircuitType | None = None, - assigned_object_cluster: str | Cluster | pb.Cluster | None = None, - assigned_object_cluster_group: ( - str | ClusterGroup | pb.ClusterGroup | None + termination_circuit_termination: ( + str | CircuitTermination | pb.CircuitTermination | None ) = None, - assigned_object_cluster_type: str | ClusterType | pb.ClusterType | None = None, - assigned_object_console_port: str | ConsolePort | pb.ConsolePort | None = None, - assigned_object_console_server_port: ( + termination_circuit_type: str | CircuitType | pb.CircuitType | None = None, + termination_cluster: str | Cluster | pb.Cluster | None = None, + termination_cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, + termination_cluster_type: str | ClusterType | pb.ClusterType | None = None, + termination_console_port: str | ConsolePort | pb.ConsolePort | None = None, + termination_console_server_port: ( str | ConsoleServerPort | pb.ConsoleServerPort | None ) = None, - assigned_object_contact: str | Contact | pb.Contact | None = None, - assigned_object_contact_assignment: ( - ContactAssignment | pb.ContactAssignment | None - ) = None, - assigned_object_contact_group: ( - str | ContactGroup | pb.ContactGroup | None + termination_contact: str | Contact | pb.Contact | None = None, + termination_contact_assignment: ( + str | ContactAssignment | pb.ContactAssignment | None ) = None, - assigned_object_contact_role: str | ContactRole | pb.ContactRole | None = None, - assigned_object_custom_field: str | CustomField | pb.CustomField | None = None, - assigned_object_custom_field_choice_set: ( + termination_contact_group: str | ContactGroup | pb.ContactGroup | None = None, + termination_contact_role: str | ContactRole | pb.ContactRole | None = None, + termination_custom_field: str | CustomField | pb.CustomField | None = None, + termination_custom_field_choice_set: ( str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None ) = None, - assigned_object_device: str | Device | pb.Device | None = None, - assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, - assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, - assigned_object_device_type: str | DeviceType | pb.DeviceType | None = None, - assigned_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, - assigned_object_fhrp_group_assignment: ( - FHRPGroupAssignment | pb.FHRPGroupAssignment | None - ) = None, - assigned_object_front_port: str | FrontPort | pb.FrontPort | None = None, - assigned_object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, - assigned_object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, - assigned_object_ip_address: str | IPAddress | pb.IPAddress | None = None, - assigned_object_ip_range: IPRange | pb.IPRange | None = None, - assigned_object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, - assigned_object_ip_sec_profile: ( - str | IPSecProfile | pb.IPSecProfile | None + termination_custom_link: str | CustomLink | pb.CustomLink | None = None, + termination_device: str | Device | pb.Device | None = None, + termination_device_bay: str | DeviceBay | pb.DeviceBay | None = None, + termination_device_role: str | DeviceRole | pb.DeviceRole | None = None, + termination_device_type: str | DeviceType | pb.DeviceType | None = None, + termination_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, + termination_fhrp_group_assignment: ( + str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, - assigned_object_ip_sec_proposal: ( + termination_front_port: str | FrontPort | pb.FrontPort | None = None, + termination_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, + termination_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, + termination_ip_address: str | IPAddress | pb.IPAddress | None = None, + termination_ip_range: str | IPRange | pb.IPRange | None = None, + termination_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, + termination_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, + termination_ip_sec_proposal: ( str | IPSecProposal | pb.IPSecProposal | None ) = None, - assigned_object_interface: str | Interface | pb.Interface | None = None, - assigned_object_inventory_item: ( + termination_interface: str | Interface | pb.Interface | None = None, + termination_inventory_item: ( str | InventoryItem | pb.InventoryItem | None ) = None, - assigned_object_inventory_item_role: ( + termination_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - assigned_object_journal_entry: JournalEntry | pb.JournalEntry | None = None, - assigned_object_l2vpn: str | L2VPN | pb.L2VPN | None = None, - assigned_object_l2vpn_termination: ( - L2VPNTermination | pb.L2VPNTermination | None - ) = None, - assigned_object_location: str | Location | pb.Location | None = None, - assigned_object_mac_address: str | MACAddress | pb.MACAddress | None = None, - assigned_object_manufacturer: ( - str | Manufacturer | pb.Manufacturer | None + termination_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, + termination_l2vpn: str | L2VPN | pb.L2VPN | None = None, + termination_l2vpn_termination: ( + str | L2VPNTermination | pb.L2VPNTermination | None ) = None, - assigned_object_module: Module | pb.Module | None = None, - assigned_object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, - assigned_object_module_type: str | ModuleType | pb.ModuleType | None = None, - assigned_object_module_type_profile: ( + termination_location: str | Location | pb.Location | None = None, + termination_mac_address: str | MACAddress | pb.MACAddress | None = None, + termination_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, + termination_module: str | Module | pb.Module | None = None, + termination_module_bay: str | ModuleBay | pb.ModuleBay | None = None, + termination_module_type: str | ModuleType | pb.ModuleType | None = None, + termination_module_type_profile: ( str | ModuleTypeProfile | pb.ModuleTypeProfile | None ) = None, - assigned_object_platform: str | Platform | pb.Platform | None = None, - assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, - assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, - assigned_object_power_panel: str | PowerPanel | pb.PowerPanel | None = None, - assigned_object_power_port: str | PowerPort | pb.PowerPort | None = None, - assigned_object_prefix: str | Prefix | pb.Prefix | None = None, - assigned_object_provider: str | Provider | pb.Provider | None = None, - assigned_object_provider_account: ( - str | ProviderAccount | pb.ProviderAccount | None - ) = None, - assigned_object_provider_network: ( - str | ProviderNetwork | pb.ProviderNetwork | None - ) = None, - assigned_object_rir: str | RIR | pb.RIR | None = None, - assigned_object_rack: str | Rack | pb.Rack | None = None, - assigned_object_rack_reservation: ( - RackReservation | pb.RackReservation | None - ) = None, - assigned_object_rack_role: str | RackRole | pb.RackRole | None = None, - assigned_object_rack_type: str | RackType | pb.RackType | None = None, - assigned_object_rear_port: str | RearPort | pb.RearPort | None = None, - assigned_object_region: str | Region | pb.Region | None = None, - assigned_object_role: str | Role | pb.Role | None = None, - assigned_object_route_target: str | RouteTarget | pb.RouteTarget | None = None, - assigned_object_service: str | Service | pb.Service | None = None, - assigned_object_site: str | Site | pb.Site | None = None, - assigned_object_site_group: str | SiteGroup | pb.SiteGroup | None = None, - assigned_object_tag: str | Tag | pb.Tag | None = None, - assigned_object_tenant: str | Tenant | pb.Tenant | None = None, - assigned_object_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, - assigned_object_tunnel: str | Tunnel | pb.Tunnel | None = None, - assigned_object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - assigned_object_tunnel_termination: ( - TunnelTermination | pb.TunnelTermination | None + termination_owner: str | Owner | pb.Owner | None = None, + termination_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + termination_platform: str | Platform | pb.Platform | None = None, + termination_power_feed: str | PowerFeed | pb.PowerFeed | None = None, + termination_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, + termination_power_panel: str | PowerPanel | pb.PowerPanel | None = None, + termination_power_port: str | PowerPort | pb.PowerPort | None = None, + termination_prefix: str | Prefix | pb.Prefix | None = None, + termination_provider: str | Provider | pb.Provider | None = None, + termination_provider_account: ( + str | ProviderAccount | pb.ProviderAccount | None ) = None, - assigned_object_vlan: str | VLAN | pb.VLAN | None = None, - assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, - assigned_object_vlan_translation_policy: ( + termination_provider_network: ( + str | ProviderNetwork | pb.ProviderNetwork | None + ) = None, + termination_rir: str | RIR | pb.RIR | None = None, + termination_rack: str | Rack | pb.Rack | None = None, + termination_rack_reservation: ( + str | RackReservation | pb.RackReservation | None + ) = None, + termination_rack_role: str | RackRole | pb.RackRole | None = None, + termination_rack_type: str | RackType | pb.RackType | None = None, + termination_rear_port: str | RearPort | pb.RearPort | None = None, + termination_region: str | Region | pb.Region | None = None, + termination_role: str | Role | pb.Role | None = None, + termination_route_target: str | RouteTarget | pb.RouteTarget | None = None, + termination_service: str | Service | pb.Service | None = None, + termination_site: str | Site | pb.Site | None = None, + termination_site_group: str | SiteGroup | pb.SiteGroup | None = None, + termination_tag: str | Tag | pb.Tag | None = None, + termination_tenant: str | Tenant | pb.Tenant | None = None, + termination_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, + termination_tunnel: str | Tunnel | pb.Tunnel | None = None, + termination_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, + termination_tunnel_termination: ( + str | TunnelTermination | pb.TunnelTermination | None + ) = None, + termination_vlan: str | VLAN | pb.VLAN | None = None, + termination_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, + termination_vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, - assigned_object_vlan_translation_rule: ( - VLANTranslationRule | pb.VLANTranslationRule | None + termination_vlan_translation_rule: ( + str | VLANTranslationRule | pb.VLANTranslationRule | None ) = None, - assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, - assigned_object_vrf: str | VRF | pb.VRF | None = None, - assigned_object_virtual_chassis: ( + termination_vm_interface: str | VMInterface | pb.VMInterface | None = None, + termination_vrf: str | VRF | pb.VRF | None = None, + termination_virtual_chassis: ( str | VirtualChassis | pb.VirtualChassis | None ) = None, - assigned_object_virtual_circuit: ( + termination_virtual_circuit: ( str | VirtualCircuit | pb.VirtualCircuit | None ) = None, - assigned_object_virtual_circuit_termination: ( - VirtualCircuitTermination | pb.VirtualCircuitTermination | None + termination_virtual_circuit_termination: ( + str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, - assigned_object_virtual_circuit_type: ( + termination_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None ) = None, - assigned_object_virtual_device_context: ( + termination_virtual_device_context: ( str | VirtualDeviceContext | pb.VirtualDeviceContext | None ) = None, - assigned_object_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, - assigned_object_virtual_machine: ( + termination_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, + termination_virtual_machine: ( str | VirtualMachine | pb.VirtualMachine | None ) = None, - assigned_object_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, - assigned_object_wireless_lan_group: ( + termination_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, + termination_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - assigned_object_wireless_link: WirelessLink | pb.WirelessLink | None = None, - assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, - assigned_object_owner: str | Owner | pb.Owner | None = None, - assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, - kind: str | None = None, - comments: str | None = None, + termination_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + outside_ip: str | IPAddress | pb.IPAddress | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.JournalEntry: - """Create a new JournalEntry.""" - assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) - assigned_object_asn_range = convert_to_protobuf( - assigned_object_asn_range, pb.ASNRange - ) - assigned_object_aggregate = convert_to_protobuf( - assigned_object_aggregate, pb.Aggregate - ) - assigned_object_cable = convert_to_protobuf(assigned_object_cable, pb.Cable) - assigned_object_cable_path = convert_to_protobuf( - assigned_object_cable_path, pb.CablePath - ) - assigned_object_cable_termination = convert_to_protobuf( - assigned_object_cable_termination, pb.CableTermination - ) - assigned_object_circuit = convert_to_protobuf( - assigned_object_circuit, pb.Circuit + ) -> pb.TunnelTermination: + """Create a new TunnelTermination.""" + tunnel = convert_to_protobuf(tunnel, pb.Tunnel) + termination_asn = convert_to_protobuf(termination_asn, pb.ASN) + termination_asn_range = convert_to_protobuf(termination_asn_range, pb.ASNRange) + termination_aggregate = convert_to_protobuf(termination_aggregate, pb.Aggregate) + termination_cable = convert_to_protobuf(termination_cable, pb.Cable) + termination_cable_path = convert_to_protobuf( + termination_cable_path, pb.CablePath ) - assigned_object_circuit_group = convert_to_protobuf( - assigned_object_circuit_group, pb.CircuitGroup + termination_circuit = convert_to_protobuf(termination_circuit, pb.Circuit) + termination_circuit_group = convert_to_protobuf( + termination_circuit_group, pb.CircuitGroup ) - assigned_object_circuit_group_assignment = convert_to_protobuf( - assigned_object_circuit_group_assignment, pb.CircuitGroupAssignment + termination_circuit_group_assignment = convert_to_protobuf( + termination_circuit_group_assignment, pb.CircuitGroupAssignment ) - assigned_object_circuit_termination = convert_to_protobuf( - assigned_object_circuit_termination, pb.CircuitTermination + termination_circuit_termination = convert_to_protobuf( + termination_circuit_termination, pb.CircuitTermination ) - assigned_object_circuit_type = convert_to_protobuf( - assigned_object_circuit_type, pb.CircuitType + termination_circuit_type = convert_to_protobuf( + termination_circuit_type, pb.CircuitType ) - assigned_object_cluster = convert_to_protobuf( - assigned_object_cluster, pb.Cluster + termination_cluster = convert_to_protobuf(termination_cluster, pb.Cluster) + termination_cluster_group = convert_to_protobuf( + termination_cluster_group, pb.ClusterGroup ) - assigned_object_cluster_group = convert_to_protobuf( - assigned_object_cluster_group, pb.ClusterGroup + termination_cluster_type = convert_to_protobuf( + termination_cluster_type, pb.ClusterType ) - assigned_object_cluster_type = convert_to_protobuf( - assigned_object_cluster_type, pb.ClusterType + termination_console_port = convert_to_protobuf( + termination_console_port, pb.ConsolePort ) - assigned_object_console_port = convert_to_protobuf( - assigned_object_console_port, pb.ConsolePort + termination_console_server_port = convert_to_protobuf( + termination_console_server_port, pb.ConsoleServerPort ) - assigned_object_console_server_port = convert_to_protobuf( - assigned_object_console_server_port, pb.ConsoleServerPort + termination_contact = convert_to_protobuf(termination_contact, pb.Contact) + termination_contact_assignment = convert_to_protobuf( + termination_contact_assignment, pb.ContactAssignment ) - assigned_object_contact = convert_to_protobuf( - assigned_object_contact, pb.Contact + termination_contact_group = convert_to_protobuf( + termination_contact_group, pb.ContactGroup ) - assigned_object_contact_assignment = convert_to_protobuf( - assigned_object_contact_assignment, pb.ContactAssignment + termination_contact_role = convert_to_protobuf( + termination_contact_role, pb.ContactRole ) - assigned_object_contact_group = convert_to_protobuf( - assigned_object_contact_group, pb.ContactGroup + termination_custom_field = convert_to_protobuf( + termination_custom_field, pb.CustomField ) - assigned_object_contact_role = convert_to_protobuf( - assigned_object_contact_role, pb.ContactRole + termination_custom_field_choice_set = convert_to_protobuf( + termination_custom_field_choice_set, pb.CustomFieldChoiceSet ) - assigned_object_custom_field = convert_to_protobuf( - assigned_object_custom_field, pb.CustomField + termination_custom_link = convert_to_protobuf( + termination_custom_link, pb.CustomLink ) - assigned_object_custom_field_choice_set = convert_to_protobuf( - assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet + termination_device = convert_to_protobuf(termination_device, pb.Device) + termination_device_bay = convert_to_protobuf( + termination_device_bay, pb.DeviceBay ) - assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) - assigned_object_device_bay = convert_to_protobuf( - assigned_object_device_bay, pb.DeviceBay + termination_device_role = convert_to_protobuf( + termination_device_role, pb.DeviceRole ) - assigned_object_device_role = convert_to_protobuf( - assigned_object_device_role, pb.DeviceRole + termination_device_type = convert_to_protobuf( + termination_device_type, pb.DeviceType ) - assigned_object_device_type = convert_to_protobuf( - assigned_object_device_type, pb.DeviceType + termination_fhrp_group = convert_to_protobuf( + termination_fhrp_group, pb.FHRPGroup ) - assigned_object_fhrp_group = convert_to_protobuf( - assigned_object_fhrp_group, pb.FHRPGroup + termination_fhrp_group_assignment = convert_to_protobuf( + termination_fhrp_group_assignment, pb.FHRPGroupAssignment ) - assigned_object_fhrp_group_assignment = convert_to_protobuf( - assigned_object_fhrp_group_assignment, pb.FHRPGroupAssignment + termination_front_port = convert_to_protobuf( + termination_front_port, pb.FrontPort ) - assigned_object_front_port = convert_to_protobuf( - assigned_object_front_port, pb.FrontPort + termination_ike_policy = convert_to_protobuf( + termination_ike_policy, pb.IKEPolicy ) - assigned_object_ike_policy = convert_to_protobuf( - assigned_object_ike_policy, pb.IKEPolicy + termination_ike_proposal = convert_to_protobuf( + termination_ike_proposal, pb.IKEProposal ) - assigned_object_ike_proposal = convert_to_protobuf( - assigned_object_ike_proposal, pb.IKEProposal + termination_ip_address = convert_to_protobuf( + termination_ip_address, pb.IPAddress ) - assigned_object_ip_address = convert_to_protobuf( - assigned_object_ip_address, pb.IPAddress + termination_ip_range = convert_to_protobuf(termination_ip_range, pb.IPRange) + termination_ip_sec_policy = convert_to_protobuf( + termination_ip_sec_policy, pb.IPSecPolicy ) - assigned_object_ip_range = convert_to_protobuf( - assigned_object_ip_range, pb.IPRange + termination_ip_sec_profile = convert_to_protobuf( + termination_ip_sec_profile, pb.IPSecProfile ) - assigned_object_ip_sec_policy = convert_to_protobuf( - assigned_object_ip_sec_policy, pb.IPSecPolicy + termination_ip_sec_proposal = convert_to_protobuf( + termination_ip_sec_proposal, pb.IPSecProposal ) - assigned_object_ip_sec_profile = convert_to_protobuf( - assigned_object_ip_sec_profile, pb.IPSecProfile + termination_interface = convert_to_protobuf(termination_interface, pb.Interface) + termination_inventory_item = convert_to_protobuf( + termination_inventory_item, pb.InventoryItem ) - assigned_object_ip_sec_proposal = convert_to_protobuf( - assigned_object_ip_sec_proposal, pb.IPSecProposal + termination_inventory_item_role = convert_to_protobuf( + termination_inventory_item_role, pb.InventoryItemRole ) - assigned_object_interface = convert_to_protobuf( - assigned_object_interface, pb.Interface + termination_journal_entry = convert_to_protobuf( + termination_journal_entry, pb.JournalEntry ) - assigned_object_inventory_item = convert_to_protobuf( - assigned_object_inventory_item, pb.InventoryItem + termination_l2vpn = convert_to_protobuf(termination_l2vpn, pb.L2VPN) + termination_l2vpn_termination = convert_to_protobuf( + termination_l2vpn_termination, pb.L2VPNTermination ) - assigned_object_inventory_item_role = convert_to_protobuf( - assigned_object_inventory_item_role, pb.InventoryItemRole + termination_location = convert_to_protobuf(termination_location, pb.Location) + termination_mac_address = convert_to_protobuf( + termination_mac_address, pb.MACAddress ) - assigned_object_journal_entry = convert_to_protobuf( - assigned_object_journal_entry, pb.JournalEntry + termination_manufacturer = convert_to_protobuf( + termination_manufacturer, pb.Manufacturer ) - assigned_object_l2vpn = convert_to_protobuf(assigned_object_l2vpn, pb.L2VPN) - assigned_object_l2vpn_termination = convert_to_protobuf( - assigned_object_l2vpn_termination, pb.L2VPNTermination + termination_module = convert_to_protobuf(termination_module, pb.Module) + termination_module_bay = convert_to_protobuf( + termination_module_bay, pb.ModuleBay ) - assigned_object_location = convert_to_protobuf( - assigned_object_location, pb.Location + termination_module_type = convert_to_protobuf( + termination_module_type, pb.ModuleType ) - assigned_object_mac_address = convert_to_protobuf( - assigned_object_mac_address, pb.MACAddress + termination_module_type_profile = convert_to_protobuf( + termination_module_type_profile, pb.ModuleTypeProfile ) - assigned_object_manufacturer = convert_to_protobuf( - assigned_object_manufacturer, pb.Manufacturer + termination_owner = convert_to_protobuf(termination_owner, pb.Owner) + termination_owner_group = convert_to_protobuf( + termination_owner_group, pb.OwnerGroup ) - assigned_object_module = convert_to_protobuf(assigned_object_module, pb.Module) - assigned_object_module_bay = convert_to_protobuf( - assigned_object_module_bay, pb.ModuleBay + termination_platform = convert_to_protobuf(termination_platform, pb.Platform) + termination_power_feed = convert_to_protobuf( + termination_power_feed, pb.PowerFeed ) - assigned_object_module_type = convert_to_protobuf( - assigned_object_module_type, pb.ModuleType + termination_power_outlet = convert_to_protobuf( + termination_power_outlet, pb.PowerOutlet ) - assigned_object_module_type_profile = convert_to_protobuf( - assigned_object_module_type_profile, pb.ModuleTypeProfile + termination_power_panel = convert_to_protobuf( + termination_power_panel, pb.PowerPanel ) - assigned_object_platform = convert_to_protobuf( - assigned_object_platform, pb.Platform + termination_power_port = convert_to_protobuf( + termination_power_port, pb.PowerPort ) - assigned_object_power_feed = convert_to_protobuf( - assigned_object_power_feed, pb.PowerFeed + termination_prefix = convert_to_protobuf(termination_prefix, pb.Prefix) + termination_provider = convert_to_protobuf(termination_provider, pb.Provider) + termination_provider_account = convert_to_protobuf( + termination_provider_account, pb.ProviderAccount ) - assigned_object_power_outlet = convert_to_protobuf( - assigned_object_power_outlet, pb.PowerOutlet + termination_provider_network = convert_to_protobuf( + termination_provider_network, pb.ProviderNetwork ) - assigned_object_power_panel = convert_to_protobuf( - assigned_object_power_panel, pb.PowerPanel + termination_rir = convert_to_protobuf(termination_rir, pb.RIR) + termination_rack = convert_to_protobuf(termination_rack, pb.Rack) + termination_rack_reservation = convert_to_protobuf( + termination_rack_reservation, pb.RackReservation ) - assigned_object_power_port = convert_to_protobuf( - assigned_object_power_port, pb.PowerPort + termination_rack_role = convert_to_protobuf(termination_rack_role, pb.RackRole) + termination_rack_type = convert_to_protobuf(termination_rack_type, pb.RackType) + termination_rear_port = convert_to_protobuf(termination_rear_port, pb.RearPort) + termination_region = convert_to_protobuf(termination_region, pb.Region) + termination_role = convert_to_protobuf(termination_role, pb.Role) + termination_route_target = convert_to_protobuf( + termination_route_target, pb.RouteTarget ) - assigned_object_prefix = convert_to_protobuf(assigned_object_prefix, pb.Prefix) - assigned_object_provider = convert_to_protobuf( - assigned_object_provider, pb.Provider + termination_service = convert_to_protobuf(termination_service, pb.Service) + termination_site = convert_to_protobuf(termination_site, pb.Site) + termination_site_group = convert_to_protobuf( + termination_site_group, pb.SiteGroup ) - assigned_object_provider_account = convert_to_protobuf( - assigned_object_provider_account, pb.ProviderAccount + termination_tag = convert_to_protobuf(termination_tag, pb.Tag) + termination_tenant = convert_to_protobuf(termination_tenant, pb.Tenant) + termination_tenant_group = convert_to_protobuf( + termination_tenant_group, pb.TenantGroup ) - assigned_object_provider_network = convert_to_protobuf( - assigned_object_provider_network, pb.ProviderNetwork + termination_tunnel = convert_to_protobuf(termination_tunnel, pb.Tunnel) + termination_tunnel_group = convert_to_protobuf( + termination_tunnel_group, pb.TunnelGroup ) - assigned_object_rir = convert_to_protobuf(assigned_object_rir, pb.RIR) - assigned_object_rack = convert_to_protobuf(assigned_object_rack, pb.Rack) - assigned_object_rack_reservation = convert_to_protobuf( - assigned_object_rack_reservation, pb.RackReservation + termination_tunnel_termination = convert_to_protobuf( + termination_tunnel_termination, pb.TunnelTermination ) - assigned_object_rack_role = convert_to_protobuf( - assigned_object_rack_role, pb.RackRole + termination_vlan = convert_to_protobuf(termination_vlan, pb.VLAN) + termination_vlan_group = convert_to_protobuf( + termination_vlan_group, pb.VLANGroup ) - assigned_object_rack_type = convert_to_protobuf( - assigned_object_rack_type, pb.RackType + termination_vlan_translation_policy = convert_to_protobuf( + termination_vlan_translation_policy, pb.VLANTranslationPolicy ) - assigned_object_rear_port = convert_to_protobuf( - assigned_object_rear_port, pb.RearPort + termination_vlan_translation_rule = convert_to_protobuf( + termination_vlan_translation_rule, pb.VLANTranslationRule ) - assigned_object_region = convert_to_protobuf(assigned_object_region, pb.Region) - assigned_object_role = convert_to_protobuf(assigned_object_role, pb.Role) - assigned_object_route_target = convert_to_protobuf( - assigned_object_route_target, pb.RouteTarget + termination_vm_interface = convert_to_protobuf( + termination_vm_interface, pb.VMInterface ) - assigned_object_service = convert_to_protobuf( - assigned_object_service, pb.Service + termination_vrf = convert_to_protobuf(termination_vrf, pb.VRF) + termination_virtual_chassis = convert_to_protobuf( + termination_virtual_chassis, pb.VirtualChassis ) - assigned_object_site = convert_to_protobuf(assigned_object_site, pb.Site) - assigned_object_site_group = convert_to_protobuf( - assigned_object_site_group, pb.SiteGroup + termination_virtual_circuit = convert_to_protobuf( + termination_virtual_circuit, pb.VirtualCircuit ) - assigned_object_tag = convert_to_protobuf(assigned_object_tag, pb.Tag) - assigned_object_tenant = convert_to_protobuf(assigned_object_tenant, pb.Tenant) - assigned_object_tenant_group = convert_to_protobuf( - assigned_object_tenant_group, pb.TenantGroup + termination_virtual_circuit_termination = convert_to_protobuf( + termination_virtual_circuit_termination, pb.VirtualCircuitTermination ) - assigned_object_tunnel = convert_to_protobuf(assigned_object_tunnel, pb.Tunnel) - assigned_object_tunnel_group = convert_to_protobuf( - assigned_object_tunnel_group, pb.TunnelGroup + termination_virtual_circuit_type = convert_to_protobuf( + termination_virtual_circuit_type, pb.VirtualCircuitType ) - assigned_object_tunnel_termination = convert_to_protobuf( - assigned_object_tunnel_termination, pb.TunnelTermination + termination_virtual_device_context = convert_to_protobuf( + termination_virtual_device_context, pb.VirtualDeviceContext ) - assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) - assigned_object_vlan_group = convert_to_protobuf( - assigned_object_vlan_group, pb.VLANGroup + termination_virtual_disk = convert_to_protobuf( + termination_virtual_disk, pb.VirtualDisk ) - assigned_object_vlan_translation_policy = convert_to_protobuf( - assigned_object_vlan_translation_policy, pb.VLANTranslationPolicy + termination_virtual_machine = convert_to_protobuf( + termination_virtual_machine, pb.VirtualMachine ) - assigned_object_vlan_translation_rule = convert_to_protobuf( - assigned_object_vlan_translation_rule, pb.VLANTranslationRule + termination_wireless_lan = convert_to_protobuf( + termination_wireless_lan, pb.WirelessLAN ) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface + termination_wireless_lan_group = convert_to_protobuf( + termination_wireless_lan_group, pb.WirelessLANGroup ) - assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) - assigned_object_virtual_chassis = convert_to_protobuf( - assigned_object_virtual_chassis, pb.VirtualChassis + termination_wireless_link = convert_to_protobuf( + termination_wireless_link, pb.WirelessLink ) - assigned_object_virtual_circuit = convert_to_protobuf( - assigned_object_virtual_circuit, pb.VirtualCircuit + outside_ip = convert_to_protobuf(outside_ip, pb.IPAddress) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.TunnelTermination( + tunnel=tunnel, + role=role, + termination_asn=termination_asn, + termination_asn_range=termination_asn_range, + termination_aggregate=termination_aggregate, + termination_cable=termination_cable, + termination_cable_path=termination_cable_path, + termination_cable_termination=termination_cable_termination, + termination_circuit=termination_circuit, + termination_circuit_group=termination_circuit_group, + termination_circuit_group_assignment=termination_circuit_group_assignment, + termination_circuit_termination=termination_circuit_termination, + termination_circuit_type=termination_circuit_type, + termination_cluster=termination_cluster, + termination_cluster_group=termination_cluster_group, + termination_cluster_type=termination_cluster_type, + termination_console_port=termination_console_port, + termination_console_server_port=termination_console_server_port, + termination_contact=termination_contact, + termination_contact_assignment=termination_contact_assignment, + termination_contact_group=termination_contact_group, + termination_contact_role=termination_contact_role, + termination_custom_field=termination_custom_field, + termination_custom_field_choice_set=termination_custom_field_choice_set, + termination_custom_link=termination_custom_link, + termination_device=termination_device, + termination_device_bay=termination_device_bay, + termination_device_role=termination_device_role, + termination_device_type=termination_device_type, + termination_fhrp_group=termination_fhrp_group, + termination_fhrp_group_assignment=termination_fhrp_group_assignment, + termination_front_port=termination_front_port, + termination_ike_policy=termination_ike_policy, + termination_ike_proposal=termination_ike_proposal, + termination_ip_address=termination_ip_address, + termination_ip_range=termination_ip_range, + termination_ip_sec_policy=termination_ip_sec_policy, + termination_ip_sec_profile=termination_ip_sec_profile, + termination_ip_sec_proposal=termination_ip_sec_proposal, + termination_interface=termination_interface, + termination_inventory_item=termination_inventory_item, + termination_inventory_item_role=termination_inventory_item_role, + termination_journal_entry=termination_journal_entry, + termination_l2vpn=termination_l2vpn, + termination_l2vpn_termination=termination_l2vpn_termination, + termination_location=termination_location, + termination_mac_address=termination_mac_address, + termination_manufacturer=termination_manufacturer, + termination_module=termination_module, + termination_module_bay=termination_module_bay, + termination_module_type=termination_module_type, + termination_module_type_profile=termination_module_type_profile, + termination_owner=termination_owner, + termination_owner_group=termination_owner_group, + termination_platform=termination_platform, + termination_power_feed=termination_power_feed, + termination_power_outlet=termination_power_outlet, + termination_power_panel=termination_power_panel, + termination_power_port=termination_power_port, + termination_prefix=termination_prefix, + termination_provider=termination_provider, + termination_provider_account=termination_provider_account, + termination_provider_network=termination_provider_network, + termination_rir=termination_rir, + termination_rack=termination_rack, + termination_rack_reservation=termination_rack_reservation, + termination_rack_role=termination_rack_role, + termination_rack_type=termination_rack_type, + termination_rear_port=termination_rear_port, + termination_region=termination_region, + termination_role=termination_role, + termination_route_target=termination_route_target, + termination_service=termination_service, + termination_site=termination_site, + termination_site_group=termination_site_group, + termination_tag=termination_tag, + termination_tenant=termination_tenant, + termination_tenant_group=termination_tenant_group, + termination_tunnel=termination_tunnel, + termination_tunnel_group=termination_tunnel_group, + termination_tunnel_termination=termination_tunnel_termination, + termination_vlan=termination_vlan, + termination_vlan_group=termination_vlan_group, + termination_vlan_translation_policy=termination_vlan_translation_policy, + termination_vlan_translation_rule=termination_vlan_translation_rule, + termination_vm_interface=termination_vm_interface, + termination_vrf=termination_vrf, + termination_virtual_chassis=termination_virtual_chassis, + termination_virtual_circuit=termination_virtual_circuit, + termination_virtual_circuit_termination=termination_virtual_circuit_termination, + termination_virtual_circuit_type=termination_virtual_circuit_type, + termination_virtual_device_context=termination_virtual_device_context, + termination_virtual_disk=termination_virtual_disk, + termination_virtual_machine=termination_virtual_machine, + termination_wireless_lan=termination_wireless_lan, + termination_wireless_lan_group=termination_wireless_lan_group, + termination_wireless_link=termination_wireless_link, + outside_ip=outside_ip, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_virtual_circuit_termination = convert_to_protobuf( - assigned_object_virtual_circuit_termination, pb.VirtualCircuitTermination + return result + + +class VLAN: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLAN.""" + + def __new__( + cls, + site: str | Site | pb.Site | None = None, + group: str | VLANGroup | pb.VLANGroup | None = None, + vid: int | None = None, + name: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + status: str | None = None, + role: str | Role | pb.Role | None = None, + description: str | None = None, + qinq_role: str | None = None, + qinq_svlan: str | VLAN | pb.VLAN | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VLAN: + """Create a new VLAN.""" + site = convert_to_protobuf(site, pb.Site) + group = convert_to_protobuf(group, pb.VLANGroup) + tenant = convert_to_protobuf(tenant, pb.Tenant) + role = convert_to_protobuf(role, pb.Role) + qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VLAN( + site=site, + group=group, + vid=vid, + name=name, + tenant=tenant, + status=status, + role=role, + description=description, + qinq_role=qinq_role, + qinq_svlan=qinq_svlan, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_virtual_circuit_type = convert_to_protobuf( - assigned_object_virtual_circuit_type, pb.VirtualCircuitType + return result + + +class VLANGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANGroup.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + scope_cluster: str | Cluster | pb.Cluster | None = None, + scope_cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, + scope_location: str | Location | pb.Location | None = None, + scope_rack: str | Rack | pb.Rack | None = None, + scope_region: str | Region | pb.Region | None = None, + scope_site: str | Site | pb.Site | None = None, + scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, + vid_ranges: list[int] | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VLANGroup: + """Create a new VLANGroup.""" + scope_cluster = convert_to_protobuf(scope_cluster, pb.Cluster) + scope_cluster_group = convert_to_protobuf(scope_cluster_group, pb.ClusterGroup) + scope_location = convert_to_protobuf(scope_location, pb.Location) + scope_rack = convert_to_protobuf(scope_rack, pb.Rack) + scope_region = convert_to_protobuf(scope_region, pb.Region) + scope_site = convert_to_protobuf(scope_site, pb.Site) + scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VLANGroup( + name=name, + slug=slug, + scope_cluster=scope_cluster, + scope_cluster_group=scope_cluster_group, + scope_location=scope_location, + scope_rack=scope_rack, + scope_region=scope_region, + scope_site=scope_site, + scope_site_group=scope_site_group, + vid_ranges=vid_ranges, + tenant=tenant, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_virtual_device_context = convert_to_protobuf( - assigned_object_virtual_device_context, pb.VirtualDeviceContext + return result + + +class VLANTranslationPolicy: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANTranslationPolicy.""" + + def __new__( + cls, + name: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VLANTranslationPolicy: + """Create a new VLANTranslationPolicy.""" + owner = convert_to_protobuf(owner, pb.Owner) + metadata = convert_dict_to_struct(metadata) + result = pb.VLANTranslationPolicy( + name=name, + description=description, + owner=owner, + comments=comments, + metadata=metadata, ) - assigned_object_virtual_disk = convert_to_protobuf( - assigned_object_virtual_disk, pb.VirtualDisk + return result + + +class VLANTranslationRule: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VLANTranslationRule.""" + + def __new__( + cls, + policy: str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None = None, + local_vid: int | None = None, + remote_vid: int | None = None, + description: str | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VLANTranslationRule: + """Create a new VLANTranslationRule.""" + policy = convert_to_protobuf(policy, pb.VLANTranslationPolicy) + metadata = convert_dict_to_struct(metadata) + result = pb.VLANTranslationRule( + policy=policy, + local_vid=local_vid, + remote_vid=remote_vid, + description=description, + metadata=metadata, ) - assigned_object_virtual_machine = convert_to_protobuf( - assigned_object_virtual_machine, pb.VirtualMachine + return result + + +class VMInterface: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VMInterface.""" + + def __new__( + cls, + virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, + name: str | None = None, + enabled: bool | None = None, + parent: str | VMInterface | pb.VMInterface | None = None, + bridge: str | VMInterface | pb.VMInterface | None = None, + mtu: int | None = None, + primary_mac_address: str | MACAddress | pb.MACAddress | None = None, + description: str | None = None, + mode: str | None = None, + untagged_vlan: str | VLAN | pb.VLAN | None = None, + tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, + qinq_svlan: str | VLAN | pb.VLAN | None = None, + vlan_translation_policy: ( + str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None + ) = None, + vrf: str | VRF | pb.VRF | None = None, + owner: str | Owner | pb.Owner | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VMInterface: + """Create a new VMInterface.""" + virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) + parent = convert_to_protobuf(parent, pb.VMInterface) + bridge = convert_to_protobuf(bridge, pb.VMInterface) + primary_mac_address = convert_to_protobuf(primary_mac_address, pb.MACAddress) + untagged_vlan = convert_to_protobuf(untagged_vlan, pb.VLAN) + tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) + qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) + vlan_translation_policy = convert_to_protobuf( + vlan_translation_policy, pb.VLANTranslationPolicy ) - assigned_object_wireless_lan = convert_to_protobuf( - assigned_object_wireless_lan, pb.WirelessLAN + vrf = convert_to_protobuf(vrf, pb.VRF) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VMInterface( + virtual_machine=virtual_machine, + name=name, + enabled=enabled, + parent=parent, + bridge=bridge, + mtu=mtu, + primary_mac_address=primary_mac_address, + description=description, + mode=mode, + untagged_vlan=untagged_vlan, + tagged_vlans=tagged_vlans, + qinq_svlan=qinq_svlan, + vlan_translation_policy=vlan_translation_policy, + vrf=vrf, + owner=owner, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_wireless_lan_group = convert_to_protobuf( - assigned_object_wireless_lan_group, pb.WirelessLANGroup + return result + + +class VRF: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VRF.""" + + def __new__( + cls, + name: str | None = None, + rd: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + enforce_unique: bool | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, + export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VRF: + """Create a new VRF.""" + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) + export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VRF( + name=name, + rd=rd, + tenant=tenant, + enforce_unique=enforce_unique, + description=description, + owner=owner, + comments=comments, + import_targets=import_targets, + export_targets=export_targets, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_wireless_link = convert_to_protobuf( - assigned_object_wireless_link, pb.WirelessLink + return result + + +class VirtualChassis: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualChassis.""" + + def __new__( + cls, + name: str | None = None, + domain: str | None = None, + master: str | Device | pb.Device | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualChassis: + """Create a new VirtualChassis.""" + master = convert_to_protobuf(master, pb.Device) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VirtualChassis( + name=name, + domain=domain, + master=master, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_custom_link = convert_to_protobuf( - assigned_object_custom_link, pb.CustomLink + return result + + +class VirtualCircuit: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuit.""" + + def __new__( + cls, + cid: str | None = None, + provider_network: str | ProviderNetwork | pb.ProviderNetwork | None = None, + provider_account: str | ProviderAccount | pb.ProviderAccount | None = None, + type: str | VirtualCircuitType | pb.VirtualCircuitType | None = None, + status: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualCircuit: + """Create a new VirtualCircuit.""" + provider_network = convert_to_protobuf(provider_network, pb.ProviderNetwork) + provider_account = convert_to_protobuf(provider_account, pb.ProviderAccount) + type = convert_to_protobuf(type, pb.VirtualCircuitType) + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VirtualCircuit( + cid=cid, + provider_network=provider_network, + provider_account=provider_account, + type=type, + status=status, + tenant=tenant, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) - assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) - assigned_object_owner_group = convert_to_protobuf( - assigned_object_owner_group, pb.OwnerGroup + return result + + +class VirtualCircuitTermination: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuitTermination.""" + + def __new__( + cls, + virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, + role: str | None = None, + interface: str | Interface | pb.Interface | None = None, + description: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualCircuitTermination: + """Create a new VirtualCircuitTermination.""" + virtual_circuit = convert_to_protobuf(virtual_circuit, pb.VirtualCircuit) + interface = convert_to_protobuf(interface, pb.Interface) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VirtualCircuitTermination( + virtual_circuit=virtual_circuit, + role=role, + interface=interface, + description=description, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) + return result + + +class VirtualCircuitType: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualCircuitType.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + color: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualCircuitType: + """Create a new VirtualCircuitType.""" + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.JournalEntry( - assigned_object_asn=assigned_object_asn, - assigned_object_asn_range=assigned_object_asn_range, - assigned_object_aggregate=assigned_object_aggregate, - assigned_object_cable=assigned_object_cable, - assigned_object_cable_path=assigned_object_cable_path, - assigned_object_cable_termination=assigned_object_cable_termination, - assigned_object_circuit=assigned_object_circuit, - assigned_object_circuit_group=assigned_object_circuit_group, - assigned_object_circuit_group_assignment=assigned_object_circuit_group_assignment, - assigned_object_circuit_termination=assigned_object_circuit_termination, - assigned_object_circuit_type=assigned_object_circuit_type, - assigned_object_cluster=assigned_object_cluster, - assigned_object_cluster_group=assigned_object_cluster_group, - assigned_object_cluster_type=assigned_object_cluster_type, - assigned_object_console_port=assigned_object_console_port, - assigned_object_console_server_port=assigned_object_console_server_port, - assigned_object_contact=assigned_object_contact, - assigned_object_contact_assignment=assigned_object_contact_assignment, - assigned_object_contact_group=assigned_object_contact_group, - assigned_object_contact_role=assigned_object_contact_role, - assigned_object_custom_field=assigned_object_custom_field, - assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, - assigned_object_device=assigned_object_device, - assigned_object_device_bay=assigned_object_device_bay, - assigned_object_device_role=assigned_object_device_role, - assigned_object_device_type=assigned_object_device_type, - assigned_object_fhrp_group=assigned_object_fhrp_group, - assigned_object_fhrp_group_assignment=assigned_object_fhrp_group_assignment, - assigned_object_front_port=assigned_object_front_port, - assigned_object_ike_policy=assigned_object_ike_policy, - assigned_object_ike_proposal=assigned_object_ike_proposal, - assigned_object_ip_address=assigned_object_ip_address, - assigned_object_ip_range=assigned_object_ip_range, - assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, - assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, - assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, - assigned_object_interface=assigned_object_interface, - assigned_object_inventory_item=assigned_object_inventory_item, - assigned_object_inventory_item_role=assigned_object_inventory_item_role, - assigned_object_journal_entry=assigned_object_journal_entry, - assigned_object_l2vpn=assigned_object_l2vpn, - assigned_object_l2vpn_termination=assigned_object_l2vpn_termination, - assigned_object_location=assigned_object_location, - assigned_object_mac_address=assigned_object_mac_address, - assigned_object_manufacturer=assigned_object_manufacturer, - assigned_object_module=assigned_object_module, - assigned_object_module_bay=assigned_object_module_bay, - assigned_object_module_type=assigned_object_module_type, - assigned_object_module_type_profile=assigned_object_module_type_profile, - assigned_object_platform=assigned_object_platform, - assigned_object_power_feed=assigned_object_power_feed, - assigned_object_power_outlet=assigned_object_power_outlet, - assigned_object_power_panel=assigned_object_power_panel, - assigned_object_power_port=assigned_object_power_port, - assigned_object_prefix=assigned_object_prefix, - assigned_object_provider=assigned_object_provider, - assigned_object_provider_account=assigned_object_provider_account, - assigned_object_provider_network=assigned_object_provider_network, - assigned_object_rir=assigned_object_rir, - assigned_object_rack=assigned_object_rack, - assigned_object_rack_reservation=assigned_object_rack_reservation, - assigned_object_rack_role=assigned_object_rack_role, - assigned_object_rack_type=assigned_object_rack_type, - assigned_object_rear_port=assigned_object_rear_port, - assigned_object_region=assigned_object_region, - assigned_object_role=assigned_object_role, - assigned_object_route_target=assigned_object_route_target, - assigned_object_service=assigned_object_service, - assigned_object_site=assigned_object_site, - assigned_object_site_group=assigned_object_site_group, - assigned_object_tag=assigned_object_tag, - assigned_object_tenant=assigned_object_tenant, - assigned_object_tenant_group=assigned_object_tenant_group, - assigned_object_tunnel=assigned_object_tunnel, - assigned_object_tunnel_group=assigned_object_tunnel_group, - assigned_object_tunnel_termination=assigned_object_tunnel_termination, - assigned_object_vlan=assigned_object_vlan, - assigned_object_vlan_group=assigned_object_vlan_group, - assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, - assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, - assigned_object_vm_interface=assigned_object_vm_interface, - assigned_object_vrf=assigned_object_vrf, - assigned_object_virtual_chassis=assigned_object_virtual_chassis, - assigned_object_virtual_circuit=assigned_object_virtual_circuit, - assigned_object_virtual_circuit_termination=assigned_object_virtual_circuit_termination, - assigned_object_virtual_circuit_type=assigned_object_virtual_circuit_type, - assigned_object_virtual_device_context=assigned_object_virtual_device_context, - assigned_object_virtual_disk=assigned_object_virtual_disk, - assigned_object_virtual_machine=assigned_object_virtual_machine, - assigned_object_wireless_lan=assigned_object_wireless_lan, - assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, - assigned_object_wireless_link=assigned_object_wireless_link, - assigned_object_custom_link=assigned_object_custom_link, - assigned_object_owner=assigned_object_owner, - assigned_object_owner_group=assigned_object_owner_group, - kind=kind, + result = pb.VirtualCircuitType( + name=name, + slug=slug, + color=color, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + ) + return result + + +class VirtualDeviceContext: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDeviceContext.""" + + def __new__( + cls, + name: str | None = None, + device: str | Device | pb.Device | None = None, + identifier: int | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + primary_ip4: str | IPAddress | pb.IPAddress | None = None, + primary_ip6: str | IPAddress | pb.IPAddress | None = None, + status: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualDeviceContext: + """Create a new VirtualDeviceContext.""" + device = convert_to_protobuf(device, pb.Device) + tenant = convert_to_protobuf(tenant, pb.Tenant) + primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) + primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.VirtualDeviceContext( + name=name, + device=device, + identifier=identifier, + tenant=tenant, + primary_ip4=primary_ip4, + primary_ip6=primary_ip6, + status=status, + description=description, + owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, @@ -7613,131 +7548,268 @@ def __new__( return result -class ModuleTypeProfile: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleTypeProfile.""" +class VirtualDisk: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDisk.""" def __new__( cls, + virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, name: str | None = None, description: str | None = None, - schema: str | None = None, - comments: str | None = None, + size: int | None = None, + owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - owner: str | Owner | pb.Owner | None = None, - ) -> pb.ModuleTypeProfile: - """Create a new ModuleTypeProfile.""" + ) -> pb.VirtualDisk: + """Create a new VirtualDisk.""" + virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) + owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - owner = convert_to_protobuf(owner, pb.Owner) - result = pb.ModuleTypeProfile( + result = pb.VirtualDisk( + virtual_machine=virtual_machine, name=name, description=description, - schema=schema, - comments=comments, + size=size, + owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, - owner=owner, ) return result -class CustomLink: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomLink.""" +class VirtualMachine: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualMachine.""" def __new__( cls, name: str | None = None, - enabled: bool | None = None, - link_text: str | None = None, - link_url: str | None = None, - weight: int | None = None, - group_name: str | None = None, - button_class: str | None = None, - new_window: bool | None = None, - object_types: list[str] | None = None, - metadata: dict[str, Any] | None = None, + status: str | None = None, + start_on_boot: str | None = None, + site: str | Site | pb.Site | None = None, + cluster: str | Cluster | pb.Cluster | None = None, + device: str | Device | pb.Device | None = None, + serial: str | None = None, + role: str | DeviceRole | pb.DeviceRole | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + platform: str | Platform | pb.Platform | None = None, + primary_ip4: str | IPAddress | pb.IPAddress | None = None, + primary_ip6: str | IPAddress | pb.IPAddress | None = None, + vcpus: float | None = None, + memory: int | None = None, + disk: int | None = None, + description: str | None = None, owner: str | Owner | pb.Owner | None = None, - ) -> pb.CustomLink: - """Create a new CustomLink.""" - metadata = convert_dict_to_struct(metadata) + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, + metadata: dict[str, Any] | None = None, + ) -> pb.VirtualMachine: + """Create a new VirtualMachine.""" + site = convert_to_protobuf(site, pb.Site) + cluster = convert_to_protobuf(cluster, pb.Cluster) + device = convert_to_protobuf(device, pb.Device) + role = convert_to_protobuf(role, pb.DeviceRole) + tenant = convert_to_protobuf(tenant, pb.Tenant) + platform = convert_to_protobuf(platform, pb.Platform) + primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) + primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) owner = convert_to_protobuf(owner, pb.Owner) - result = pb.CustomLink( + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + + # apply shortcuts + if platform is not None: + if device is not None and not device.HasField("platform"): + device.platform.CopyFrom(platform) + if site is not None: + if device is not None and not device.HasField("site"): + device.site.CopyFrom(site) + if cluster is not None and not cluster.HasField("scope_site"): + cluster.scope_site.CopyFrom(site) + if role is not None: + if device is not None and not device.HasField("role"): + device.role.CopyFrom(role) + result = pb.VirtualMachine( name=name, - enabled=enabled, - link_text=link_text, - link_url=link_url, - weight=weight, - group_name=group_name, - button_class=button_class, - new_window=new_window, - object_types=object_types, - metadata=metadata, + status=status, + start_on_boot=start_on_boot, + site=site, + cluster=cluster, + device=device, + serial=serial, + role=role, + tenant=tenant, + platform=platform, + primary_ip4=primary_ip4, + primary_ip6=primary_ip6, + vcpus=vcpus, + memory=memory, + disk=disk, + description=description, owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, ) return result -class Owner: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Owner.""" +class WirelessLAN: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLAN.""" def __new__( cls, - name: str | None = None, - group: str | OwnerGroup | pb.OwnerGroup | None = None, + ssid: str | None = None, description: str | None = None, + group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, + status: str | None = None, + vlan: str | VLAN | pb.VLAN | None = None, + scope_location: str | Location | pb.Location | None = None, + scope_region: str | Region | pb.Region | None = None, + scope_site: str | Site | pb.Site | None = None, + scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + auth_type: str | None = None, + auth_cipher: str | None = None, + auth_psk: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.Owner: - """Create a new Owner.""" - group = convert_to_protobuf(group, pb.OwnerGroup) + ) -> pb.WirelessLAN: + """Create a new WirelessLAN.""" + group = convert_to_protobuf(group, pb.WirelessLANGroup) + vlan = convert_to_protobuf(vlan, pb.VLAN) + scope_location = convert_to_protobuf(scope_location, pb.Location) + scope_region = convert_to_protobuf(scope_region, pb.Region) + scope_site = convert_to_protobuf(scope_site, pb.Site) + scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.Owner( - name=name, - group=group, + result = pb.WirelessLAN( + ssid=ssid, description=description, + group=group, + status=status, + vlan=vlan, + scope_location=scope_location, + scope_region=scope_region, + scope_site=scope_site, + scope_site_group=scope_site_group, + tenant=tenant, + auth_type=auth_type, + auth_cipher=auth_cipher, + auth_psk=auth_psk, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, metadata=metadata, ) return result -class OwnerGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.OwnerGroup.""" +class WirelessLANGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLANGroup.""" def __new__( cls, name: str | None = None, + slug: str | None = None, + parent: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, description: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.OwnerGroup: - """Create a new OwnerGroup.""" + ) -> pb.WirelessLANGroup: + """Create a new WirelessLANGroup.""" + parent = convert_to_protobuf(parent, pb.WirelessLANGroup) + tags = convert_to_protobuf_list(tags, pb.Tag) + owner = convert_to_protobuf(owner, pb.Owner) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.OwnerGroup( + result = pb.WirelessLANGroup( name=name, + slug=slug, + parent=parent, description=description, + tags=tags, + owner=owner, + comments=comments, + custom_fields=custom_fields, metadata=metadata, ) return result -class DeviceConfig: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.DeviceConfig.""" +class WirelessLink: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLink.""" def __new__( cls, - startup: bytes | None = None, - running: bytes | None = None, - candidate: bytes | None = None, + interface_a: str | Interface | pb.Interface | None = None, + interface_b: str | Interface | pb.Interface | None = None, + ssid: str | None = None, + status: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + auth_type: str | None = None, + auth_cipher: str | None = None, + auth_psk: str | None = None, + distance: float | None = None, + distance_unit: str | None = None, + description: str | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: ( + dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.DeviceConfig: - """Create a new DeviceConfig.""" + ) -> pb.WirelessLink: + """Create a new WirelessLink.""" + interface_a = convert_to_protobuf(interface_a, pb.Interface) + interface_b = convert_to_protobuf(interface_b, pb.Interface) + tenant = convert_to_protobuf(tenant, pb.Tenant) + owner = convert_to_protobuf(owner, pb.Owner) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.DeviceConfig( - startup=startup, - running=running, - candidate=candidate, + result = pb.WirelessLink( + interface_a=interface_a, + interface_b=interface_b, + ssid=ssid, + status=status, + tenant=tenant, + auth_type=auth_type, + auth_cipher=auth_cipher, + auth_psk=auth_psk, + distance=distance, + distance_unit=distance_unit, + description=description, + owner=owner, + comments=comments, + tags=tags, + custom_fields=custom_fields, metadata=metadata, ) return result From 6fe6a2fec6d2f95c3420c1436ec246358799ac3c Mon Sep 17 00:00:00 2001 From: Paul Stuart Date: Wed, 11 Feb 2026 08:27:08 -0800 Subject: [PATCH 5/8] regen after diode.proto update --- docs/README.md | 13 +- docs/examples/aggregate.py | 45 +- docs/examples/asn.py | 41 +- docs/examples/asn_range.py | 45 +- docs/examples/cable.py | 29 +- docs/examples/cable_path.py | 20 +- docs/examples/circuit.py | 43 +- docs/examples/circuit_group.py | 27 +- docs/examples/circuit_group_assignment.py | 32 +- docs/examples/circuit_termination.py | 38 +- docs/examples/circuit_type.py | 23 +- docs/examples/cluster.py | 37 +- docs/examples/cluster_group.py | 23 +- docs/examples/cluster_type.py | 23 +- docs/examples/console_port.py | 40 +- docs/examples/console_server_port.py | 42 +- docs/examples/contact.py | 23 +- docs/examples/contact_assignment.py | 33 +- docs/examples/contact_group.py | 23 +- docs/examples/contact_role.py | 23 +- docs/examples/custom_field.py | 27 +- docs/examples/custom_field_choice_set.py | 26 +- docs/examples/custom_link.py | 32 +- docs/examples/device.py | 56 +- docs/examples/device_bay.py | 40 +- docs/examples/device_config.py | 77 + docs/examples/device_role.py | 23 +- docs/examples/device_type.py | 33 +- docs/examples/fhrp_group.py | 21 +- docs/examples/fhrp_group_assignment.py | 28 +- docs/examples/front_port.py | 89 +- docs/examples/ike_policy.py | 29 +- docs/examples/ike_proposal.py | 29 +- docs/examples/interface_example.py | 60 +- docs/examples/inventory_item.py | 49 +- docs/examples/inventory_item_role.py | 31 +- docs/examples/ip_address.py | 33 +- docs/examples/ip_range.py | 45 +- docs/examples/ip_sec_policy.py | 29 +- docs/examples/ip_sec_profile.py | 50 +- docs/examples/ip_sec_proposal.py | 29 +- docs/examples/journal_entry.py | 18 +- docs/examples/l2vpn.py | 29 +- docs/examples/l2vpn_termination.py | 24 +- docs/examples/location.py | 31 +- docs/examples/mac_address.py | 27 +- docs/examples/manufacturer.py | 21 +- docs/examples/module.py | 70 +- docs/examples/module_bay.py | 40 +- docs/examples/module_type.py | 31 +- docs/examples/module_type_profile.py | 23 +- docs/examples/owner.py | 38 +- docs/examples/owner_group.py | 32 +- docs/examples/platform.py | 21 +- docs/examples/power_feed.py | 33 +- docs/examples/power_outlet.py | 44 +- docs/examples/power_panel.py | 27 +- docs/examples/power_port.py | 40 +- docs/examples/prefix.py | 25 +- docs/examples/provider.py | 21 +- docs/examples/provider_account.py | 37 +- docs/examples/provider_network.py | 31 +- docs/examples/rack.py | 32 +- docs/examples/rack_reservation.py | 37 +- docs/examples/rack_role.py | 21 +- docs/examples/rack_type.py | 31 +- docs/examples/rear_port.py | 40 +- docs/examples/region.py | 21 +- docs/examples/rir.py | 21 +- docs/examples/role.py | 21 +- docs/examples/route_target.py | 25 +- docs/examples/service.py | 21 +- docs/examples/site.py | 25 +- docs/examples/site_group.py | 21 +- docs/examples/tag.py | 24 +- docs/examples/tenant.py | 21 +- docs/examples/tenant_group.py | 21 +- docs/examples/tunnel.py | 25 +- docs/examples/tunnel_group.py | 21 +- docs/examples/tunnel_termination.py | 28 +- docs/examples/virtual_chassis.py | 21 +- docs/examples/virtual_circuit.py | 43 +- docs/examples/virtual_circuit_termination.py | 56 +- docs/examples/virtual_circuit_type.py | 23 +- docs/examples/virtual_device_context.py | 45 +- docs/examples/virtual_disk.py | 31 +- docs/examples/virtual_machine.py | 29 +- docs/examples/vlan.py | 31 +- docs/examples/vlan_group.py | 25 +- docs/examples/vlan_translation_policy.py | 27 +- docs/examples/vlan_translation_rule.py | 31 +- docs/examples/vm_interface.py | 31 +- docs/examples/vrf.py | 25 +- docs/examples/wireless_lan.py | 31 +- docs/examples/wireless_lan_group.py | 23 +- docs/examples/wireless_link.py | 67 +- netboxlabs/diode/sdk/ingester.py | 3894 +++++++++--------- 97 files changed, 3871 insertions(+), 3140 deletions(-) create mode 100644 docs/examples/device_config.py diff --git a/docs/README.md b/docs/README.md index 433e409..0fd7baa 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,7 +1,7 @@ # Diode Python SDK - Entity Examples Source: NetBox v4.5.0 -Generated: 2026-02-10 03:24:52Z +Generated: 2026-02-11 02:15:59Z ## Prerequisites @@ -16,12 +16,12 @@ pip install netboxlabs-diode-sdk ## Configuration -Each example uses constants for configuration. You can modify these in the example code: +Each example reads configuration from environment variables with sensible defaults: -```python -TARGET = "grpc://localhost:8080/diode" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +```bash +export DIODE_TARGET="grpc://localhost:8080/diode" # optional, this is the default +export DIODE_CLIENT_ID="diode" # optional +export DIODE_CLIENT_SECRET="changeme" # optional ``` ## Quick Start @@ -66,6 +66,7 @@ Switch between patterns by uncommenting the desired function call in `main()`. - [ConsoleServerPort](examples/console_server_port.py) - [Device](examples/device.py) - [DeviceBay](examples/device_bay.py) +- [DeviceConfig](examples/device_config.py) - [DeviceRole](examples/device_role.py) - [DeviceType](examples/device_type.py) - [FrontPort](examples/front_port.py) diff --git a/docs/examples/aggregate.py b/docs/examples/aggregate.py index c2ae030..d64b66b 100644 --- a/docs/examples/aggregate.py +++ b/docs/examples/aggregate.py @@ -7,24 +7,26 @@ - aggregate_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Aggregate, Entity, + Aggregate, RIR, Tag, Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "aggregate-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a Aggregate entity.""" + """Main execution - demonstrates ingesting an Aggregate entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -33,11 +35,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - aggregate = aggregate_minimal() - # aggregate = aggregate_extended() - # aggregate = aggregate_explicit() + entity = aggregate_minimal() + # entity = aggregate_extended() + # entity = aggregate_explicit() - response = client.ingest(entities=[Entity(aggregate=aggregate)]) + response = client.ingest(entities=[Entity(aggregate=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -45,38 +47,45 @@ def main(): def aggregate_minimal() -> Aggregate: - """Create a Aggregate with only required fields using flat strings.""" + """Create an Aggregate with only required fields using flat strings.""" return Aggregate( prefix="192.0.2.0/24", - rir="Example RIR", # flat string -> RIR + rir="example-rir", # flat string -> RIR metadata={"source": "example"}, ) def aggregate_extended() -> Aggregate: - """Create a Aggregate with common optional fields.""" + """Create an Aggregate with common optional fields.""" return Aggregate( prefix="192.0.2.0/24", - rir="Example RIR", - metadata={"source": "example"}, + rir="example-rir", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def aggregate_explicit() -> Aggregate: - """Create a Aggregate with fully nested objects and all common fields.""" + """Create an Aggregate with fully nested objects and all common fields.""" return Aggregate( prefix="192.0.2.0/24", rir=RIR( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), - metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/asn.py b/docs/examples/asn.py index 698cce7..d6f997d 100644 --- a/docs/examples/asn.py +++ b/docs/examples/asn.py @@ -7,23 +7,25 @@ - asn_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - ASN, Entity, + ASN, Tag, Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "asn-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a ASN entity.""" + """Main execution - demonstrates ingesting an ASN entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - asn = asn_minimal() - # asn = asn_extended() - # asn = asn_explicit() + entity = asn_minimal() + # entity = asn_extended() + # entity = asn_explicit() - response = client.ingest(entities=[Entity(asn=asn)]) + response = client.ingest(entities=[Entity(asn=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -44,33 +46,36 @@ def main(): def asn_minimal() -> ASN: - """Create a ASN with only required fields using flat strings.""" + """Create an ASN with only required fields using flat strings.""" return ASN( - asn=64512, + asn=65001, metadata={"source": "example"}, ) def asn_extended() -> ASN: - """Create a ASN with common optional fields.""" + """Create an ASN with common optional fields.""" return ASN( - asn=64512, - metadata={"source": "example"}, + asn=65001, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def asn_explicit() -> ASN: - """Create a ASN with fully nested objects and all common fields.""" + """Create an ASN with fully nested objects and all common fields.""" return ASN( - asn=64512, - metadata={"source": "example"}, + asn=65001, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/asn_range.py b/docs/examples/asn_range.py index 492504e..f8b9929 100644 --- a/docs/examples/asn_range.py +++ b/docs/examples/asn_range.py @@ -7,24 +7,26 @@ - asn_range_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - ASNRange, Entity, + ASNRange, RIR, Tag, Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "asn_range-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a ASNRange entity.""" + """Main execution - demonstrates ingesting an ASNRange entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -33,11 +35,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - asn_range = asn_range_minimal() - # asn_range = asn_range_extended() - # asn_range = asn_range_explicit() + entity = asn_range_minimal() + # entity = asn_range_extended() + # entity = asn_range_explicit() - response = client.ingest(entities=[Entity(asn_range=asn_range)]) + response = client.ingest(entities=[Entity(asn_range=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -45,11 +47,11 @@ def main(): def asn_range_minimal() -> ASNRange: - """Create a ASNRange with only required fields using flat strings.""" + """Create an ASNRange with only required fields using flat strings.""" return ASNRange( name="Example Name", slug="example-slug", - rir="Example RIR", # flat string -> RIR + rir="example-rir", # flat string -> RIR start=1, end=1, metadata={"source": "example"}, @@ -57,35 +59,42 @@ def asn_range_minimal() -> ASNRange: def asn_range_extended() -> ASNRange: - """Create a ASNRange with common optional fields.""" + """Create an ASNRange with common optional fields.""" return ASNRange( name="Example Name", slug="example-slug", - rir="Example RIR", + rir="example-rir", start=1, end=1, - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def asn_range_explicit() -> ASNRange: - """Create a ASNRange with fully nested objects and all common fields.""" + """Create an ASNRange with fully nested objects and all common fields.""" return ASNRange( name="Example Name", slug="example-slug", rir=RIR( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), start=1, end=1, - metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/cable.py b/docs/examples/cable.py index c3bc9c3..e0f58e6 100644 --- a/docs/examples/cable.py +++ b/docs/examples/cable.py @@ -7,19 +7,21 @@ - cable_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Cable, Entity, + Cable, Tag, Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "cable-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - cable = cable_minimal() - # cable = cable_extended() - # cable = cable_explicit() + entity = cable_minimal() + # entity = cable_extended() + # entity = cable_explicit() - response = client.ingest(entities=[Entity(cable=cable)]) + response = client.ingest(entities=[Entity(cable=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -53,25 +55,30 @@ def cable_minimal() -> Cable: def cable_extended() -> Cable: """Create a Cable with common optional fields.""" return Cable( - metadata={"source": "example"}, status="connected", + label="Example label", color="0000ff", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def cable_explicit() -> Cable: """Create a Cable with fully nested objects and all common fields.""" return Cable( - metadata={"source": "example"}, status="connected", + label="Example label", color="0000ff", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/cable_path.py b/docs/examples/cable_path.py index 4bdd078..fc03902 100644 --- a/docs/examples/cable_path.py +++ b/docs/examples/cable_path.py @@ -7,13 +7,19 @@ - cable_path_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + CablePath, +) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "cable_path-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -26,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - cable_path = cable_path_minimal() - # cable_path = cable_path_extended() - # cable_path = cable_path_explicit() + entity = cable_path_minimal() + # entity = cable_path_extended() + # entity = cable_path_explicit() - response = client.ingest(entities=[Entity(cable_path=cable_path)]) + response = client.ingest(entities=[Entity(cable_path=entity)]) if response.errors: print(f"Errors: {response.errors}") else: diff --git a/docs/examples/circuit.py b/docs/examples/circuit.py index 7364e6c..91bdf84 100644 --- a/docs/examples/circuit.py +++ b/docs/examples/circuit.py @@ -7,21 +7,23 @@ - circuit_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Circuit, CircuitType, - Entity, Provider, Tag, Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "circuit-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -34,11 +36,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - circuit = circuit_minimal() - # circuit = circuit_extended() - # circuit = circuit_explicit() + entity = circuit_minimal() + # entity = circuit_extended() + # entity = circuit_explicit() - response = client.ingest(entities=[Entity(circuit=circuit)]) + response = client.ingest(entities=[Entity(circuit=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -49,8 +51,8 @@ def circuit_minimal() -> Circuit: """Create a Circuit with only required fields using flat strings.""" return Circuit( cid="CID-001", - provider="Example Provider", # flat string -> Provider - type="Example Type", # flat string -> CircuitType + provider="example-provider", # flat string -> Provider + type="example-type", # flat string -> CircuitType metadata={"source": "example"}, ) @@ -59,11 +61,12 @@ def circuit_extended() -> Circuit: """Create a Circuit with common optional fields.""" return Circuit( cid="CID-001", - provider="Example Provider", - type="Example Type", - metadata={"source": "example"}, + provider="example-provider", + type="example-type", status="active", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -72,22 +75,30 @@ def circuit_explicit() -> Circuit: return Circuit( cid="CID-001", provider=Provider( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), type=CircuitType( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), - metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/circuit_group.py b/docs/examples/circuit_group.py index 02520ed..b72fa85 100644 --- a/docs/examples/circuit_group.py +++ b/docs/examples/circuit_group.py @@ -7,19 +7,21 @@ - circuit_group_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - CircuitGroup, Entity, + CircuitGroup, Tag, Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "circuit_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - circuit_group = circuit_group_minimal() - # circuit_group = circuit_group_extended() - # circuit_group = circuit_group_explicit() + entity = circuit_group_minimal() + # entity = circuit_group_extended() + # entity = circuit_group_explicit() - response = client.ingest(entities=[Entity(circuit_group=circuit_group)]) + response = client.ingest(entities=[Entity(circuit_group=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -57,8 +59,9 @@ def circuit_group_extended() -> CircuitGroup: return CircuitGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -67,13 +70,15 @@ def circuit_group_explicit() -> CircuitGroup: return CircuitGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/circuit_group_assignment.py b/docs/examples/circuit_group_assignment.py index 31fcd2a..3629c2e 100644 --- a/docs/examples/circuit_group_assignment.py +++ b/docs/examples/circuit_group_assignment.py @@ -7,19 +7,21 @@ - circuit_group_assignment_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, CircuitGroup, CircuitGroupAssignment, - Entity, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "circuit_group_assignment-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,13 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - circuit_group_assignment = circuit_group_assignment_minimal() - # circuit_group_assignment = circuit_group_assignment_extended() - # circuit_group_assignment = circuit_group_assignment_explicit() + entity = circuit_group_assignment_minimal() + # entity = circuit_group_assignment_extended() + # entity = circuit_group_assignment_explicit() - response = client.ingest( - entities=[Entity(circuit_group_assignment=circuit_group_assignment)] - ) + response = client.ingest(entities=[Entity(circuit_group_assignment=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +48,7 @@ def main(): def circuit_group_assignment_minimal() -> CircuitGroupAssignment: """Create a CircuitGroupAssignment with only required fields using flat strings.""" return CircuitGroupAssignment( - group="Example Group", # flat string -> CircuitGroup + group="example-group", # flat string -> CircuitGroup metadata={"source": "example"}, ) @@ -56,7 +56,7 @@ def circuit_group_assignment_minimal() -> CircuitGroupAssignment: def circuit_group_assignment_extended() -> CircuitGroupAssignment: """Create a CircuitGroupAssignment with common optional fields.""" return CircuitGroupAssignment( - group="Example Group", + group="example-group", metadata={"source": "example"}, ) @@ -65,10 +65,14 @@ def circuit_group_assignment_explicit() -> CircuitGroupAssignment: """Create a CircuitGroupAssignment with fully nested objects and all common fields.""" return CircuitGroupAssignment( group=CircuitGroup( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), - metadata={"source": "example"}, tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/circuit_termination.py b/docs/examples/circuit_termination.py index ebf841b..bc459c2 100644 --- a/docs/examples/circuit_termination.py +++ b/docs/examples/circuit_termination.py @@ -7,21 +7,23 @@ - circuit_termination_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Circuit, CircuitTermination, CircuitType, - Entity, Provider, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "circuit_termination-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -34,13 +36,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - circuit_termination = circuit_termination_minimal() - # circuit_termination = circuit_termination_extended() - # circuit_termination = circuit_termination_explicit() + entity = circuit_termination_minimal() + # entity = circuit_termination_extended() + # entity = circuit_termination_explicit() - response = client.ingest( - entities=[Entity(circuit_termination=circuit_termination)] - ) + response = client.ingest(entities=[Entity(circuit_termination=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +50,7 @@ def main(): def circuit_termination_minimal() -> CircuitTermination: """Create a CircuitTermination with only required fields using flat strings.""" return CircuitTermination( - circuit="Example Circuit", # flat string -> Circuit + circuit="example-circuit", # flat string -> Circuit term_side="A", metadata={"source": "example"}, ) @@ -59,10 +59,10 @@ def circuit_termination_minimal() -> CircuitTermination: def circuit_termination_extended() -> CircuitTermination: """Create a CircuitTermination with common optional fields.""" return CircuitTermination( - circuit="Example Circuit", + circuit="example-circuit", term_side="A", - metadata={"source": "example"}, description="Example description", + metadata={"source": "example"}, ) @@ -72,21 +72,29 @@ def circuit_termination_explicit() -> CircuitTermination: circuit=Circuit( cid="CID-001", provider=Provider( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), type=CircuitType( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), term_side="A", - metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/circuit_type.py b/docs/examples/circuit_type.py index 98fea08..05d17b6 100644 --- a/docs/examples/circuit_type.py +++ b/docs/examples/circuit_type.py @@ -7,18 +7,20 @@ - circuit_type_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - CircuitType, Entity, + CircuitType, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "circuit_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - circuit_type = circuit_type_minimal() - # circuit_type = circuit_type_extended() - # circuit_type = circuit_type_explicit() + entity = circuit_type_minimal() + # entity = circuit_type_extended() + # entity = circuit_type_explicit() - response = client.ingest(entities=[Entity(circuit_type=circuit_type)]) + response = client.ingest(entities=[Entity(circuit_type=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,9 +58,10 @@ def circuit_type_extended() -> CircuitType: return CircuitType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -67,11 +70,11 @@ def circuit_type_explicit() -> CircuitType: return CircuitType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/cluster.py b/docs/examples/cluster.py index 6b37003..dbdd13c 100644 --- a/docs/examples/cluster.py +++ b/docs/examples/cluster.py @@ -7,20 +7,22 @@ - cluster_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Cluster, ClusterType, - Entity, Tag, Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "cluster-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -33,11 +35,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - cluster = cluster_minimal() - # cluster = cluster_extended() - # cluster = cluster_explicit() + entity = cluster_minimal() + # entity = cluster_extended() + # entity = cluster_explicit() - response = client.ingest(entities=[Entity(cluster=cluster)]) + response = client.ingest(entities=[Entity(cluster=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +50,7 @@ def cluster_minimal() -> Cluster: """Create a Cluster with only required fields using flat strings.""" return Cluster( name="Example Name", - type="Example Type", # flat string -> ClusterType + type="example-type", # flat string -> ClusterType metadata={"source": "example"}, ) @@ -57,10 +59,11 @@ def cluster_extended() -> Cluster: """Create a Cluster with common optional fields.""" return Cluster( name="Example Name", - type="Example Type", - metadata={"source": "example"}, + type="example-type", status="active", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -69,16 +72,22 @@ def cluster_explicit() -> Cluster: return Cluster( name="Example Name", type=ClusterType( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), - metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/cluster_group.py b/docs/examples/cluster_group.py index 9d48651..f06d6ac 100644 --- a/docs/examples/cluster_group.py +++ b/docs/examples/cluster_group.py @@ -7,18 +7,20 @@ - cluster_group_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - ClusterGroup, Entity, + ClusterGroup, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "cluster_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - cluster_group = cluster_group_minimal() - # cluster_group = cluster_group_extended() - # cluster_group = cluster_group_explicit() + entity = cluster_group_minimal() + # entity = cluster_group_extended() + # entity = cluster_group_explicit() - response = client.ingest(entities=[Entity(cluster_group=cluster_group)]) + response = client.ingest(entities=[Entity(cluster_group=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def cluster_group_extended() -> ClusterGroup: return ClusterGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def cluster_group_explicit() -> ClusterGroup: return ClusterGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/cluster_type.py b/docs/examples/cluster_type.py index f03b059..b2dd5a9 100644 --- a/docs/examples/cluster_type.py +++ b/docs/examples/cluster_type.py @@ -7,18 +7,20 @@ - cluster_type_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - ClusterType, Entity, + ClusterType, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "cluster_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - cluster_type = cluster_type_minimal() - # cluster_type = cluster_type_extended() - # cluster_type = cluster_type_explicit() + entity = cluster_type_minimal() + # entity = cluster_type_extended() + # entity = cluster_type_explicit() - response = client.ingest(entities=[Entity(cluster_type=cluster_type)]) + response = client.ingest(entities=[Entity(cluster_type=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def cluster_type_extended() -> ClusterType: return ClusterType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def cluster_type_explicit() -> ClusterType: return ClusterType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/console_port.py b/docs/examples/console_port.py index 2be7044..80690c6 100644 --- a/docs/examples/console_port.py +++ b/docs/examples/console_port.py @@ -7,23 +7,25 @@ - console_port_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, ConsolePort, Device, DeviceRole, DeviceType, - Entity, Manufacturer, Site, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "console_port-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -36,11 +38,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - console_port = console_port_minimal() - # console_port = console_port_extended() - # console_port = console_port_explicit() + entity = console_port_minimal() + # entity = console_port_extended() + # entity = console_port_explicit() - response = client.ingest(entities=[Entity(console_port=console_port)]) + response = client.ingest(entities=[Entity(console_port=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +52,7 @@ def main(): def console_port_minimal() -> ConsolePort: """Create a ConsolePort with only required fields using flat strings.""" return ConsolePort( - device="Example Device", # flat string -> Device + device="example-device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -59,10 +61,11 @@ def console_port_minimal() -> ConsolePort: def console_port_extended() -> ConsolePort: """Create a ConsolePort with common optional fields.""" return ConsolePort( - device="Example Device", + device="example-device", name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", + metadata={"source": "example"}, ) @@ -74,31 +77,44 @@ def console_port_explicit() -> ConsolePort: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/console_server_port.py b/docs/examples/console_server_port.py index 5b349d9..0e8d110 100644 --- a/docs/examples/console_server_port.py +++ b/docs/examples/console_server_port.py @@ -7,23 +7,25 @@ - console_server_port_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, ConsoleServerPort, Device, DeviceRole, DeviceType, - Entity, Manufacturer, Site, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "console_server_port-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -36,13 +38,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - console_server_port = console_server_port_minimal() - # console_server_port = console_server_port_extended() - # console_server_port = console_server_port_explicit() + entity = console_server_port_minimal() + # entity = console_server_port_extended() + # entity = console_server_port_explicit() - response = client.ingest( - entities=[Entity(console_server_port=console_server_port)] - ) + response = client.ingest(entities=[Entity(console_server_port=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -52,7 +52,7 @@ def main(): def console_server_port_minimal() -> ConsoleServerPort: """Create a ConsoleServerPort with only required fields using flat strings.""" return ConsoleServerPort( - device="Example Device", # flat string -> Device + device="example-device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -61,10 +61,11 @@ def console_server_port_minimal() -> ConsoleServerPort: def console_server_port_extended() -> ConsoleServerPort: """Create a ConsoleServerPort with common optional fields.""" return ConsoleServerPort( - device="Example Device", + device="example-device", name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", + metadata={"source": "example"}, ) @@ -76,31 +77,44 @@ def console_server_port_explicit() -> ConsoleServerPort: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/contact.py b/docs/examples/contact.py index ec0380a..e50786b 100644 --- a/docs/examples/contact.py +++ b/docs/examples/contact.py @@ -7,18 +7,20 @@ - contact_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Contact, Entity, + Contact, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "contact-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - contact = contact_minimal() - # contact = contact_extended() - # contact = contact_explicit() + entity = contact_minimal() + # entity = contact_extended() + # entity = contact_explicit() - response = client.ingest(entities=[Entity(contact=contact)]) + response = client.ingest(entities=[Entity(contact=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -54,8 +56,9 @@ def contact_extended() -> Contact: """Create a Contact with common optional fields.""" return Contact( name="Example Name", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -63,10 +66,10 @@ def contact_explicit() -> Contact: """Create a Contact with fully nested objects and all common fields.""" return Contact( name="Example Name", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/contact_assignment.py b/docs/examples/contact_assignment.py index b527fc7..21b8161 100644 --- a/docs/examples/contact_assignment.py +++ b/docs/examples/contact_assignment.py @@ -7,19 +7,21 @@ - contact_assignment_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Contact, ContactAssignment, - Entity, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "contact_assignment-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,13 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - contact_assignment = contact_assignment_minimal() - # contact_assignment = contact_assignment_extended() - # contact_assignment = contact_assignment_explicit() + entity = contact_assignment_minimal() + # entity = contact_assignment_extended() + # entity = contact_assignment_explicit() - response = client.ingest( - entities=[Entity(contact_assignment=contact_assignment)] - ) + response = client.ingest(entities=[Entity(contact_assignment=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +48,7 @@ def main(): def contact_assignment_minimal() -> ContactAssignment: """Create a ContactAssignment with only required fields using flat strings.""" return ContactAssignment( - contact="Example Contact", # flat string -> Contact + contact="example-contact", # flat string -> Contact metadata={"source": "example"}, ) @@ -56,7 +56,7 @@ def contact_assignment_minimal() -> ContactAssignment: def contact_assignment_extended() -> ContactAssignment: """Create a ContactAssignment with common optional fields.""" return ContactAssignment( - contact="Example Contact", + contact="example-contact", metadata={"source": "example"}, ) @@ -64,9 +64,14 @@ def contact_assignment_extended() -> ContactAssignment: def contact_assignment_explicit() -> ContactAssignment: """Create a ContactAssignment with fully nested objects and all common fields.""" return ContactAssignment( - contact=Contact(name="Example Name", metadata={"source": "example"}), - metadata={"source": "example"}, + contact=Contact( + name="Example Name", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, + ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/contact_group.py b/docs/examples/contact_group.py index 4038984..e041618 100644 --- a/docs/examples/contact_group.py +++ b/docs/examples/contact_group.py @@ -7,18 +7,20 @@ - contact_group_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - ContactGroup, Entity, + ContactGroup, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "contact_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - contact_group = contact_group_minimal() - # contact_group = contact_group_extended() - # contact_group = contact_group_explicit() + entity = contact_group_minimal() + # entity = contact_group_extended() + # entity = contact_group_explicit() - response = client.ingest(entities=[Entity(contact_group=contact_group)]) + response = client.ingest(entities=[Entity(contact_group=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def contact_group_extended() -> ContactGroup: return ContactGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def contact_group_explicit() -> ContactGroup: return ContactGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/contact_role.py b/docs/examples/contact_role.py index 2bfa99a..ac5d568 100644 --- a/docs/examples/contact_role.py +++ b/docs/examples/contact_role.py @@ -7,18 +7,20 @@ - contact_role_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - ContactRole, Entity, + ContactRole, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "contact_role-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - contact_role = contact_role_minimal() - # contact_role = contact_role_extended() - # contact_role = contact_role_explicit() + entity = contact_role_minimal() + # entity = contact_role_extended() + # entity = contact_role_explicit() - response = client.ingest(entities=[Entity(contact_role=contact_role)]) + response = client.ingest(entities=[Entity(contact_role=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def contact_role_extended() -> ContactRole: return ContactRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def contact_role_explicit() -> ContactRole: return ContactRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/custom_field.py b/docs/examples/custom_field.py index 77d61e1..853639e 100644 --- a/docs/examples/custom_field.py +++ b/docs/examples/custom_field.py @@ -7,13 +7,19 @@ - custom_field_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + CustomField, +) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "custom_field-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -26,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - custom_field = custom_field_minimal() - # custom_field = custom_field_extended() - # custom_field = custom_field_explicit() + entity = custom_field_minimal() + # entity = custom_field_extended() + # entity = custom_field_explicit() - response = client.ingest(entities=[Entity(custom_field=custom_field)]) + response = client.ingest(entities=[Entity(custom_field=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -51,8 +57,10 @@ def custom_field_extended() -> CustomField: return CustomField( type="boolean", name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -61,9 +69,10 @@ def custom_field_explicit() -> CustomField: return CustomField( type="boolean", name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", comments="Example comments", + metadata={"source": "example"}, ) diff --git a/docs/examples/custom_field_choice_set.py b/docs/examples/custom_field_choice_set.py index 80cf659..f8b5ba9 100644 --- a/docs/examples/custom_field_choice_set.py +++ b/docs/examples/custom_field_choice_set.py @@ -7,13 +7,19 @@ - custom_field_choice_set_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + CustomFieldChoiceSet, +) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "custom_field_choice_set-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -26,13 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - custom_field_choice_set = custom_field_choice_set_minimal() - # custom_field_choice_set = custom_field_choice_set_extended() - # custom_field_choice_set = custom_field_choice_set_explicit() + entity = custom_field_choice_set_minimal() + # entity = custom_field_choice_set_extended() + # entity = custom_field_choice_set_explicit() - response = client.ingest( - entities=[Entity(custom_field_choice_set=custom_field_choice_set)] - ) + response = client.ingest(entities=[Entity(custom_field_choice_set=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -51,8 +55,8 @@ def custom_field_choice_set_extended() -> CustomFieldChoiceSet: """Create a CustomFieldChoiceSet with common optional fields.""" return CustomFieldChoiceSet( name="Example Name", - metadata={"source": "example"}, description="Example description", + metadata={"source": "example"}, ) @@ -60,8 +64,8 @@ def custom_field_choice_set_explicit() -> CustomFieldChoiceSet: """Create a CustomFieldChoiceSet with fully nested objects and all common fields.""" return CustomFieldChoiceSet( name="Example Name", - metadata={"source": "example"}, description="Example description", + metadata={"source": "example"}, ) diff --git a/docs/examples/custom_link.py b/docs/examples/custom_link.py index e920a42..e5bfe7c 100644 --- a/docs/examples/custom_link.py +++ b/docs/examples/custom_link.py @@ -7,13 +7,19 @@ - custom_link_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + CustomLink, +) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "custom_link-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -26,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - custom_link = custom_link_minimal() - # custom_link = custom_link_extended() - # custom_link = custom_link_explicit() + entity = custom_link_minimal() + # entity = custom_link_extended() + # entity = custom_link_explicit() - response = client.ingest(entities=[Entity(custom_link=custom_link)]) + response = client.ingest(entities=[Entity(custom_link=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -41,8 +47,8 @@ def custom_link_minimal() -> CustomLink: """Create a CustomLink with only required fields using flat strings.""" return CustomLink( name="Example Name", - link_text="Example Link Text", - link_url="Example Link Url", + link_text="example-link-text", + link_url="example-link-url", metadata={"source": "example"}, ) @@ -51,8 +57,8 @@ def custom_link_extended() -> CustomLink: """Create a CustomLink with common optional fields.""" return CustomLink( name="Example Name", - link_text="Example Link Text", - link_url="Example Link Url", + link_text="example-link-text", + link_url="example-link-url", metadata={"source": "example"}, ) @@ -61,8 +67,8 @@ def custom_link_explicit() -> CustomLink: """Create a CustomLink with fully nested objects and all common fields.""" return CustomLink( name="Example Name", - link_text="Example Link Text", - link_url="Example Link Url", + link_text="example-link-text", + link_url="example-link-url", metadata={"source": "example"}, ) diff --git a/docs/examples/device.py b/docs/examples/device.py index 08350ef..e0a9e5a 100644 --- a/docs/examples/device.py +++ b/docs/examples/device.py @@ -7,12 +7,14 @@ - device_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, Manufacturer, Platform, Site, @@ -20,11 +22,11 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "device-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -37,11 +39,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - device = device_minimal() - # device = device_extended() - # device = device_explicit() + entity = device_minimal() + # entity = device_extended() + # entity = device_explicit() - response = client.ingest(entities=[Entity(device=device)]) + response = client.ingest(entities=[Entity(device=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -51,9 +53,9 @@ def main(): def device_minimal() -> Device: """Create a Device with only required fields using flat strings.""" return Device( - device_type="Model X", # flat string -> DeviceType - role="Example Role", # flat string -> DeviceRole - site="Example Site", # flat string -> Site + device_type="example-device-type", # flat string -> DeviceType + role="example-role", # flat string -> DeviceRole + site="example-site", # flat string -> Site metadata={"source": "example"}, ) @@ -61,13 +63,15 @@ def device_minimal() -> Device: def device_extended() -> Device: """Create a Device with common optional fields.""" return Device( - device_type="Model X", - role="Example Role", - site="Example Site", - metadata={"source": "example"}, + device_type="example-device-type", + role="example-role", + site="example-site", serial="SN-001234", + asset_tag="ASSET-001", status="active", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -76,37 +80,51 @@ def device_explicit() -> Device: return Device( device_type=DeviceType( manufacturer=Manufacturer( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), - metadata={"source": "example"}, serial="SN-001234", asset_tag="ASSET-001", status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), platform=Platform( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/device_bay.py b/docs/examples/device_bay.py index 5fc92db..928aa9e 100644 --- a/docs/examples/device_bay.py +++ b/docs/examples/device_bay.py @@ -7,23 +7,25 @@ - device_bay_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceBay, DeviceRole, DeviceType, - Entity, Manufacturer, Site, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "device_bay-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -36,11 +38,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - device_bay = device_bay_minimal() - # device_bay = device_bay_extended() - # device_bay = device_bay_explicit() + entity = device_bay_minimal() + # entity = device_bay_extended() + # entity = device_bay_explicit() - response = client.ingest(entities=[Entity(device_bay=device_bay)]) + response = client.ingest(entities=[Entity(device_bay=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +52,7 @@ def main(): def device_bay_minimal() -> DeviceBay: """Create a DeviceBay with only required fields using flat strings.""" return DeviceBay( - device="Example Device", # flat string -> Device + device="example-device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -59,10 +61,11 @@ def device_bay_minimal() -> DeviceBay: def device_bay_extended() -> DeviceBay: """Create a DeviceBay with common optional fields.""" return DeviceBay( - device="Example Device", + device="example-device", name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", + metadata={"source": "example"}, ) @@ -74,31 +77,44 @@ def device_bay_explicit() -> DeviceBay: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/device_config.py b/docs/examples/device_config.py new file mode 100644 index 0000000..0fd1ef5 --- /dev/null +++ b/docs/examples/device_config.py @@ -0,0 +1,77 @@ +""" +DeviceConfig entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting DeviceConfig entities: +- device_config_minimal: Required fields only +- device_config_extended: Common optional fields +- device_config_explicit: Fully nested objects with all fields +""" + +import os + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + DeviceConfig, +) + +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +APP_NAME = "device_config-example" +APP_VERSION = "1.0.0" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") + + +def main(): + """Main execution - demonstrates ingesting a DeviceConfig entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + entity = device_config_minimal() + # entity = device_config_extended() + # entity = device_config_explicit() + + response = client.ingest(entities=[Entity(device_config=entity)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("DeviceConfig ingested successfully") + + +def device_config_minimal() -> DeviceConfig: + """Create a DeviceConfig with only required fields using flat strings.""" + return DeviceConfig( + startup=b"example startup", + running=b"example running", + candidate=b"example candidate", + metadata={"source": "example"}, + ) + + +def device_config_extended() -> DeviceConfig: + """Create a DeviceConfig with common optional fields.""" + return DeviceConfig( + startup=b"example startup", + running=b"example running", + candidate=b"example candidate", + metadata={"source": "example"}, + ) + + +def device_config_explicit() -> DeviceConfig: + """Create a DeviceConfig with fully nested objects and all common fields.""" + return DeviceConfig( + startup=b"example startup", + running=b"example running", + candidate=b"example candidate", + metadata={"source": "example"}, + ) + + +if __name__ == "__main__": + main() diff --git a/docs/examples/device_role.py b/docs/examples/device_role.py index df11336..dfa1950 100644 --- a/docs/examples/device_role.py +++ b/docs/examples/device_role.py @@ -7,18 +7,20 @@ - device_role_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - DeviceRole, Entity, + DeviceRole, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "device_role-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - device_role = device_role_minimal() - # device_role = device_role_extended() - # device_role = device_role_explicit() + entity = device_role_minimal() + # entity = device_role_extended() + # entity = device_role_explicit() - response = client.ingest(entities=[Entity(device_role=device_role)]) + response = client.ingest(entities=[Entity(device_role=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,9 +58,10 @@ def device_role_extended() -> DeviceRole: return DeviceRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -67,11 +70,11 @@ def device_role_explicit() -> DeviceRole: return DeviceRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/device_type.py b/docs/examples/device_type.py index a98e754..c47da2b 100644 --- a/docs/examples/device_type.py +++ b/docs/examples/device_type.py @@ -7,19 +7,21 @@ - device_type_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - DeviceType, Entity, + DeviceType, Manufacturer, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "device_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - device_type = device_type_minimal() - # device_type = device_type_extended() - # device_type = device_type_explicit() + entity = device_type_minimal() + # entity = device_type_extended() + # entity = device_type_explicit() - response = client.ingest(entities=[Entity(device_type=device_type)]) + response = client.ingest(entities=[Entity(device_type=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,7 +48,7 @@ def main(): def device_type_minimal() -> DeviceType: """Create a DeviceType with only required fields using flat strings.""" return DeviceType( - manufacturer="Example Manufacturer", # flat string -> Manufacturer + manufacturer="example-manufacturer", # flat string -> Manufacturer model="Model X", slug="example-slug", metadata={"source": "example"}, @@ -56,11 +58,12 @@ def device_type_minimal() -> DeviceType: def device_type_extended() -> DeviceType: """Create a DeviceType with common optional fields.""" return DeviceType( - manufacturer="Example Manufacturer", + manufacturer="example-manufacturer", model="Model X", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -68,14 +71,18 @@ def device_type_explicit() -> DeviceType: """Create a DeviceType with fully nested objects and all common fields.""" return DeviceType( manufacturer=Manufacturer( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), model="Model X", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/fhrp_group.py b/docs/examples/fhrp_group.py index 6367166..93d64ce 100644 --- a/docs/examples/fhrp_group.py +++ b/docs/examples/fhrp_group.py @@ -7,6 +7,8 @@ - fhrp_group_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "fhrp_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - fhrp_group = fhrp_group_minimal() - # fhrp_group = fhrp_group_extended() - # fhrp_group = fhrp_group_explicit() + entity = fhrp_group_minimal() + # entity = fhrp_group_extended() + # entity = fhrp_group_explicit() - response = client.ingest(entities=[Entity(fhrp_group=fhrp_group)]) + response = client.ingest(entities=[Entity(fhrp_group=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def fhrp_group_extended() -> FHRPGroup: return FHRPGroup( protocol="carp", group_id=1, - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def fhrp_group_explicit() -> FHRPGroup: return FHRPGroup( protocol="carp", group_id=1, - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/fhrp_group_assignment.py b/docs/examples/fhrp_group_assignment.py index 9ea731b..259dcbe 100644 --- a/docs/examples/fhrp_group_assignment.py +++ b/docs/examples/fhrp_group_assignment.py @@ -7,6 +7,8 @@ - fhrp_group_assignment_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ FHRPGroupAssignment, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "fhrp_group_assignment-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,13 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - fhrp_group_assignment = fhrp_group_assignment_minimal() - # fhrp_group_assignment = fhrp_group_assignment_extended() - # fhrp_group_assignment = fhrp_group_assignment_explicit() + entity = fhrp_group_assignment_minimal() + # entity = fhrp_group_assignment_extended() + # entity = fhrp_group_assignment_explicit() - response = client.ingest( - entities=[Entity(fhrp_group_assignment=fhrp_group_assignment)] - ) + response = client.ingest(entities=[Entity(fhrp_group_assignment=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -47,7 +47,7 @@ def main(): def fhrp_group_assignment_minimal() -> FHRPGroupAssignment: """Create a FHRPGroupAssignment with only required fields using flat strings.""" return FHRPGroupAssignment( - group="Example Group", # flat string -> FHRPGroup + group="example-group", # flat string -> FHRPGroup priority=1, metadata={"source": "example"}, ) @@ -56,7 +56,7 @@ def fhrp_group_assignment_minimal() -> FHRPGroupAssignment: def fhrp_group_assignment_extended() -> FHRPGroupAssignment: """Create a FHRPGroupAssignment with common optional fields.""" return FHRPGroupAssignment( - group="Example Group", + group="example-group", priority=1, metadata={"source": "example"}, ) @@ -66,7 +66,11 @@ def fhrp_group_assignment_explicit() -> FHRPGroupAssignment: """Create a FHRPGroupAssignment with fully nested objects and all common fields.""" return FHRPGroupAssignment( group=FHRPGroup( - protocol="Example Protocol", group_id=1, metadata={"source": "example"} + protocol="carp", + group_id=1, + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), priority=1, metadata={"source": "example"}, diff --git a/docs/examples/front_port.py b/docs/examples/front_port.py index 8e7b456..066342f 100644 --- a/docs/examples/front_port.py +++ b/docs/examples/front_port.py @@ -7,23 +7,26 @@ - front_port_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, FrontPort, Manufacturer, + RearPort, Site, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "front_port-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -36,11 +39,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - front_port = front_port_minimal() - # front_port = front_port_extended() - # front_port = front_port_explicit() + entity = front_port_minimal() + # entity = front_port_extended() + # entity = front_port_explicit() - response = client.ingest(entities=[Entity(front_port=front_port)]) + response = client.ingest(entities=[Entity(front_port=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,9 +53,10 @@ def main(): def front_port_minimal() -> FrontPort: """Create a FrontPort with only required fields using flat strings.""" return FrontPort( - device="Example Device", # flat string -> Device + device="example-device", # flat string -> Device name="Example Name", type="110-punch", + rear_port="example-rear-port", # flat string -> RearPort metadata={"source": "example"}, ) @@ -60,12 +64,14 @@ def front_port_minimal() -> FrontPort: def front_port_extended() -> FrontPort: """Create a FrontPort with common optional fields.""" return FrontPort( - device="Example Device", + device="example-device", name="Example Name", type="110-punch", - metadata={"source": "example"}, + rear_port="example-rear-port", + label="Example label", color="0000ff", description="Example description", + metadata={"source": "example"}, ) @@ -77,33 +83,92 @@ def front_port_explicit() -> FrontPort: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", type="110-punch", - metadata={"source": "example"}, + rear_port=RearPort( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, + ), + serial="SN-001234", + asset_tag="ASSET-001", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, + ), + status="active", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, + ), + name="Example Name", + label="Example label", + type="110-punch", + color="0000ff", + description="Example description", + metadata={"source": "example"}, + ), + label="Example label", color="0000ff", description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/ike_policy.py b/docs/examples/ike_policy.py index dcb89bc..b2f6666 100644 --- a/docs/examples/ike_policy.py +++ b/docs/examples/ike_policy.py @@ -7,6 +7,8 @@ - ike_policy_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,15 +16,15 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "ike_policy-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a IKEPolicy entity.""" + """Main execution - demonstrates ingesting an IKEPolicy entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - ike_policy = ike_policy_minimal() - # ike_policy = ike_policy_extended() - # ike_policy = ike_policy_explicit() + entity = ike_policy_minimal() + # entity = ike_policy_extended() + # entity = ike_policy_explicit() - response = client.ingest(entities=[Entity(ike_policy=ike_policy)]) + response = client.ingest(entities=[Entity(ike_policy=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -43,7 +45,7 @@ def main(): def ike_policy_minimal() -> IKEPolicy: - """Create a IKEPolicy with only required fields using flat strings.""" + """Create an IKEPolicy with only required fields using flat strings.""" return IKEPolicy( name="Example Name", version=1, @@ -52,24 +54,25 @@ def ike_policy_minimal() -> IKEPolicy: def ike_policy_extended() -> IKEPolicy: - """Create a IKEPolicy with common optional fields.""" + """Create an IKEPolicy with common optional fields.""" return IKEPolicy( name="Example Name", version=1, - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def ike_policy_explicit() -> IKEPolicy: - """Create a IKEPolicy with fully nested objects and all common fields.""" + """Create an IKEPolicy with fully nested objects and all common fields.""" return IKEPolicy( name="Example Name", version=1, - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/ike_proposal.py b/docs/examples/ike_proposal.py index 24c1764..454b3e9 100644 --- a/docs/examples/ike_proposal.py +++ b/docs/examples/ike_proposal.py @@ -7,6 +7,8 @@ - ike_proposal_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,15 +16,15 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "ike_proposal-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a IKEProposal entity.""" + """Main execution - demonstrates ingesting an IKEProposal entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - ike_proposal = ike_proposal_minimal() - # ike_proposal = ike_proposal_extended() - # ike_proposal = ike_proposal_explicit() + entity = ike_proposal_minimal() + # entity = ike_proposal_extended() + # entity = ike_proposal_explicit() - response = client.ingest(entities=[Entity(ike_proposal=ike_proposal)]) + response = client.ingest(entities=[Entity(ike_proposal=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -43,7 +45,7 @@ def main(): def ike_proposal_minimal() -> IKEProposal: - """Create a IKEProposal with only required fields using flat strings.""" + """Create an IKEProposal with only required fields using flat strings.""" return IKEProposal( name="Example Name", authentication_method="certificates", @@ -54,28 +56,29 @@ def ike_proposal_minimal() -> IKEProposal: def ike_proposal_extended() -> IKEProposal: - """Create a IKEProposal with common optional fields.""" + """Create an IKEProposal with common optional fields.""" return IKEProposal( name="Example Name", authentication_method="certificates", encryption_algorithm="3des-cbc", group=1, - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def ike_proposal_explicit() -> IKEProposal: - """Create a IKEProposal with fully nested objects and all common fields.""" + """Create an IKEProposal with fully nested objects and all common fields.""" return IKEProposal( name="Example Name", authentication_method="certificates", encryption_algorithm="3des-cbc", group=1, - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/interface_example.py b/docs/examples/interface_example.py index 39256ba..022eb37 100644 --- a/docs/examples/interface_example.py +++ b/docs/examples/interface_example.py @@ -2,32 +2,34 @@ Interface entity examples for the Diode Python SDK. This module demonstrates three patterns for ingesting Interface entities: -- interface_example_minimal: Required fields only -- interface_example_extended: Common optional fields -- interface_example_explicit: Fully nested objects with all fields +- interface_minimal: Required fields only +- interface_extended: Common optional fields +- interface_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, Interface, Manufacturer, Site, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "interface-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a Interface entity.""" + """Main execution - demonstrates ingesting an Interface entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -36,72 +38,86 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - interface = interface_example_minimal() - # interface = interface_example_extended() - # interface = interface_example_explicit() + entity = interface_minimal() + # entity = interface_extended() + # entity = interface_explicit() - response = client.ingest(entities=[Entity(interface=interface)]) + response = client.ingest(entities=[Entity(interface=entity)]) if response.errors: print(f"Errors: {response.errors}") else: print("Interface ingested successfully") -def interface_example_minimal() -> Interface: - """Create a Interface with only required fields using flat strings.""" +def interface_minimal() -> Interface: + """Create an Interface with only required fields using flat strings.""" return Interface( - device="Example Device", # flat string -> Device + device="example-device", # flat string -> Device name="Example Name", type="1000base-bx10-d", metadata={"source": "example"}, ) -def interface_example_extended() -> Interface: - """Create a Interface with common optional fields.""" +def interface_extended() -> Interface: + """Create an Interface with common optional fields.""" return Interface( - device="Example Device", + device="example-device", name="Example Name", type="1000base-bx10-d", - metadata={"source": "example"}, + label="Example label", description="Example description", + metadata={"source": "example"}, ) -def interface_example_explicit() -> Interface: - """Create a Interface with fully nested objects and all common fields.""" +def interface_explicit() -> Interface: + """Create an Interface with fully nested objects and all common fields.""" return Interface( device=Device( device_type=DeviceType( manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", type="1000base-bx10-d", - metadata={"source": "example"}, + label="Example label", description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/inventory_item.py b/docs/examples/inventory_item.py index 9f6137a..96a4ad3 100644 --- a/docs/examples/inventory_item.py +++ b/docs/examples/inventory_item.py @@ -7,27 +7,29 @@ - inventory_item_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, InventoryItem, Manufacturer, Site, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "inventory_item-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a InventoryItem entity.""" + """Main execution - demonstrates ingesting an InventoryItem entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -36,11 +38,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - inventory_item = inventory_item_minimal() - # inventory_item = inventory_item_extended() - # inventory_item = inventory_item_explicit() + entity = inventory_item_minimal() + # entity = inventory_item_extended() + # entity = inventory_item_explicit() - response = client.ingest(entities=[Entity(inventory_item=inventory_item)]) + response = client.ingest(entities=[Entity(inventory_item=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,62 +50,77 @@ def main(): def inventory_item_minimal() -> InventoryItem: - """Create a InventoryItem with only required fields using flat strings.""" + """Create an InventoryItem with only required fields using flat strings.""" return InventoryItem( - device="Example Device", # flat string -> Device + device="example-device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) def inventory_item_extended() -> InventoryItem: - """Create a InventoryItem with common optional fields.""" + """Create an InventoryItem with common optional fields.""" return InventoryItem( - device="Example Device", + device="example-device", name="Example Name", - metadata={"source": "example"}, + label="Example label", status="active", serial="SN-001234", + asset_tag="ASSET-001", description="Example description", + metadata={"source": "example"}, ) def inventory_item_explicit() -> InventoryItem: - """Create a InventoryItem with fully nested objects and all common fields.""" + """Create an InventoryItem with fully nested objects and all common fields.""" return InventoryItem( device=Device( device_type=DeviceType( manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + label="Example label", status="active", serial="SN-001234", asset_tag="ASSET-001", description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/inventory_item_role.py b/docs/examples/inventory_item_role.py index 51442b2..16383cc 100644 --- a/docs/examples/inventory_item_role.py +++ b/docs/examples/inventory_item_role.py @@ -7,6 +7,8 @@ - inventory_item_role_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,15 +16,15 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "inventory_item_role-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a InventoryItemRole entity.""" + """Main execution - demonstrates ingesting an InventoryItemRole entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -31,13 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - inventory_item_role = inventory_item_role_minimal() - # inventory_item_role = inventory_item_role_extended() - # inventory_item_role = inventory_item_role_explicit() + entity = inventory_item_role_minimal() + # entity = inventory_item_role_extended() + # entity = inventory_item_role_explicit() - response = client.ingest( - entities=[Entity(inventory_item_role=inventory_item_role)] - ) + response = client.ingest(entities=[Entity(inventory_item_role=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -45,7 +45,7 @@ def main(): def inventory_item_role_minimal() -> InventoryItemRole: - """Create a InventoryItemRole with only required fields using flat strings.""" + """Create an InventoryItemRole with only required fields using flat strings.""" return InventoryItemRole( name="Example Name", slug="example-slug", @@ -54,26 +54,27 @@ def inventory_item_role_minimal() -> InventoryItemRole: def inventory_item_role_extended() -> InventoryItemRole: - """Create a InventoryItemRole with common optional fields.""" + """Create an InventoryItemRole with common optional fields.""" return InventoryItemRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def inventory_item_role_explicit() -> InventoryItemRole: - """Create a InventoryItemRole with fully nested objects and all common fields.""" + """Create an InventoryItemRole with fully nested objects and all common fields.""" return InventoryItemRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/ip_address.py b/docs/examples/ip_address.py index d085f8a..2022924 100644 --- a/docs/examples/ip_address.py +++ b/docs/examples/ip_address.py @@ -7,6 +7,8 @@ - ip_address_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,15 +17,15 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "ip_address-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a IPAddress entity.""" + """Main execution - demonstrates ingesting an IPAddress entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - ip_address = ip_address_minimal() - # ip_address = ip_address_extended() - # ip_address = ip_address_explicit() + entity = ip_address_minimal() + # entity = ip_address_extended() + # entity = ip_address_explicit() - response = client.ingest(entities=[Entity(ip_address=ip_address)]) + response = client.ingest(entities=[Entity(ip_address=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -44,7 +46,7 @@ def main(): def ip_address_minimal() -> IPAddress: - """Create a IPAddress with only required fields using flat strings.""" + """Create an IPAddress with only required fields using flat strings.""" return IPAddress( address="192.0.2.1/32", metadata={"source": "example"}, @@ -52,27 +54,30 @@ def ip_address_minimal() -> IPAddress: def ip_address_extended() -> IPAddress: - """Create a IPAddress with common optional fields.""" + """Create an IPAddress with common optional fields.""" return IPAddress( address="192.0.2.1/32", - metadata={"source": "example"}, status="active", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def ip_address_explicit() -> IPAddress: - """Create a IPAddress with fully nested objects and all common fields.""" + """Create an IPAddress with fully nested objects and all common fields.""" return IPAddress( address="192.0.2.1/32", - metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/ip_range.py b/docs/examples/ip_range.py index 8abbf40..0918d4a 100644 --- a/docs/examples/ip_range.py +++ b/docs/examples/ip_range.py @@ -7,6 +7,8 @@ - ip_range_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,15 +17,15 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "ip_range-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a IPRange entity.""" + """Main execution - demonstrates ingesting an IPRange entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - ip_range = ip_range_minimal() - # ip_range = ip_range_extended() - # ip_range = ip_range_explicit() + entity = ip_range_minimal() + # entity = ip_range_extended() + # entity = ip_range_explicit() - response = client.ingest(entities=[Entity(ip_range=ip_range)]) + response = client.ingest(entities=[Entity(ip_range=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -44,38 +46,41 @@ def main(): def ip_range_minimal() -> IPRange: - """Create a IPRange with only required fields using flat strings.""" + """Create an IPRange with only required fields using flat strings.""" return IPRange( - start_address="Example Start Address", - end_address="Example End Address", + start_address="example-start-address", + end_address="example-end-address", metadata={"source": "example"}, ) def ip_range_extended() -> IPRange: - """Create a IPRange with common optional fields.""" + """Create an IPRange with common optional fields.""" return IPRange( - start_address="Example Start Address", - end_address="Example End Address", - metadata={"source": "example"}, + start_address="example-start-address", + end_address="example-end-address", status="active", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def ip_range_explicit() -> IPRange: - """Create a IPRange with fully nested objects and all common fields.""" + """Create an IPRange with fully nested objects and all common fields.""" return IPRange( - start_address="Example Start Address", - end_address="Example End Address", - metadata={"source": "example"}, + start_address="example-start-address", + end_address="example-end-address", status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/ip_sec_policy.py b/docs/examples/ip_sec_policy.py index 9240318..4adfaa2 100644 --- a/docs/examples/ip_sec_policy.py +++ b/docs/examples/ip_sec_policy.py @@ -7,6 +7,8 @@ - ip_sec_policy_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,15 +16,15 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "ip_sec_policy-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a IPSecPolicy entity.""" + """Main execution - demonstrates ingesting an IPSecPolicy entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - ip_sec_policy = ip_sec_policy_minimal() - # ip_sec_policy = ip_sec_policy_extended() - # ip_sec_policy = ip_sec_policy_explicit() + entity = ip_sec_policy_minimal() + # entity = ip_sec_policy_extended() + # entity = ip_sec_policy_explicit() - response = client.ingest(entities=[Entity(ip_sec_policy=ip_sec_policy)]) + response = client.ingest(entities=[Entity(ip_sec_policy=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -43,7 +45,7 @@ def main(): def ip_sec_policy_minimal() -> IPSecPolicy: - """Create a IPSecPolicy with only required fields using flat strings.""" + """Create an IPSecPolicy with only required fields using flat strings.""" return IPSecPolicy( name="Example Name", metadata={"source": "example"}, @@ -51,22 +53,23 @@ def ip_sec_policy_minimal() -> IPSecPolicy: def ip_sec_policy_extended() -> IPSecPolicy: - """Create a IPSecPolicy with common optional fields.""" + """Create an IPSecPolicy with common optional fields.""" return IPSecPolicy( name="Example Name", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def ip_sec_policy_explicit() -> IPSecPolicy: - """Create a IPSecPolicy with fully nested objects and all common fields.""" + """Create an IPSecPolicy with fully nested objects and all common fields.""" return IPSecPolicy( name="Example Name", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/ip_sec_profile.py b/docs/examples/ip_sec_profile.py index 0db78b4..eadd14e 100644 --- a/docs/examples/ip_sec_profile.py +++ b/docs/examples/ip_sec_profile.py @@ -7,6 +7,8 @@ - ip_sec_profile_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,15 +18,15 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "ip_sec_profile-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a IPSecProfile entity.""" + """Main execution - demonstrates ingesting an IPSecProfile entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -33,11 +35,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - ip_sec_profile = ip_sec_profile_minimal() - # ip_sec_profile = ip_sec_profile_extended() - # ip_sec_profile = ip_sec_profile_explicit() + entity = ip_sec_profile_minimal() + # entity = ip_sec_profile_extended() + # entity = ip_sec_profile_explicit() - response = client.ingest(entities=[Entity(ip_sec_profile=ip_sec_profile)]) + response = client.ingest(entities=[Entity(ip_sec_profile=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -45,41 +47,51 @@ def main(): def ip_sec_profile_minimal() -> IPSecProfile: - """Create a IPSecProfile with only required fields using flat strings.""" + """Create an IPSecProfile with only required fields using flat strings.""" return IPSecProfile( name="Example Name", mode="ah", - ike_policy="Example Ike Policy", # flat string -> IKEPolicy - ipsec_policy="Example Ipsec Policy", # flat string -> IPSecPolicy + ike_policy="example-ike-policy", # flat string -> IKEPolicy + ipsec_policy="example-ipsec-policy", # flat string -> IPSecPolicy metadata={"source": "example"}, ) def ip_sec_profile_extended() -> IPSecProfile: - """Create a IPSecProfile with common optional fields.""" + """Create an IPSecProfile with common optional fields.""" return IPSecProfile( name="Example Name", mode="ah", - ike_policy="Example Ike Policy", - ipsec_policy="Example Ipsec Policy", - metadata={"source": "example"}, + ike_policy="example-ike-policy", + ipsec_policy="example-ipsec-policy", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def ip_sec_profile_explicit() -> IPSecProfile: - """Create a IPSecProfile with fully nested objects and all common fields.""" + """Create an IPSecProfile with fully nested objects and all common fields.""" return IPSecProfile( name="Example Name", mode="ah", ike_policy=IKEPolicy( - name="Example Name", version=1, metadata={"source": "example"} + name="Example Name", + description="Example description", + version=1, + comments="Example comments", + metadata={"source": "example"}, + ), + ipsec_policy=IPSecPolicy( + name="Example Name", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), - ipsec_policy=IPSecPolicy(name="Example Name", metadata={"source": "example"}), - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/ip_sec_proposal.py b/docs/examples/ip_sec_proposal.py index 5e722f6..8e43452 100644 --- a/docs/examples/ip_sec_proposal.py +++ b/docs/examples/ip_sec_proposal.py @@ -7,6 +7,8 @@ - ip_sec_proposal_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,15 +16,15 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "ip_sec_proposal-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a IPSecProposal entity.""" + """Main execution - demonstrates ingesting an IPSecProposal entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - ip_sec_proposal = ip_sec_proposal_minimal() - # ip_sec_proposal = ip_sec_proposal_extended() - # ip_sec_proposal = ip_sec_proposal_explicit() + entity = ip_sec_proposal_minimal() + # entity = ip_sec_proposal_extended() + # entity = ip_sec_proposal_explicit() - response = client.ingest(entities=[Entity(ip_sec_proposal=ip_sec_proposal)]) + response = client.ingest(entities=[Entity(ip_sec_proposal=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -43,7 +45,7 @@ def main(): def ip_sec_proposal_minimal() -> IPSecProposal: - """Create a IPSecProposal with only required fields using flat strings.""" + """Create an IPSecProposal with only required fields using flat strings.""" return IPSecProposal( name="Example Name", metadata={"source": "example"}, @@ -51,22 +53,23 @@ def ip_sec_proposal_minimal() -> IPSecProposal: def ip_sec_proposal_extended() -> IPSecProposal: - """Create a IPSecProposal with common optional fields.""" + """Create an IPSecProposal with common optional fields.""" return IPSecProposal( name="Example Name", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def ip_sec_proposal_explicit() -> IPSecProposal: - """Create a IPSecProposal with fully nested objects and all common fields.""" + """Create an IPSecProposal with fully nested objects and all common fields.""" return IPSecProposal( name="Example Name", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/journal_entry.py b/docs/examples/journal_entry.py index 770ff5b..fc1f0e1 100644 --- a/docs/examples/journal_entry.py +++ b/docs/examples/journal_entry.py @@ -7,6 +7,8 @@ - journal_entry_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "journal_entry-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - journal_entry = journal_entry_minimal() - # journal_entry = journal_entry_extended() - # journal_entry = journal_entry_explicit() + entity = journal_entry_minimal() + # entity = journal_entry_extended() + # entity = journal_entry_explicit() - response = client.ingest(entities=[Entity(journal_entry=journal_entry)]) + response = client.ingest(entities=[Entity(journal_entry=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -62,8 +64,8 @@ def journal_entry_explicit() -> JournalEntry: """Create a JournalEntry with fully nested objects and all common fields.""" return JournalEntry( comments="Example comments", - metadata={"source": "example"}, tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/l2vpn.py b/docs/examples/l2vpn.py index 69d899d..9d4a6fd 100644 --- a/docs/examples/l2vpn.py +++ b/docs/examples/l2vpn.py @@ -7,6 +7,8 @@ - l2vpn_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "l2vpn-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - l2vpn = l2vpn_minimal() - # l2vpn = l2vpn_extended() - # l2vpn = l2vpn_explicit() + entity = l2vpn_minimal() + # entity = l2vpn_extended() + # entity = l2vpn_explicit() - response = client.ingest(entities=[Entity(l2vpn=l2vpn)]) + response = client.ingest(entities=[Entity(l2vpn=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -57,9 +59,10 @@ def l2vpn_extended() -> L2VPN: return L2VPN( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - status="active", description="Example description", + comments="Example comments", + status="active", + metadata={"source": "example"}, ) @@ -68,14 +71,16 @@ def l2vpn_explicit() -> L2VPN: return L2VPN( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - status="active", description="Example description", comments="Example comments", + status="active", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/l2vpn_termination.py b/docs/examples/l2vpn_termination.py index 2eb22e6..f6c58ab 100644 --- a/docs/examples/l2vpn_termination.py +++ b/docs/examples/l2vpn_termination.py @@ -7,6 +7,8 @@ - l2vpn_termination_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "l2vpn_termination-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - l2vpn_termination = l2vpn_termination_minimal() - # l2vpn_termination = l2vpn_termination_extended() - # l2vpn_termination = l2vpn_termination_explicit() + entity = l2vpn_termination_minimal() + # entity = l2vpn_termination_extended() + # entity = l2vpn_termination_explicit() - response = client.ingest(entities=[Entity(l2vpn_termination=l2vpn_termination)]) + response = client.ingest(entities=[Entity(l2vpn_termination=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,7 +48,7 @@ def main(): def l2vpn_termination_minimal() -> L2VPNTermination: """Create a L2VPNTermination with only required fields using flat strings.""" return L2VPNTermination( - l2vpn="Example L2Vpn", # flat string -> L2VPN + l2vpn="example-l2vpn", # flat string -> L2VPN metadata={"source": "example"}, ) @@ -54,7 +56,7 @@ def l2vpn_termination_minimal() -> L2VPNTermination: def l2vpn_termination_extended() -> L2VPNTermination: """Create a L2VPNTermination with common optional fields.""" return L2VPNTermination( - l2vpn="Example L2Vpn", + l2vpn="example-l2vpn", metadata={"source": "example"}, ) @@ -65,11 +67,13 @@ def l2vpn_termination_explicit() -> L2VPNTermination: l2vpn=L2VPN( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", status="active", metadata={"source": "example"}, ), - metadata={"source": "example"}, tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/location.py b/docs/examples/location.py index 9ec90e2..e93d5f1 100644 --- a/docs/examples/location.py +++ b/docs/examples/location.py @@ -7,6 +7,8 @@ - location_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +18,11 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "location-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -33,11 +35,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - location = location_minimal() - # location = location_extended() - # location = location_explicit() + entity = location_minimal() + # entity = location_extended() + # entity = location_explicit() - response = client.ingest(entities=[Entity(location=location)]) + response = client.ingest(entities=[Entity(location=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -49,7 +51,7 @@ def location_minimal() -> Location: return Location( name="Example Name", slug="example-slug", - site="Example Site", # flat string -> Site + site="example-site", # flat string -> Site metadata={"source": "example"}, ) @@ -59,10 +61,11 @@ def location_extended() -> Location: return Location( name="Example Name", slug="example-slug", - site="Example Site", - metadata={"source": "example"}, + site="example-site", status="active", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -75,16 +78,20 @@ def location_explicit() -> Location: name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), - metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/mac_address.py b/docs/examples/mac_address.py index 992fcc9..51ce71d 100644 --- a/docs/examples/mac_address.py +++ b/docs/examples/mac_address.py @@ -7,6 +7,8 @@ - mac_address_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "mac_address-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - mac_address = mac_address_minimal() - # mac_address = mac_address_extended() - # mac_address = mac_address_explicit() + entity = mac_address_minimal() + # entity = mac_address_extended() + # entity = mac_address_explicit() - response = client.ingest(entities=[Entity(mac_address=mac_address)]) + response = client.ingest(entities=[Entity(mac_address=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -45,7 +47,7 @@ def main(): def mac_address_minimal() -> MACAddress: """Create a MACAddress with only required fields using flat strings.""" return MACAddress( - mac_address="00:11:22:33:44:55", + mac_address="00:1A:2B:3C:4D:5E", metadata={"source": "example"}, ) @@ -53,20 +55,21 @@ def mac_address_minimal() -> MACAddress: def mac_address_extended() -> MACAddress: """Create a MACAddress with common optional fields.""" return MACAddress( - mac_address="00:11:22:33:44:55", - metadata={"source": "example"}, + mac_address="00:1A:2B:3C:4D:5E", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def mac_address_explicit() -> MACAddress: """Create a MACAddress with fully nested objects and all common fields.""" return MACAddress( - mac_address="00:11:22:33:44:55", - metadata={"source": "example"}, + mac_address="00:1A:2B:3C:4D:5E", description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/manufacturer.py b/docs/examples/manufacturer.py index 3195d15..261a45c 100644 --- a/docs/examples/manufacturer.py +++ b/docs/examples/manufacturer.py @@ -7,6 +7,8 @@ - manufacturer_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "manufacturer-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - manufacturer = manufacturer_minimal() - # manufacturer = manufacturer_extended() - # manufacturer = manufacturer_explicit() + entity = manufacturer_minimal() + # entity = manufacturer_extended() + # entity = manufacturer_explicit() - response = client.ingest(entities=[Entity(manufacturer=manufacturer)]) + response = client.ingest(entities=[Entity(manufacturer=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def manufacturer_extended() -> Manufacturer: return Manufacturer( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def manufacturer_explicit() -> Manufacturer: return Manufacturer( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/module.py b/docs/examples/module.py index 51095e3..ce0e030 100644 --- a/docs/examples/module.py +++ b/docs/examples/module.py @@ -7,12 +7,14 @@ - module_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, Manufacturer, Module, ModuleBay, @@ -21,11 +23,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "module-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -38,11 +40,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - module = module_minimal() - # module = module_extended() - # module = module_explicit() + entity = module_minimal() + # entity = module_extended() + # entity = module_explicit() - response = client.ingest(entities=[Entity(module=module)]) + response = client.ingest(entities=[Entity(module=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -52,9 +54,9 @@ def main(): def module_minimal() -> Module: """Create a Module with only required fields using flat strings.""" return Module( - device="Example Device", # flat string -> Device - module_bay="Example Module Bay", # flat string -> ModuleBay - module_type="Example Module Type", # flat string -> ModuleType + device="example-device", # flat string -> Device + module_bay="example-module-bay", # flat string -> ModuleBay + module_type="example-module-type", # flat string -> ModuleType metadata={"source": "example"}, ) @@ -62,13 +64,15 @@ def module_minimal() -> Module: def module_extended() -> Module: """Create a Module with common optional fields.""" return Module( - device="Example Device", - module_bay="Example Module Bay", - module_type="Example Module Type", - metadata={"source": "example"}, + device="example-device", + module_bay="example-module-bay", + module_type="example-module-type", status="active", serial="SN-001234", + asset_tag="ASSET-001", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -80,25 +84,37 @@ def module_explicit() -> Module: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), module_bay=ModuleBay( @@ -107,44 +123,64 @@ def module_explicit() -> Module: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", + label="Example label", + description="Example description", metadata={"source": "example"}, ), module_type=ModuleType( manufacturer=Manufacturer( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), model="Model X", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), - metadata={"source": "example"}, status="active", serial="SN-001234", asset_tag="ASSET-001", description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/module_bay.py b/docs/examples/module_bay.py index bcbcfba..f141f22 100644 --- a/docs/examples/module_bay.py +++ b/docs/examples/module_bay.py @@ -7,23 +7,25 @@ - module_bay_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, Manufacturer, ModuleBay, Site, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "module_bay-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -36,11 +38,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - module_bay = module_bay_minimal() - # module_bay = module_bay_extended() - # module_bay = module_bay_explicit() + entity = module_bay_minimal() + # entity = module_bay_extended() + # entity = module_bay_explicit() - response = client.ingest(entities=[Entity(module_bay=module_bay)]) + response = client.ingest(entities=[Entity(module_bay=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +52,7 @@ def main(): def module_bay_minimal() -> ModuleBay: """Create a ModuleBay with only required fields using flat strings.""" return ModuleBay( - device="Example Device", # flat string -> Device + device="example-device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -59,10 +61,11 @@ def module_bay_minimal() -> ModuleBay: def module_bay_extended() -> ModuleBay: """Create a ModuleBay with common optional fields.""" return ModuleBay( - device="Example Device", + device="example-device", name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", + metadata={"source": "example"}, ) @@ -74,31 +77,44 @@ def module_bay_explicit() -> ModuleBay: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/module_type.py b/docs/examples/module_type.py index 41f71ef..2cd48e3 100644 --- a/docs/examples/module_type.py +++ b/docs/examples/module_type.py @@ -7,6 +7,8 @@ - module_type_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "module_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - module_type = module_type_minimal() - # module_type = module_type_extended() - # module_type = module_type_explicit() + entity = module_type_minimal() + # entity = module_type_extended() + # entity = module_type_explicit() - response = client.ingest(entities=[Entity(module_type=module_type)]) + response = client.ingest(entities=[Entity(module_type=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,7 +48,7 @@ def main(): def module_type_minimal() -> ModuleType: """Create a ModuleType with only required fields using flat strings.""" return ModuleType( - manufacturer="Example Manufacturer", # flat string -> Manufacturer + manufacturer="example-manufacturer", # flat string -> Manufacturer model="Model X", metadata={"source": "example"}, ) @@ -55,10 +57,11 @@ def module_type_minimal() -> ModuleType: def module_type_extended() -> ModuleType: """Create a ModuleType with common optional fields.""" return ModuleType( - manufacturer="Example Manufacturer", + manufacturer="example-manufacturer", model="Model X", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,13 +69,17 @@ def module_type_explicit() -> ModuleType: """Create a ModuleType with fully nested objects and all common fields.""" return ModuleType( manufacturer=Manufacturer( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), model="Model X", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/module_type_profile.py b/docs/examples/module_type_profile.py index 37e2fe1..80c01a6 100644 --- a/docs/examples/module_type_profile.py +++ b/docs/examples/module_type_profile.py @@ -7,6 +7,8 @@ - module_type_profile_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "module_type_profile-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,13 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - module_type_profile = module_type_profile_minimal() - # module_type_profile = module_type_profile_extended() - # module_type_profile = module_type_profile_explicit() + entity = module_type_profile_minimal() + # entity = module_type_profile_extended() + # entity = module_type_profile_explicit() - response = client.ingest( - entities=[Entity(module_type_profile=module_type_profile)] - ) + response = client.ingest(entities=[Entity(module_type_profile=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +56,9 @@ def module_type_profile_extended() -> ModuleTypeProfile: """Create a ModuleTypeProfile with common optional fields.""" return ModuleTypeProfile( name="Example Name", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -65,10 +66,10 @@ def module_type_profile_explicit() -> ModuleTypeProfile: """Create a ModuleTypeProfile with fully nested objects and all common fields.""" return ModuleTypeProfile( name="Example Name", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/owner.py b/docs/examples/owner.py index 42a9753..6725668 100644 --- a/docs/examples/owner.py +++ b/docs/examples/owner.py @@ -7,6 +7,8 @@ - owner_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,15 +16,15 @@ OwnerGroup, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "owner-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a Owner entity.""" + """Main execution - demonstrates ingesting an Owner entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - owner = owner_minimal() - # owner = owner_extended() - # owner = owner_explicit() + entity = owner_minimal() + # entity = owner_extended() + # entity = owner_explicit() - response = client.ingest(entities=[Entity(owner=owner)]) + response = client.ingest(entities=[Entity(owner=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -43,31 +45,35 @@ def main(): def owner_minimal() -> Owner: - """Create a Owner with only required fields using flat strings.""" + """Create an Owner with only required fields using flat strings.""" return Owner( name="Example Name", - group="Example Group", # flat string -> OwnerGroup + group="example-group", # flat string -> OwnerGroup metadata={"source": "example"}, ) def owner_extended() -> Owner: - """Create a Owner with common optional fields.""" + """Create an Owner with common optional fields.""" return Owner( name="Example Name", - group="Example Group", - metadata={"source": "example"}, + group="example-group", description="Example description", + metadata={"source": "example"}, ) def owner_explicit() -> Owner: - """Create a Owner with fully nested objects and all common fields.""" + """Create an Owner with fully nested objects and all common fields.""" return Owner( name="Example Name", - group=OwnerGroup(name="Example Name", metadata={"source": "example"}), - metadata={"source": "example"}, + group=OwnerGroup( + name="Example Name", + description="Example description", + metadata={"source": "example"}, + ), description="Example description", + metadata={"source": "example"}, ) diff --git a/docs/examples/owner_group.py b/docs/examples/owner_group.py index 4484758..a7c6f7f 100644 --- a/docs/examples/owner_group.py +++ b/docs/examples/owner_group.py @@ -7,17 +7,23 @@ - owner_group_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + OwnerGroup, +) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "owner_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): - """Main execution - demonstrates ingesting a OwnerGroup entity.""" + """Main execution - demonstrates ingesting an OwnerGroup entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -26,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - owner_group = owner_group_minimal() - # owner_group = owner_group_extended() - # owner_group = owner_group_explicit() + entity = owner_group_minimal() + # entity = owner_group_extended() + # entity = owner_group_explicit() - response = client.ingest(entities=[Entity(owner_group=owner_group)]) + response = client.ingest(entities=[Entity(owner_group=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -38,7 +44,7 @@ def main(): def owner_group_minimal() -> OwnerGroup: - """Create a OwnerGroup with only required fields using flat strings.""" + """Create an OwnerGroup with only required fields using flat strings.""" return OwnerGroup( name="Example Name", metadata={"source": "example"}, @@ -46,20 +52,20 @@ def owner_group_minimal() -> OwnerGroup: def owner_group_extended() -> OwnerGroup: - """Create a OwnerGroup with common optional fields.""" + """Create an OwnerGroup with common optional fields.""" return OwnerGroup( name="Example Name", - metadata={"source": "example"}, description="Example description", + metadata={"source": "example"}, ) def owner_group_explicit() -> OwnerGroup: - """Create a OwnerGroup with fully nested objects and all common fields.""" + """Create an OwnerGroup with fully nested objects and all common fields.""" return OwnerGroup( name="Example Name", - metadata={"source": "example"}, description="Example description", + metadata={"source": "example"}, ) diff --git a/docs/examples/platform.py b/docs/examples/platform.py index 7615f01..533cb28 100644 --- a/docs/examples/platform.py +++ b/docs/examples/platform.py @@ -7,6 +7,8 @@ - platform_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "platform-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - platform = platform_minimal() - # platform = platform_extended() - # platform = platform_explicit() + entity = platform_minimal() + # entity = platform_extended() + # entity = platform_explicit() - response = client.ingest(entities=[Entity(platform=platform)]) + response = client.ingest(entities=[Entity(platform=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def platform_extended() -> Platform: return Platform( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def platform_explicit() -> Platform: return Platform( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/power_feed.py b/docs/examples/power_feed.py index 586624a..8238669 100644 --- a/docs/examples/power_feed.py +++ b/docs/examples/power_feed.py @@ -7,6 +7,8 @@ - power_feed_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +19,11 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "power_feed-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -34,11 +36,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - power_feed = power_feed_minimal() - # power_feed = power_feed_extended() - # power_feed = power_feed_explicit() + entity = power_feed_minimal() + # entity = power_feed_extended() + # entity = power_feed_explicit() - response = client.ingest(entities=[Entity(power_feed=power_feed)]) + response = client.ingest(entities=[Entity(power_feed=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +50,7 @@ def main(): def power_feed_minimal() -> PowerFeed: """Create a PowerFeed with only required fields using flat strings.""" return PowerFeed( - power_panel="Example Power Panel", # flat string -> PowerPanel + power_panel="example-power-panel", # flat string -> PowerPanel name="Example Name", metadata={"source": "example"}, ) @@ -57,11 +59,12 @@ def power_feed_minimal() -> PowerFeed: def power_feed_extended() -> PowerFeed: """Create a PowerFeed with common optional fields.""" return PowerFeed( - power_panel="Example Power Panel", + power_panel="example-power-panel", name="Example Name", - metadata={"source": "example"}, status="active", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -73,20 +76,26 @@ def power_feed_explicit() -> PowerFeed: name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/power_outlet.py b/docs/examples/power_outlet.py index e5ee4ae..1e21bd1 100644 --- a/docs/examples/power_outlet.py +++ b/docs/examples/power_outlet.py @@ -7,23 +7,25 @@ - power_outlet_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, Manufacturer, PowerOutlet, Site, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "power_outlet-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -36,11 +38,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - power_outlet = power_outlet_minimal() - # power_outlet = power_outlet_extended() - # power_outlet = power_outlet_explicit() + entity = power_outlet_minimal() + # entity = power_outlet_extended() + # entity = power_outlet_explicit() - response = client.ingest(entities=[Entity(power_outlet=power_outlet)]) + response = client.ingest(entities=[Entity(power_outlet=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +52,7 @@ def main(): def power_outlet_minimal() -> PowerOutlet: """Create a PowerOutlet with only required fields using flat strings.""" return PowerOutlet( - device="Example Device", # flat string -> Device + device="example-device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -59,12 +61,13 @@ def power_outlet_minimal() -> PowerOutlet: def power_outlet_extended() -> PowerOutlet: """Create a PowerOutlet with common optional fields.""" return PowerOutlet( - device="Example Device", + device="example-device", name="Example Name", - metadata={"source": "example"}, - status="disabled", + label="Example label", color="0000ff", description="Example description", + status="disabled", + metadata={"source": "example"}, ) @@ -76,33 +79,46 @@ def power_outlet_explicit() -> PowerOutlet: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, - status="disabled", + label="Example label", color="0000ff", description="Example description", + status="disabled", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/power_panel.py b/docs/examples/power_panel.py index c83a8ae..01bb5d0 100644 --- a/docs/examples/power_panel.py +++ b/docs/examples/power_panel.py @@ -7,6 +7,8 @@ - power_panel_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "power_panel-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - power_panel = power_panel_minimal() - # power_panel = power_panel_extended() - # power_panel = power_panel_explicit() + entity = power_panel_minimal() + # entity = power_panel_extended() + # entity = power_panel_explicit() - response = client.ingest(entities=[Entity(power_panel=power_panel)]) + response = client.ingest(entities=[Entity(power_panel=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,7 +48,7 @@ def main(): def power_panel_minimal() -> PowerPanel: """Create a PowerPanel with only required fields using flat strings.""" return PowerPanel( - site="Example Site", # flat string -> Site + site="example-site", # flat string -> Site name="Example Name", metadata={"source": "example"}, ) @@ -55,10 +57,11 @@ def power_panel_minimal() -> PowerPanel: def power_panel_extended() -> PowerPanel: """Create a PowerPanel with common optional fields.""" return PowerPanel( - site="Example Site", + site="example-site", name="Example Name", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -69,13 +72,15 @@ def power_panel_explicit() -> PowerPanel: name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/power_port.py b/docs/examples/power_port.py index 6dcf618..6f4834c 100644 --- a/docs/examples/power_port.py +++ b/docs/examples/power_port.py @@ -7,23 +7,25 @@ - power_port_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, Manufacturer, PowerPort, Site, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "power_port-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -36,11 +38,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - power_port = power_port_minimal() - # power_port = power_port_extended() - # power_port = power_port_explicit() + entity = power_port_minimal() + # entity = power_port_extended() + # entity = power_port_explicit() - response = client.ingest(entities=[Entity(power_port=power_port)]) + response = client.ingest(entities=[Entity(power_port=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +52,7 @@ def main(): def power_port_minimal() -> PowerPort: """Create a PowerPort with only required fields using flat strings.""" return PowerPort( - device="Example Device", # flat string -> Device + device="example-device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -59,10 +61,11 @@ def power_port_minimal() -> PowerPort: def power_port_extended() -> PowerPort: """Create a PowerPort with common optional fields.""" return PowerPort( - device="Example Device", + device="example-device", name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", + metadata={"source": "example"}, ) @@ -74,31 +77,44 @@ def power_port_explicit() -> PowerPort: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + label="Example label", description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/prefix.py b/docs/examples/prefix.py index b3bd3ac..6ce16c4 100644 --- a/docs/examples/prefix.py +++ b/docs/examples/prefix.py @@ -7,6 +7,8 @@ - prefix_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "prefix-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - prefix = prefix_minimal() - # prefix = prefix_extended() - # prefix = prefix_explicit() + entity = prefix_minimal() + # entity = prefix_extended() + # entity = prefix_explicit() - response = client.ingest(entities=[Entity(prefix=prefix)]) + response = client.ingest(entities=[Entity(prefix=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -55,9 +57,10 @@ def prefix_extended() -> Prefix: """Create a Prefix with common optional fields.""" return Prefix( prefix="192.0.2.0/24", - metadata={"source": "example"}, status="active", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -65,14 +68,16 @@ def prefix_explicit() -> Prefix: """Create a Prefix with fully nested objects and all common fields.""" return Prefix( prefix="192.0.2.0/24", - metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/provider.py b/docs/examples/provider.py index 22ece7c..553fc03 100644 --- a/docs/examples/provider.py +++ b/docs/examples/provider.py @@ -7,6 +7,8 @@ - provider_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "provider-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - provider = provider_minimal() - # provider = provider_extended() - # provider = provider_explicit() + entity = provider_minimal() + # entity = provider_extended() + # entity = provider_explicit() - response = client.ingest(entities=[Entity(provider=provider)]) + response = client.ingest(entities=[Entity(provider=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def provider_extended() -> Provider: return Provider( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def provider_explicit() -> Provider: return Provider( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/provider_account.py b/docs/examples/provider_account.py index 021c13e..cf45516 100644 --- a/docs/examples/provider_account.py +++ b/docs/examples/provider_account.py @@ -7,6 +7,8 @@ - provider_account_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "provider_account-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - provider_account = provider_account_minimal() - # provider_account = provider_account_extended() - # provider_account = provider_account_explicit() + entity = provider_account_minimal() + # entity = provider_account_extended() + # entity = provider_account_explicit() - response = client.ingest(entities=[Entity(provider_account=provider_account)]) + response = client.ingest(entities=[Entity(provider_account=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,8 +48,8 @@ def main(): def provider_account_minimal() -> ProviderAccount: """Create a ProviderAccount with only required fields using flat strings.""" return ProviderAccount( - provider="Example Provider", # flat string -> Provider - account="Example Account", + provider="example-provider", # flat string -> Provider + account="example-account", metadata={"source": "example"}, ) @@ -55,10 +57,11 @@ def provider_account_minimal() -> ProviderAccount: def provider_account_extended() -> ProviderAccount: """Create a ProviderAccount with common optional fields.""" return ProviderAccount( - provider="Example Provider", - account="Example Account", - metadata={"source": "example"}, + provider="example-provider", + account="example-account", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,13 +69,17 @@ def provider_account_explicit() -> ProviderAccount: """Create a ProviderAccount with fully nested objects and all common fields.""" return ProviderAccount( provider=Provider( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), - account="Example Account", - metadata={"source": "example"}, + account="example-account", description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/provider_network.py b/docs/examples/provider_network.py index 0a411d2..f502938 100644 --- a/docs/examples/provider_network.py +++ b/docs/examples/provider_network.py @@ -7,6 +7,8 @@ - provider_network_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "provider_network-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - provider_network = provider_network_minimal() - # provider_network = provider_network_extended() - # provider_network = provider_network_explicit() + entity = provider_network_minimal() + # entity = provider_network_extended() + # entity = provider_network_explicit() - response = client.ingest(entities=[Entity(provider_network=provider_network)]) + response = client.ingest(entities=[Entity(provider_network=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,7 +48,7 @@ def main(): def provider_network_minimal() -> ProviderNetwork: """Create a ProviderNetwork with only required fields using flat strings.""" return ProviderNetwork( - provider="Example Provider", # flat string -> Provider + provider="example-provider", # flat string -> Provider name="Example Name", metadata={"source": "example"}, ) @@ -55,10 +57,11 @@ def provider_network_minimal() -> ProviderNetwork: def provider_network_extended() -> ProviderNetwork: """Create a ProviderNetwork with common optional fields.""" return ProviderNetwork( - provider="Example Provider", + provider="example-provider", name="Example Name", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,13 +69,17 @@ def provider_network_explicit() -> ProviderNetwork: """Create a ProviderNetwork with fully nested objects and all common fields.""" return ProviderNetwork( provider=Provider( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/rack.py b/docs/examples/rack.py index dbaf88f..99cfbdd 100644 --- a/docs/examples/rack.py +++ b/docs/examples/rack.py @@ -7,6 +7,8 @@ - rack_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +18,11 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "rack-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -33,11 +35,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - rack = rack_minimal() - # rack = rack_extended() - # rack = rack_explicit() + entity = rack_minimal() + # entity = rack_extended() + # entity = rack_explicit() - response = client.ingest(entities=[Entity(rack=rack)]) + response = client.ingest(entities=[Entity(rack=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +50,7 @@ def rack_minimal() -> Rack: """Create a Rack with only required fields using flat strings.""" return Rack( name="Example Name", - site="Example Site", # flat string -> Site + site="example-site", # flat string -> Site metadata={"source": "example"}, ) @@ -57,11 +59,13 @@ def rack_extended() -> Rack: """Create a Rack with common optional fields.""" return Rack( name="Example Name", - site="Example Site", - metadata={"source": "example"}, + site="example-site", status="active", serial="SN-001234", + asset_tag="ASSET-001", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -73,18 +77,22 @@ def rack_explicit() -> Rack: name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), - metadata={"source": "example"}, status="active", serial="SN-001234", asset_tag="ASSET-001", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/rack_reservation.py b/docs/examples/rack_reservation.py index ff3b73f..5d86cc0 100644 --- a/docs/examples/rack_reservation.py +++ b/docs/examples/rack_reservation.py @@ -7,6 +7,8 @@ - rack_reservation_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +19,11 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "rack_reservation-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -34,11 +36,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - rack_reservation = rack_reservation_minimal() - # rack_reservation = rack_reservation_extended() - # rack_reservation = rack_reservation_explicit() + entity = rack_reservation_minimal() + # entity = rack_reservation_extended() + # entity = rack_reservation_explicit() - response = client.ingest(entities=[Entity(rack_reservation=rack_reservation)]) + response = client.ingest(entities=[Entity(rack_reservation=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +50,7 @@ def main(): def rack_reservation_minimal() -> RackReservation: """Create a RackReservation with only required fields using flat strings.""" return RackReservation( - rack="Example Rack", # flat string -> Rack + rack="example-rack", # flat string -> Rack description="Example description", metadata={"source": "example"}, ) @@ -57,10 +59,11 @@ def rack_reservation_minimal() -> RackReservation: def rack_reservation_extended() -> RackReservation: """Create a RackReservation with common optional fields.""" return RackReservation( - rack="Example Rack", + rack="example-rack", description="Example description", - metadata={"source": "example"}, + comments="Example comments", status="active", + metadata={"source": "example"}, ) @@ -73,19 +76,27 @@ def rack_reservation_explicit() -> RackReservation: name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + serial="SN-001234", + asset_tag="ASSET-001", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), description="Example description", - metadata={"source": "example"}, - status="active", comments="Example comments", + status="active", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/rack_role.py b/docs/examples/rack_role.py index de333da..68723c2 100644 --- a/docs/examples/rack_role.py +++ b/docs/examples/rack_role.py @@ -7,6 +7,8 @@ - rack_role_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "rack_role-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - rack_role = rack_role_minimal() - # rack_role = rack_role_extended() - # rack_role = rack_role_explicit() + entity = rack_role_minimal() + # entity = rack_role_extended() + # entity = rack_role_explicit() - response = client.ingest(entities=[Entity(rack_role=rack_role)]) + response = client.ingest(entities=[Entity(rack_role=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,9 +58,10 @@ def rack_role_extended() -> RackRole: return RackRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -67,11 +70,11 @@ def rack_role_explicit() -> RackRole: return RackRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/rack_type.py b/docs/examples/rack_type.py index a45fc87..03cdab6 100644 --- a/docs/examples/rack_type.py +++ b/docs/examples/rack_type.py @@ -7,6 +7,8 @@ - rack_type_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "rack_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - rack_type = rack_type_minimal() - # rack_type = rack_type_extended() - # rack_type = rack_type_explicit() + entity = rack_type_minimal() + # entity = rack_type_extended() + # entity = rack_type_explicit() - response = client.ingest(entities=[Entity(rack_type=rack_type)]) + response = client.ingest(entities=[Entity(rack_type=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,7 +48,7 @@ def main(): def rack_type_minimal() -> RackType: """Create a RackType with only required fields using flat strings.""" return RackType( - manufacturer="Example Manufacturer", # flat string -> Manufacturer + manufacturer="example-manufacturer", # flat string -> Manufacturer model="Model X", slug="example-slug", metadata={"source": "example"}, @@ -56,11 +58,12 @@ def rack_type_minimal() -> RackType: def rack_type_extended() -> RackType: """Create a RackType with common optional fields.""" return RackType( - manufacturer="Example Manufacturer", + manufacturer="example-manufacturer", model="Model X", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -68,14 +71,18 @@ def rack_type_explicit() -> RackType: """Create a RackType with fully nested objects and all common fields.""" return RackType( manufacturer=Manufacturer( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), model="Model X", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/rear_port.py b/docs/examples/rear_port.py index 3060611..198dc26 100644 --- a/docs/examples/rear_port.py +++ b/docs/examples/rear_port.py @@ -7,23 +7,25 @@ - rear_port_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, Manufacturer, RearPort, Site, Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "rear_port-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -36,11 +38,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - rear_port = rear_port_minimal() - # rear_port = rear_port_extended() - # rear_port = rear_port_explicit() + entity = rear_port_minimal() + # entity = rear_port_extended() + # entity = rear_port_explicit() - response = client.ingest(entities=[Entity(rear_port=rear_port)]) + response = client.ingest(entities=[Entity(rear_port=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +52,7 @@ def main(): def rear_port_minimal() -> RearPort: """Create a RearPort with only required fields using flat strings.""" return RearPort( - device="Example Device", # flat string -> Device + device="example-device", # flat string -> Device name="Example Name", type="110-punch", metadata={"source": "example"}, @@ -60,12 +62,13 @@ def rear_port_minimal() -> RearPort: def rear_port_extended() -> RearPort: """Create a RearPort with common optional fields.""" return RearPort( - device="Example Device", + device="example-device", name="Example Name", type="110-punch", - metadata={"source": "example"}, + label="Example label", color="0000ff", description="Example description", + metadata={"source": "example"}, ) @@ -77,33 +80,46 @@ def rear_port_explicit() -> RearPort: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", type="110-punch", - metadata={"source": "example"}, + label="Example label", color="0000ff", description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/region.py b/docs/examples/region.py index d38de88..53c2499 100644 --- a/docs/examples/region.py +++ b/docs/examples/region.py @@ -7,6 +7,8 @@ - region_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "region-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - region = region_minimal() - # region = region_extended() - # region = region_explicit() + entity = region_minimal() + # entity = region_extended() + # entity = region_explicit() - response = client.ingest(entities=[Entity(region=region)]) + response = client.ingest(entities=[Entity(region=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def region_extended() -> Region: return Region( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def region_explicit() -> Region: return Region( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/rir.py b/docs/examples/rir.py index 0a8e44f..07a6fb5 100644 --- a/docs/examples/rir.py +++ b/docs/examples/rir.py @@ -7,6 +7,8 @@ - rir_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "rir-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - rir = rir_minimal() - # rir = rir_extended() - # rir = rir_explicit() + entity = rir_minimal() + # entity = rir_extended() + # entity = rir_explicit() - response = client.ingest(entities=[Entity(rir=rir)]) + response = client.ingest(entities=[Entity(rir=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def rir_extended() -> RIR: return RIR( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def rir_explicit() -> RIR: return RIR( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/role.py b/docs/examples/role.py index 2a5ee6e..c8942d3 100644 --- a/docs/examples/role.py +++ b/docs/examples/role.py @@ -7,6 +7,8 @@ - role_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "role-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - role = role_minimal() - # role = role_extended() - # role = role_explicit() + entity = role_minimal() + # entity = role_extended() + # entity = role_explicit() - response = client.ingest(entities=[Entity(role=role)]) + response = client.ingest(entities=[Entity(role=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def role_extended() -> Role: return Role( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def role_explicit() -> Role: return Role( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/route_target.py b/docs/examples/route_target.py index 3a75ffb..3dc22b0 100644 --- a/docs/examples/route_target.py +++ b/docs/examples/route_target.py @@ -7,6 +7,8 @@ - route_target_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "route_target-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - route_target = route_target_minimal() - # route_target = route_target_extended() - # route_target = route_target_explicit() + entity = route_target_minimal() + # entity = route_target_extended() + # entity = route_target_explicit() - response = client.ingest(entities=[Entity(route_target=route_target)]) + response = client.ingest(entities=[Entity(route_target=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -55,8 +57,9 @@ def route_target_extended() -> RouteTarget: """Create a RouteTarget with common optional fields.""" return RouteTarget( name="Example Name", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -64,13 +67,15 @@ def route_target_explicit() -> RouteTarget: """Create a RouteTarget with fully nested objects and all common fields.""" return RouteTarget( name="Example Name", - metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/service.py b/docs/examples/service.py index e29bfe9..196b057 100644 --- a/docs/examples/service.py +++ b/docs/examples/service.py @@ -7,6 +7,8 @@ - service_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "service-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - service = service_minimal() - # service = service_extended() - # service = service_explicit() + entity = service_minimal() + # entity = service_extended() + # entity = service_explicit() - response = client.ingest(entities=[Entity(service=service)]) + response = client.ingest(entities=[Entity(service=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -54,8 +56,9 @@ def service_extended() -> Service: """Create a Service with common optional fields.""" return Service( name="Example Name", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -63,10 +66,10 @@ def service_explicit() -> Service: """Create a Service with fully nested objects and all common fields.""" return Service( name="Example Name", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/site.py b/docs/examples/site.py index c4cd529..987595c 100644 --- a/docs/examples/site.py +++ b/docs/examples/site.py @@ -7,6 +7,8 @@ - site_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "site-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - site = site_minimal() - # site = site_extended() - # site = site_explicit() + entity = site_minimal() + # entity = site_extended() + # entity = site_explicit() - response = client.ingest(entities=[Entity(site=site)]) + response = client.ingest(entities=[Entity(site=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -57,9 +59,10 @@ def site_extended() -> Site: return Site( name="Example Name", slug="example-slug", - metadata={"source": "example"}, status="active", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -68,14 +71,16 @@ def site_explicit() -> Site: return Site( name="Example Name", slug="example-slug", - metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/site_group.py b/docs/examples/site_group.py index 00eba4e..fef9b27 100644 --- a/docs/examples/site_group.py +++ b/docs/examples/site_group.py @@ -7,6 +7,8 @@ - site_group_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tag, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "site_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - site_group = site_group_minimal() - # site_group = site_group_extended() - # site_group = site_group_explicit() + entity = site_group_minimal() + # entity = site_group_extended() + # entity = site_group_explicit() - response = client.ingest(entities=[Entity(site_group=site_group)]) + response = client.ingest(entities=[Entity(site_group=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def site_group_extended() -> SiteGroup: return SiteGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def site_group_explicit() -> SiteGroup: return SiteGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/tag.py b/docs/examples/tag.py index 573a575..ca9ccf4 100644 --- a/docs/examples/tag.py +++ b/docs/examples/tag.py @@ -7,13 +7,19 @@ - tag_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Tag, +) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "tag-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -26,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - tag = tag_minimal() - # tag = tag_extended() - # tag = tag_explicit() + entity = tag_minimal() + # entity = tag_extended() + # entity = tag_explicit() - response = client.ingest(entities=[Entity(tag=tag)]) + response = client.ingest(entities=[Entity(tag=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -51,9 +57,9 @@ def tag_extended() -> Tag: return Tag( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", + metadata={"source": "example"}, ) @@ -62,9 +68,9 @@ def tag_explicit() -> Tag: return Tag( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", + metadata={"source": "example"}, ) diff --git a/docs/examples/tenant.py b/docs/examples/tenant.py index 5164cd3..d50f8bb 100644 --- a/docs/examples/tenant.py +++ b/docs/examples/tenant.py @@ -7,6 +7,8 @@ - tenant_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ Tenant, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "tenant-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - tenant = tenant_minimal() - # tenant = tenant_extended() - # tenant = tenant_explicit() + entity = tenant_minimal() + # entity = tenant_extended() + # entity = tenant_explicit() - response = client.ingest(entities=[Entity(tenant=tenant)]) + response = client.ingest(entities=[Entity(tenant=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def tenant_extended() -> Tenant: return Tenant( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def tenant_explicit() -> Tenant: return Tenant( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/tenant_group.py b/docs/examples/tenant_group.py index d00eb1f..dc472ce 100644 --- a/docs/examples/tenant_group.py +++ b/docs/examples/tenant_group.py @@ -7,6 +7,8 @@ - tenant_group_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ TenantGroup, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "tenant_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - tenant_group = tenant_group_minimal() - # tenant_group = tenant_group_extended() - # tenant_group = tenant_group_explicit() + entity = tenant_group_minimal() + # entity = tenant_group_extended() + # entity = tenant_group_explicit() - response = client.ingest(entities=[Entity(tenant_group=tenant_group)]) + response = client.ingest(entities=[Entity(tenant_group=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def tenant_group_extended() -> TenantGroup: return TenantGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def tenant_group_explicit() -> TenantGroup: return TenantGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/tunnel.py b/docs/examples/tunnel.py index 31cb4c2..ed24b73 100644 --- a/docs/examples/tunnel.py +++ b/docs/examples/tunnel.py @@ -7,6 +7,8 @@ - tunnel_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ Tunnel, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "tunnel-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - tunnel = tunnel_minimal() - # tunnel = tunnel_extended() - # tunnel = tunnel_explicit() + entity = tunnel_minimal() + # entity = tunnel_extended() + # entity = tunnel_explicit() - response = client.ingest(entities=[Entity(tunnel=tunnel)]) + response = client.ingest(entities=[Entity(tunnel=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -59,8 +61,9 @@ def tunnel_extended() -> Tunnel: name="Example Name", status="active", encapsulation="gre", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -70,13 +73,15 @@ def tunnel_explicit() -> Tunnel: name="Example Name", status="active", encapsulation="gre", - metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/tunnel_group.py b/docs/examples/tunnel_group.py index a1018c6..4cbe32d 100644 --- a/docs/examples/tunnel_group.py +++ b/docs/examples/tunnel_group.py @@ -7,6 +7,8 @@ - tunnel_group_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ TunnelGroup, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "tunnel_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - tunnel_group = tunnel_group_minimal() - # tunnel_group = tunnel_group_extended() - # tunnel_group = tunnel_group_explicit() + entity = tunnel_group_minimal() + # entity = tunnel_group_extended() + # entity = tunnel_group_explicit() - response = client.ingest(entities=[Entity(tunnel_group=tunnel_group)]) + response = client.ingest(entities=[Entity(tunnel_group=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,8 +58,9 @@ def tunnel_group_extended() -> TunnelGroup: return TunnelGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -66,10 +69,10 @@ def tunnel_group_explicit() -> TunnelGroup: return TunnelGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/tunnel_termination.py b/docs/examples/tunnel_termination.py index 07c64e3..f7da237 100644 --- a/docs/examples/tunnel_termination.py +++ b/docs/examples/tunnel_termination.py @@ -7,6 +7,8 @@ - tunnel_termination_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ TunnelTermination, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "tunnel_termination-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,13 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - tunnel_termination = tunnel_termination_minimal() - # tunnel_termination = tunnel_termination_extended() - # tunnel_termination = tunnel_termination_explicit() + entity = tunnel_termination_minimal() + # entity = tunnel_termination_extended() + # entity = tunnel_termination_explicit() - response = client.ingest( - entities=[Entity(tunnel_termination=tunnel_termination)] - ) + response = client.ingest(entities=[Entity(tunnel_termination=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +48,7 @@ def main(): def tunnel_termination_minimal() -> TunnelTermination: """Create a TunnelTermination with only required fields using flat strings.""" return TunnelTermination( - tunnel="Example Tunnel", # flat string -> Tunnel + tunnel="example-tunnel", # flat string -> Tunnel role="hub", metadata={"source": "example"}, ) @@ -57,7 +57,7 @@ def tunnel_termination_minimal() -> TunnelTermination: def tunnel_termination_extended() -> TunnelTermination: """Create a TunnelTermination with common optional fields.""" return TunnelTermination( - tunnel="Example Tunnel", + tunnel="example-tunnel", role="hub", metadata={"source": "example"}, ) @@ -69,12 +69,14 @@ def tunnel_termination_explicit() -> TunnelTermination: tunnel=Tunnel( name="Example Name", status="active", - encapsulation="Example Encapsulation", + encapsulation="gre", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role="hub", - metadata={"source": "example"}, tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_chassis.py b/docs/examples/virtual_chassis.py index e3c09de..d3ffee1 100644 --- a/docs/examples/virtual_chassis.py +++ b/docs/examples/virtual_chassis.py @@ -7,6 +7,8 @@ - virtual_chassis_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ VirtualChassis, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "virtual_chassis-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - virtual_chassis = virtual_chassis_minimal() - # virtual_chassis = virtual_chassis_extended() - # virtual_chassis = virtual_chassis_explicit() + entity = virtual_chassis_minimal() + # entity = virtual_chassis_extended() + # entity = virtual_chassis_explicit() - response = client.ingest(entities=[Entity(virtual_chassis=virtual_chassis)]) + response = client.ingest(entities=[Entity(virtual_chassis=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -54,8 +56,9 @@ def virtual_chassis_extended() -> VirtualChassis: """Create a VirtualChassis with common optional fields.""" return VirtualChassis( name="Example Name", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -63,10 +66,10 @@ def virtual_chassis_explicit() -> VirtualChassis: """Create a VirtualChassis with fully nested objects and all common fields.""" return VirtualChassis( name="Example Name", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_circuit.py b/docs/examples/virtual_circuit.py index b7fa678..0bffbf9 100644 --- a/docs/examples/virtual_circuit.py +++ b/docs/examples/virtual_circuit.py @@ -7,6 +7,8 @@ - virtual_circuit_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -18,11 +20,11 @@ VirtualCircuitType, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "virtual_circuit-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -35,11 +37,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - virtual_circuit = virtual_circuit_minimal() - # virtual_circuit = virtual_circuit_extended() - # virtual_circuit = virtual_circuit_explicit() + entity = virtual_circuit_minimal() + # entity = virtual_circuit_extended() + # entity = virtual_circuit_explicit() - response = client.ingest(entities=[Entity(virtual_circuit=virtual_circuit)]) + response = client.ingest(entities=[Entity(virtual_circuit=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,8 +52,8 @@ def virtual_circuit_minimal() -> VirtualCircuit: """Create a VirtualCircuit with only required fields using flat strings.""" return VirtualCircuit( cid="CID-001", - provider_network="Example Provider Network", # flat string -> ProviderNetwork - type="Example Type", # flat string -> VirtualCircuitType + provider_network="example-provider-network", # flat string -> ProviderNetwork + type="example-type", # flat string -> VirtualCircuitType metadata={"source": "example"}, ) @@ -60,11 +62,12 @@ def virtual_circuit_extended() -> VirtualCircuit: """Create a VirtualCircuit with common optional fields.""" return VirtualCircuit( cid="CID-001", - provider_network="Example Provider Network", - type="Example Type", - metadata={"source": "example"}, + provider_network="example-provider-network", + type="example-type", status="active", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -74,25 +77,35 @@ def virtual_circuit_explicit() -> VirtualCircuit: cid="CID-001", provider_network=ProviderNetwork( provider=Provider( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), name="Example Name", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), type=VirtualCircuitType( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), - metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_circuit_termination.py b/docs/examples/virtual_circuit_termination.py index e4ac270..7539b16 100644 --- a/docs/examples/virtual_circuit_termination.py +++ b/docs/examples/virtual_circuit_termination.py @@ -7,12 +7,14 @@ - virtual_circuit_termination_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, Interface, Manufacturer, Provider, @@ -24,11 +26,11 @@ VirtualCircuitType, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "virtual_circuit_termination-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -41,13 +43,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - virtual_circuit_termination = virtual_circuit_termination_minimal() - # virtual_circuit_termination = virtual_circuit_termination_extended() - # virtual_circuit_termination = virtual_circuit_termination_explicit() + entity = virtual_circuit_termination_minimal() + # entity = virtual_circuit_termination_extended() + # entity = virtual_circuit_termination_explicit() - response = client.ingest( - entities=[Entity(virtual_circuit_termination=virtual_circuit_termination)] - ) + response = client.ingest(entities=[Entity(virtual_circuit_termination=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -57,8 +57,8 @@ def main(): def virtual_circuit_termination_minimal() -> VirtualCircuitTermination: """Create a VirtualCircuitTermination with only required fields using flat strings.""" return VirtualCircuitTermination( - virtual_circuit="Example Virtual Circuit", # flat string -> VirtualCircuit - interface="Example Interface", # flat string -> Interface + virtual_circuit="example-virtual-circuit", # flat string -> VirtualCircuit + interface="example-interface", # flat string -> Interface metadata={"source": "example"}, ) @@ -66,10 +66,10 @@ def virtual_circuit_termination_minimal() -> VirtualCircuitTermination: def virtual_circuit_termination_extended() -> VirtualCircuitTermination: """Create a VirtualCircuitTermination with common optional fields.""" return VirtualCircuitTermination( - virtual_circuit="Example Virtual Circuit", - interface="Example Interface", - metadata={"source": "example"}, + virtual_circuit="example-virtual-circuit", + interface="example-interface", description="Example description", + metadata={"source": "example"}, ) @@ -82,18 +82,26 @@ def virtual_circuit_termination_explicit() -> VirtualCircuitTermination: provider=Provider( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), type=VirtualCircuitType( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), interface=Interface( @@ -102,34 +110,48 @@ def virtual_circuit_termination_explicit() -> VirtualCircuitTermination: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - type="Example Type", + label="Example label", + type="1000base-bx10-d", + description="Example description", metadata={"source": "example"}, ), - metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_circuit_type.py b/docs/examples/virtual_circuit_type.py index e5495b2..ee50eee 100644 --- a/docs/examples/virtual_circuit_type.py +++ b/docs/examples/virtual_circuit_type.py @@ -7,6 +7,8 @@ - virtual_circuit_type_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ VirtualCircuitType, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "virtual_circuit_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,13 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - virtual_circuit_type = virtual_circuit_type_minimal() - # virtual_circuit_type = virtual_circuit_type_extended() - # virtual_circuit_type = virtual_circuit_type_explicit() + entity = virtual_circuit_type_minimal() + # entity = virtual_circuit_type_extended() + # entity = virtual_circuit_type_explicit() - response = client.ingest( - entities=[Entity(virtual_circuit_type=virtual_circuit_type)] - ) + response = client.ingest(entities=[Entity(virtual_circuit_type=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +58,10 @@ def virtual_circuit_type_extended() -> VirtualCircuitType: return VirtualCircuitType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -69,11 +70,11 @@ def virtual_circuit_type_explicit() -> VirtualCircuitType: return VirtualCircuitType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, color="0000ff", description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_device_context.py b/docs/examples/virtual_device_context.py index 3b82671..2bd75f1 100644 --- a/docs/examples/virtual_device_context.py +++ b/docs/examples/virtual_device_context.py @@ -7,12 +7,14 @@ - virtual_device_context_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, Manufacturer, Site, Tag, @@ -20,11 +22,11 @@ VirtualDeviceContext, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "virtual_device_context-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -37,13 +39,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - virtual_device_context = virtual_device_context_minimal() - # virtual_device_context = virtual_device_context_extended() - # virtual_device_context = virtual_device_context_explicit() + entity = virtual_device_context_minimal() + # entity = virtual_device_context_extended() + # entity = virtual_device_context_explicit() - response = client.ingest( - entities=[Entity(virtual_device_context=virtual_device_context)] - ) + response = client.ingest(entities=[Entity(virtual_device_context=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -54,7 +54,7 @@ def virtual_device_context_minimal() -> VirtualDeviceContext: """Create a VirtualDeviceContext with only required fields using flat strings.""" return VirtualDeviceContext( name="Example Name", - device="Example Device", # flat string -> Device + device="example-device", # flat string -> Device status="active", metadata={"source": "example"}, ) @@ -64,10 +64,11 @@ def virtual_device_context_extended() -> VirtualDeviceContext: """Create a VirtualDeviceContext with common optional fields.""" return VirtualDeviceContext( name="Example Name", - device="Example Device", + device="example-device", status="active", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -80,35 +81,49 @@ def virtual_device_context_explicit() -> VirtualDeviceContext: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", - metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_disk.py b/docs/examples/virtual_disk.py index 525bc61..75a041a 100644 --- a/docs/examples/virtual_disk.py +++ b/docs/examples/virtual_disk.py @@ -7,6 +7,8 @@ - virtual_disk_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ VirtualMachine, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "virtual_disk-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - virtual_disk = virtual_disk_minimal() - # virtual_disk = virtual_disk_extended() - # virtual_disk = virtual_disk_explicit() + entity = virtual_disk_minimal() + # entity = virtual_disk_extended() + # entity = virtual_disk_explicit() - response = client.ingest(entities=[Entity(virtual_disk=virtual_disk)]) + response = client.ingest(entities=[Entity(virtual_disk=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,7 +48,7 @@ def main(): def virtual_disk_minimal() -> VirtualDisk: """Create a VirtualDisk with only required fields using flat strings.""" return VirtualDisk( - virtual_machine="Example Virtual Machine", # flat string -> VirtualMachine + virtual_machine="example-virtual-machine", # flat string -> VirtualMachine name="Example Name", size=1, metadata={"source": "example"}, @@ -56,11 +58,11 @@ def virtual_disk_minimal() -> VirtualDisk: def virtual_disk_extended() -> VirtualDisk: """Create a VirtualDisk with common optional fields.""" return VirtualDisk( - virtual_machine="Example Virtual Machine", + virtual_machine="example-virtual-machine", name="Example Name", size=1, - metadata={"source": "example"}, description="Example description", + metadata={"source": "example"}, ) @@ -68,13 +70,18 @@ def virtual_disk_explicit() -> VirtualDisk: """Create a VirtualDisk with fully nested objects and all common fields.""" return VirtualDisk( virtual_machine=VirtualMachine( - name="Example Name", status="active", metadata={"source": "example"} + name="Example Name", + status="active", + serial="SN-001234", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), name="Example Name", size=1, - metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_machine.py b/docs/examples/virtual_machine.py index e542549..a1f0fa7 100644 --- a/docs/examples/virtual_machine.py +++ b/docs/examples/virtual_machine.py @@ -7,6 +7,8 @@ - virtual_machine_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +18,11 @@ VirtualMachine, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "virtual_machine-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -33,11 +35,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - virtual_machine = virtual_machine_minimal() - # virtual_machine = virtual_machine_extended() - # virtual_machine = virtual_machine_explicit() + entity = virtual_machine_minimal() + # entity = virtual_machine_extended() + # entity = virtual_machine_explicit() - response = client.ingest(entities=[Entity(virtual_machine=virtual_machine)]) + response = client.ingest(entities=[Entity(virtual_machine=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,10 +58,11 @@ def virtual_machine_extended() -> VirtualMachine: """Create a VirtualMachine with common optional fields.""" return VirtualMachine( name="Example Name", - metadata={"source": "example"}, status="active", serial="SN-001234", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -67,18 +70,22 @@ def virtual_machine_explicit() -> VirtualMachine: """Create a VirtualMachine with fully nested objects and all common fields.""" return VirtualMachine( name="Example Name", - metadata={"source": "example"}, status="active", serial="SN-001234", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), platform=Platform( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/vlan.py b/docs/examples/vlan.py index dca0942..b61e2d2 100644 --- a/docs/examples/vlan.py +++ b/docs/examples/vlan.py @@ -7,6 +7,8 @@ - vlan_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ VLAN, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "vlan-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - vlan = vlan_minimal() - # vlan = vlan_extended() - # vlan = vlan_explicit() + entity = vlan_minimal() + # entity = vlan_extended() + # entity = vlan_explicit() - response = client.ingest(entities=[Entity(vlan=vlan)]) + response = client.ingest(entities=[Entity(vlan=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,7 +48,7 @@ def main(): def vlan_minimal() -> VLAN: """Create a VLAN with only required fields using flat strings.""" return VLAN( - vid=1, + vid=100, name="Example Name", metadata={"source": "example"}, ) @@ -55,27 +57,30 @@ def vlan_minimal() -> VLAN: def vlan_extended() -> VLAN: """Create a VLAN with common optional fields.""" return VLAN( - vid=1, + vid=100, name="Example Name", - metadata={"source": "example"}, status="active", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) def vlan_explicit() -> VLAN: """Create a VLAN with fully nested objects and all common fields.""" return VLAN( - vid=1, + vid=100, name="Example Name", - metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/vlan_group.py b/docs/examples/vlan_group.py index 29b681a..c0ed76f 100644 --- a/docs/examples/vlan_group.py +++ b/docs/examples/vlan_group.py @@ -7,6 +7,8 @@ - vlan_group_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ VLANGroup, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "vlan_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - vlan_group = vlan_group_minimal() - # vlan_group = vlan_group_extended() - # vlan_group = vlan_group_explicit() + entity = vlan_group_minimal() + # entity = vlan_group_extended() + # entity = vlan_group_explicit() - response = client.ingest(entities=[Entity(vlan_group=vlan_group)]) + response = client.ingest(entities=[Entity(vlan_group=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -57,8 +59,9 @@ def vlan_group_extended() -> VLANGroup: return VLANGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -67,13 +70,15 @@ def vlan_group_explicit() -> VLANGroup: return VLANGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/vlan_translation_policy.py b/docs/examples/vlan_translation_policy.py index 805c88e..d316244 100644 --- a/docs/examples/vlan_translation_policy.py +++ b/docs/examples/vlan_translation_policy.py @@ -7,13 +7,19 @@ - vlan_translation_policy_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + VLANTranslationPolicy, +) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "vlan_translation_policy-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -26,13 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - vlan_translation_policy = vlan_translation_policy_minimal() - # vlan_translation_policy = vlan_translation_policy_extended() - # vlan_translation_policy = vlan_translation_policy_explicit() + entity = vlan_translation_policy_minimal() + # entity = vlan_translation_policy_extended() + # entity = vlan_translation_policy_explicit() - response = client.ingest( - entities=[Entity(vlan_translation_policy=vlan_translation_policy)] - ) + response = client.ingest(entities=[Entity(vlan_translation_policy=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -51,8 +55,9 @@ def vlan_translation_policy_extended() -> VLANTranslationPolicy: """Create a VLANTranslationPolicy with common optional fields.""" return VLANTranslationPolicy( name="Example Name", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -60,9 +65,9 @@ def vlan_translation_policy_explicit() -> VLANTranslationPolicy: """Create a VLANTranslationPolicy with fully nested objects and all common fields.""" return VLANTranslationPolicy( name="Example Name", - metadata={"source": "example"}, description="Example description", comments="Example comments", + metadata={"source": "example"}, ) diff --git a/docs/examples/vlan_translation_rule.py b/docs/examples/vlan_translation_rule.py index c4a2a8e..ab5446a 100644 --- a/docs/examples/vlan_translation_rule.py +++ b/docs/examples/vlan_translation_rule.py @@ -7,6 +7,8 @@ - vlan_translation_rule_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ VLANTranslationRule, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "vlan_translation_rule-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,13 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - vlan_translation_rule = vlan_translation_rule_minimal() - # vlan_translation_rule = vlan_translation_rule_extended() - # vlan_translation_rule = vlan_translation_rule_explicit() + entity = vlan_translation_rule_minimal() + # entity = vlan_translation_rule_extended() + # entity = vlan_translation_rule_explicit() - response = client.ingest( - entities=[Entity(vlan_translation_rule=vlan_translation_rule)] - ) + response = client.ingest(entities=[Entity(vlan_translation_rule=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -47,7 +47,7 @@ def main(): def vlan_translation_rule_minimal() -> VLANTranslationRule: """Create a VLANTranslationRule with only required fields using flat strings.""" return VLANTranslationRule( - policy="Example Policy", # flat string -> VLANTranslationPolicy + policy="example-policy", # flat string -> VLANTranslationPolicy local_vid=1, remote_vid=1, metadata={"source": "example"}, @@ -57,11 +57,11 @@ def vlan_translation_rule_minimal() -> VLANTranslationRule: def vlan_translation_rule_extended() -> VLANTranslationRule: """Create a VLANTranslationRule with common optional fields.""" return VLANTranslationRule( - policy="Example Policy", + policy="example-policy", local_vid=1, remote_vid=1, - metadata={"source": "example"}, description="Example description", + metadata={"source": "example"}, ) @@ -69,12 +69,15 @@ def vlan_translation_rule_explicit() -> VLANTranslationRule: """Create a VLANTranslationRule with fully nested objects and all common fields.""" return VLANTranslationRule( policy=VLANTranslationPolicy( - name="Example Name", metadata={"source": "example"} + name="Example Name", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), local_vid=1, remote_vid=1, - metadata={"source": "example"}, description="Example description", + metadata={"source": "example"}, ) diff --git a/docs/examples/vm_interface.py b/docs/examples/vm_interface.py index ab4952a..26fb6e3 100644 --- a/docs/examples/vm_interface.py +++ b/docs/examples/vm_interface.py @@ -7,6 +7,8 @@ - vm_interface_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ VirtualMachine, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "vm_interface-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - vm_interface = vm_interface_minimal() - # vm_interface = vm_interface_extended() - # vm_interface = vm_interface_explicit() + entity = vm_interface_minimal() + # entity = vm_interface_extended() + # entity = vm_interface_explicit() - response = client.ingest(entities=[Entity(vm_interface=vm_interface)]) + response = client.ingest(entities=[Entity(vm_interface=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,7 +48,7 @@ def main(): def vm_interface_minimal() -> VMInterface: """Create a VMInterface with only required fields using flat strings.""" return VMInterface( - virtual_machine="Example Virtual Machine", # flat string -> VirtualMachine + virtual_machine="example-virtual-machine", # flat string -> VirtualMachine name="Example Name", metadata={"source": "example"}, ) @@ -55,10 +57,10 @@ def vm_interface_minimal() -> VMInterface: def vm_interface_extended() -> VMInterface: """Create a VMInterface with common optional fields.""" return VMInterface( - virtual_machine="Example Virtual Machine", + virtual_machine="example-virtual-machine", name="Example Name", - metadata={"source": "example"}, description="Example description", + metadata={"source": "example"}, ) @@ -66,12 +68,17 @@ def vm_interface_explicit() -> VMInterface: """Create a VMInterface with fully nested objects and all common fields.""" return VMInterface( virtual_machine=VirtualMachine( - name="Example Name", status="active", metadata={"source": "example"} + name="Example Name", + status="active", + serial="SN-001234", + description="Example description", + comments="Example comments", + metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/vrf.py b/docs/examples/vrf.py index 08ed95b..4560c22 100644 --- a/docs/examples/vrf.py +++ b/docs/examples/vrf.py @@ -7,6 +7,8 @@ - vrf_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ VRF, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "vrf-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - vrf = vrf_minimal() - # vrf = vrf_extended() - # vrf = vrf_explicit() + entity = vrf_minimal() + # entity = vrf_extended() + # entity = vrf_explicit() - response = client.ingest(entities=[Entity(vrf=vrf)]) + response = client.ingest(entities=[Entity(vrf=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -55,8 +57,9 @@ def vrf_extended() -> VRF: """Create a VRF with common optional fields.""" return VRF( name="Example Name", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -64,13 +67,15 @@ def vrf_explicit() -> VRF: """Create a VRF with fully nested objects and all common fields.""" return VRF( name="Example Name", - metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/wireless_lan.py b/docs/examples/wireless_lan.py index be7bfba..29bb8ca 100644 --- a/docs/examples/wireless_lan.py +++ b/docs/examples/wireless_lan.py @@ -7,6 +7,8 @@ - wireless_lan_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -15,11 +17,11 @@ WirelessLAN, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "wireless_lan-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -32,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - wireless_lan = wireless_lan_minimal() - # wireless_lan = wireless_lan_extended() - # wireless_lan = wireless_lan_explicit() + entity = wireless_lan_minimal() + # entity = wireless_lan_extended() + # entity = wireless_lan_explicit() - response = client.ingest(entities=[Entity(wireless_lan=wireless_lan)]) + response = client.ingest(entities=[Entity(wireless_lan=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,7 +48,7 @@ def main(): def wireless_lan_minimal() -> WirelessLAN: """Create a WirelessLAN with only required fields using flat strings.""" return WirelessLAN( - ssid="ExampleSSID", + ssid="Example-SSID", metadata={"source": "example"}, ) @@ -54,25 +56,28 @@ def wireless_lan_minimal() -> WirelessLAN: def wireless_lan_extended() -> WirelessLAN: """Create a WirelessLAN with common optional fields.""" return WirelessLAN( - ssid="ExampleSSID", - metadata={"source": "example"}, + ssid="Example-SSID", description="Example description", status="active", + comments="Example comments", + metadata={"source": "example"}, ) def wireless_lan_explicit() -> WirelessLAN: """Create a WirelessLAN with fully nested objects and all common fields.""" return WirelessLAN( - ssid="ExampleSSID", - metadata={"source": "example"}, + ssid="Example-SSID", description="Example description", status="active", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/wireless_lan_group.py b/docs/examples/wireless_lan_group.py index f92b290..6603e24 100644 --- a/docs/examples/wireless_lan_group.py +++ b/docs/examples/wireless_lan_group.py @@ -7,6 +7,8 @@ - wireless_lan_group_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -14,11 +16,11 @@ WirelessLANGroup, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "wireless_lan_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -31,13 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - wireless_lan_group = wireless_lan_group_minimal() - # wireless_lan_group = wireless_lan_group_extended() - # wireless_lan_group = wireless_lan_group_explicit() + entity = wireless_lan_group_minimal() + # entity = wireless_lan_group_extended() + # entity = wireless_lan_group_explicit() - response = client.ingest( - entities=[Entity(wireless_lan_group=wireless_lan_group)] - ) + response = client.ingest(entities=[Entity(wireless_lan_group=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,8 +58,9 @@ def wireless_lan_group_extended() -> WirelessLANGroup: return WirelessLANGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -68,10 +69,10 @@ def wireless_lan_group_explicit() -> WirelessLANGroup: return WirelessLANGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/docs/examples/wireless_link.py b/docs/examples/wireless_link.py index e9ff4d3..ee2a82d 100644 --- a/docs/examples/wireless_link.py +++ b/docs/examples/wireless_link.py @@ -7,12 +7,14 @@ - wireless_link_explicit: Fully nested objects with all fields """ +import os + from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Entity, Device, DeviceRole, DeviceType, - Entity, Interface, Manufacturer, Site, @@ -21,11 +23,11 @@ WirelessLink, ) -TARGET = "grpc://localhost:8080/diode" +TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") APP_NAME = "wireless_link-example" APP_VERSION = "1.0.0" -CLIENT_ID = "diode" -CLIENT_SECRET = "changeme" +CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") +CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") def main(): @@ -38,11 +40,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - wireless_link = wireless_link_minimal() - # wireless_link = wireless_link_extended() - # wireless_link = wireless_link_explicit() + entity = wireless_link_minimal() + # entity = wireless_link_extended() + # entity = wireless_link_explicit() - response = client.ingest(entities=[Entity(wireless_link=wireless_link)]) + response = client.ingest(entities=[Entity(wireless_link=entity)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -52,8 +54,8 @@ def main(): def wireless_link_minimal() -> WirelessLink: """Create a WirelessLink with only required fields using flat strings.""" return WirelessLink( - interface_a="Example Interface A", # flat string -> Interface - interface_b="Example Interface B", # flat string -> Interface + interface_a="example-interface-a", # flat string -> Interface + interface_b="example-interface-b", # flat string -> Interface metadata={"source": "example"}, ) @@ -61,11 +63,12 @@ def wireless_link_minimal() -> WirelessLink: def wireless_link_extended() -> WirelessLink: """Create a WirelessLink with common optional fields.""" return WirelessLink( - interface_a="Example Interface A", - interface_b="Example Interface B", - metadata={"source": "example"}, + interface_a="example-interface-a", + interface_b="example-interface-b", status="connected", description="Example description", + comments="Example comments", + metadata={"source": "example"}, ) @@ -78,29 +81,43 @@ def wireless_link_explicit() -> WirelessLink: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - type="Example Type", + label="Example label", + type="1000base-bx10-d", + description="Example description", metadata={"source": "example"}, ), interface_b=Interface( @@ -109,39 +126,55 @@ def wireless_link_explicit() -> WirelessLink: manufacturer=Manufacturer( name="Example Name", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), + serial="SN-001234", + asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), status="active", + description="Example description", + comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - type="Example Type", + label="Example label", + type="1000base-bx10-d", + description="Example description", metadata={"source": "example"}, ), - metadata={"source": "example"}, status="connected", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", slug="example-slug", metadata={"source": "example"} + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, ), tags=[Tag(name="production")], + metadata={"source": "example"}, ) diff --git a/netboxlabs/diode/sdk/ingester.py b/netboxlabs/diode/sdk/ingester.py index 638c240..b9eee0f 100644 --- a/netboxlabs/diode/sdk/ingester.py +++ b/netboxlabs/diode/sdk/ingester.py @@ -2,8 +2,7 @@ # # Generated code. DO NOT EDIT. -# Source: NetBox v4.5.0 -# Timestamp: 2026-02-10 03:24:51Z +# Timestamp: 2026-02-11 02:15:58Z # # ruff: noqa: C901 @@ -32,9 +31,6 @@ "Contact": "name", "ContactGroup": "name", "ContactRole": "name", - "CustomField": "name", - "CustomFieldChoiceSet": "name", - "CustomLink": "name", "Device": "name", "DeviceBay": "name", "DeviceRole": "name", @@ -56,9 +52,6 @@ "Manufacturer": "name", "ModuleBay": "name", "ModuleType": "model", - "ModuleTypeProfile": "name", - "Owner": "name", - "OwnerGroup": "name", "Platform": "name", "PowerFeed": "name", "PowerOutlet": "name", @@ -97,6 +90,12 @@ "VirtualMachine": "name", "WirelessLAN": "ssid", "WirelessLANGroup": "name", + "CustomField": "name", + "CustomFieldChoiceSet": "name", + "ModuleTypeProfile": "name", + "CustomLink": "name", + "Owner": "name", + "OwnerGroup": "name", } @@ -163,17 +162,16 @@ def __new__( timestamp: datetime.datetime | None = None, asn: str | ASN | pb.ASN | None = None, asn_range: str | ASNRange | pb.ASNRange | None = None, - aggregate: str | Aggregate | pb.Aggregate | None = None, - cable: str | Cable | pb.Cable | None = None, - cable_path: str | CablePath | pb.CablePath | None = None, + aggregate: Aggregate | pb.Aggregate | None = None, + cable: Cable | pb.Cable | None = None, + cable_path: CablePath | pb.CablePath | None = None, + cable_termination: CableTermination | pb.CableTermination | None = None, circuit: str | Circuit | pb.Circuit | None = None, circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None - ) = None, - circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, + circuit_termination: CircuitTermination | pb.CircuitTermination | None = None, circuit_type: str | CircuitType | pb.CircuitType | None = None, cluster: str | Cluster | pb.Cluster | None = None, cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, @@ -183,29 +181,22 @@ def __new__( str | ConsoleServerPort | pb.ConsoleServerPort | None ) = None, contact: str | Contact | pb.Contact | None = None, - contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None - ) = None, + contact_assignment: ContactAssignment | pb.ContactAssignment | None = None, contact_group: str | ContactGroup | pb.ContactGroup | None = None, contact_role: str | ContactRole | pb.ContactRole | None = None, - custom_field: str | CustomField | pb.CustomField | None = None, - custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - custom_link: str | CustomLink | pb.CustomLink | None = None, device: str | Device | pb.Device | None = None, device_bay: str | DeviceBay | pb.DeviceBay | None = None, device_role: str | DeviceRole | pb.DeviceRole | None = None, device_type: str | DeviceType | pb.DeviceType | None = None, fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, front_port: str | FrontPort | pb.FrontPort | None = None, ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, ip_address: str | IPAddress | pb.IPAddress | None = None, - ip_range: str | IPRange | pb.IPRange | None = None, + ip_range: IPRange | pb.IPRange | None = None, ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -214,20 +205,14 @@ def __new__( inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - journal_entry: str | JournalEntry | pb.JournalEntry | None = None, l2vpn: str | L2VPN | pb.L2VPN | None = None, - l2vpn_termination: str | L2VPNTermination | pb.L2VPNTermination | None = None, + l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, location: str | Location | pb.Location | None = None, mac_address: str | MACAddress | pb.MACAddress | None = None, manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, module_bay: str | ModuleBay | pb.ModuleBay | None = None, module_type: str | ModuleType | pb.ModuleType | None = None, - module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - owner: str | Owner | pb.Owner | None = None, - owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, platform: str | Platform | pb.Platform | None = None, power_feed: str | PowerFeed | pb.PowerFeed | None = None, power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -239,7 +224,7 @@ def __new__( provider_network: str | ProviderNetwork | pb.ProviderNetwork | None = None, rir: str | RIR | pb.RIR | None = None, rack: str | Rack | pb.Rack | None = None, - rack_reservation: str | RackReservation | pb.RackReservation | None = None, + rack_reservation: RackReservation | pb.RackReservation | None = None, rack_role: str | RackRole | pb.RackRole | None = None, rack_type: str | RackType | pb.RackType | None = None, rear_port: str | RearPort | pb.RearPort | None = None, @@ -254,23 +239,21 @@ def __new__( tenant_group: str | TenantGroup | pb.TenantGroup | None = None, tunnel: str | Tunnel | pb.Tunnel | None = None, tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None - ) = None, + tunnel_termination: TunnelTermination | pb.TunnelTermination | None = None, vlan: str | VLAN | pb.VLAN | None = None, vlan_group: str | VLANGroup | pb.VLANGroup | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, vm_interface: str | VMInterface | pb.VMInterface | None = None, vrf: str | VRF | pb.VRF | None = None, virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -282,7 +265,19 @@ def __new__( virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, wireless_lan_group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, - wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + wireless_link: WirelessLink | pb.WirelessLink | None = None, + custom_field: str | CustomField | pb.CustomField | None = None, + custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + journal_entry: JournalEntry | pb.JournalEntry | None = None, + module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + custom_link: str | CustomLink | pb.CustomLink | None = None, + owner: str | Owner | pb.Owner | None = None, + owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + device_config: DeviceConfig | pb.DeviceConfig | None = None, ) -> pb.Entity: """Create a new Entity.""" asn = convert_to_protobuf(asn, pb.ASN) @@ -290,6 +285,7 @@ def __new__( aggregate = convert_to_protobuf(aggregate, pb.Aggregate) cable = convert_to_protobuf(cable, pb.Cable) cable_path = convert_to_protobuf(cable_path, pb.CablePath) + cable_termination = convert_to_protobuf(cable_termination, pb.CableTermination) circuit = convert_to_protobuf(circuit, pb.Circuit) circuit_group = convert_to_protobuf(circuit_group, pb.CircuitGroup) circuit_group_assignment = convert_to_protobuf( @@ -312,11 +308,6 @@ def __new__( ) contact_group = convert_to_protobuf(contact_group, pb.ContactGroup) contact_role = convert_to_protobuf(contact_role, pb.ContactRole) - custom_field = convert_to_protobuf(custom_field, pb.CustomField) - custom_field_choice_set = convert_to_protobuf( - custom_field_choice_set, pb.CustomFieldChoiceSet - ) - custom_link = convert_to_protobuf(custom_link, pb.CustomLink) device = convert_to_protobuf(device, pb.Device) device_bay = convert_to_protobuf(device_bay, pb.DeviceBay) device_role = convert_to_protobuf(device_role, pb.DeviceRole) @@ -338,7 +329,6 @@ def __new__( inventory_item_role = convert_to_protobuf( inventory_item_role, pb.InventoryItemRole ) - journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) l2vpn_termination = convert_to_protobuf(l2vpn_termination, pb.L2VPNTermination) location = convert_to_protobuf(location, pb.Location) @@ -347,11 +337,6 @@ def __new__( module = convert_to_protobuf(module, pb.Module) module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) module_type = convert_to_protobuf(module_type, pb.ModuleType) - module_type_profile = convert_to_protobuf( - module_type_profile, pb.ModuleTypeProfile - ) - owner = convert_to_protobuf(owner, pb.Owner) - owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) platform = convert_to_protobuf(platform, pb.Platform) power_feed = convert_to_protobuf(power_feed, pb.PowerFeed) power_outlet = convert_to_protobuf(power_outlet, pb.PowerOutlet) @@ -409,6 +394,18 @@ def __new__( wireless_lan_group, pb.WirelessLANGroup ) wireless_link = convert_to_protobuf(wireless_link, pb.WirelessLink) + custom_field = convert_to_protobuf(custom_field, pb.CustomField) + custom_field_choice_set = convert_to_protobuf( + custom_field_choice_set, pb.CustomFieldChoiceSet + ) + journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) + module_type_profile = convert_to_protobuf( + module_type_profile, pb.ModuleTypeProfile + ) + custom_link = convert_to_protobuf(custom_link, pb.CustomLink) + owner = convert_to_protobuf(owner, pb.Owner) + owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) + device_config = convert_to_protobuf(device_config, pb.DeviceConfig) if timestamp is None: ts = _timestamp_pb2.Timestamp() ts.GetCurrentTime() @@ -420,6 +417,7 @@ def __new__( aggregate=aggregate, cable=cable, cable_path=cable_path, + cable_termination=cable_termination, circuit=circuit, circuit_group=circuit_group, circuit_group_assignment=circuit_group_assignment, @@ -434,9 +432,6 @@ def __new__( contact_assignment=contact_assignment, contact_group=contact_group, contact_role=contact_role, - custom_field=custom_field, - custom_field_choice_set=custom_field_choice_set, - custom_link=custom_link, device=device, device_bay=device_bay, device_role=device_role, @@ -454,7 +449,6 @@ def __new__( interface=interface, inventory_item=inventory_item, inventory_item_role=inventory_item_role, - journal_entry=journal_entry, l2vpn=l2vpn, l2vpn_termination=l2vpn_termination, location=location, @@ -463,9 +457,6 @@ def __new__( module=module, module_bay=module_bay, module_type=module_type, - module_type_profile=module_type_profile, - owner=owner, - owner_group=owner_group, platform=platform, power_feed=power_feed, power_outlet=power_outlet, @@ -509,6 +500,14 @@ def __new__( wireless_lan=wireless_lan, wireless_lan_group=wireless_lan_group, wireless_link=wireless_link, + custom_field=custom_field, + custom_field_choice_set=custom_field_choice_set, + journal_entry=journal_entry, + module_type_profile=module_type_profile, + custom_link=custom_link, + owner=owner, + owner_group=owner_group, + device_config=device_config, ) return result @@ -522,34 +521,32 @@ def __new__( rir: str | RIR | pb.RIR | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - sites: list[str | Site | pb.Site] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + sites: list[str | Site | pb.Site] | None = None, ) -> pb.ASN: """Create a new ASN.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) - sites = convert_to_protobuf_list(sites, pb.Site) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + sites = convert_to_protobuf_list(sites, pb.Site) result = pb.ASN( asn=asn, rir=rir, tenant=tenant, description=description, - owner=owner, comments=comments, tags=tags, - sites=sites, custom_fields=custom_fields, metadata=metadata, + owner=owner, + sites=sites, ) return result @@ -566,21 +563,19 @@ def __new__( end: int | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.ASNRange: """Create a new ASNRange.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ASNRange( name=name, slug=slug, @@ -589,11 +584,11 @@ def __new__( end=end, tenant=tenant, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -608,32 +603,30 @@ def __new__( tenant: str | Tenant | pb.Tenant | None = None, date_added: datetime.datetime | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Aggregate: """Create a new Aggregate.""" rir = convert_to_protobuf(rir, pb.RIR) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Aggregate( prefix=prefix, rir=rir, tenant=tenant, date_added=date_added, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -644,49 +637,47 @@ class Cable: def __new__( cls, type: str | None = None, - a_terminations: list[str | GenericObject | pb.GenericObject] | None = None, - b_terminations: list[str | GenericObject | pb.GenericObject] | None = None, + a_terminations: list[GenericObject | pb.GenericObject] | None = None, + b_terminations: list[GenericObject | pb.GenericObject] | None = None, status: str | None = None, - profile: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, label: str | None = None, color: str | None = None, length: float | None = None, length_unit: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + profile: str | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Cable: """Create a new Cable.""" a_terminations = convert_to_protobuf_list(a_terminations, pb.GenericObject) b_terminations = convert_to_protobuf_list(b_terminations, pb.GenericObject) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Cable( type=type, a_terminations=a_terminations, b_terminations=b_terminations, status=status, - profile=profile, tenant=tenant, label=label, color=color, length=length, length_unit=length_unit, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + profile=profile, + owner=owner, ) return result @@ -712,6 +703,71 @@ def __new__( return result +class CableTermination: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CableTermination.""" + + def __new__( + cls, + cable: Cable | pb.Cable | None = None, + cable_end: str | None = None, + termination_circuit_termination: ( + CircuitTermination | pb.CircuitTermination | None + ) = None, + termination_console_port: str | ConsolePort | pb.ConsolePort | None = None, + termination_console_server_port: ( + str | ConsoleServerPort | pb.ConsoleServerPort | None + ) = None, + termination_front_port: str | FrontPort | pb.FrontPort | None = None, + termination_interface: str | Interface | pb.Interface | None = None, + termination_power_feed: str | PowerFeed | pb.PowerFeed | None = None, + termination_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, + termination_power_port: str | PowerPort | pb.PowerPort | None = None, + termination_rear_port: str | RearPort | pb.RearPort | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.CableTermination: + """Create a new CableTermination.""" + cable = convert_to_protobuf(cable, pb.Cable) + termination_circuit_termination = convert_to_protobuf( + termination_circuit_termination, pb.CircuitTermination + ) + termination_console_port = convert_to_protobuf( + termination_console_port, pb.ConsolePort + ) + termination_console_server_port = convert_to_protobuf( + termination_console_server_port, pb.ConsoleServerPort + ) + termination_front_port = convert_to_protobuf( + termination_front_port, pb.FrontPort + ) + termination_interface = convert_to_protobuf(termination_interface, pb.Interface) + termination_power_feed = convert_to_protobuf( + termination_power_feed, pb.PowerFeed + ) + termination_power_outlet = convert_to_protobuf( + termination_power_outlet, pb.PowerOutlet + ) + termination_power_port = convert_to_protobuf( + termination_power_port, pb.PowerPort + ) + termination_rear_port = convert_to_protobuf(termination_rear_port, pb.RearPort) + metadata = convert_dict_to_struct(metadata) + result = pb.CableTermination( + cable=cable, + cable_end=cable_end, + termination_circuit_termination=termination_circuit_termination, + termination_console_port=termination_console_port, + termination_console_server_port=termination_console_server_port, + termination_front_port=termination_front_port, + termination_interface=termination_interface, + termination_power_feed=termination_power_feed, + termination_power_outlet=termination_power_outlet, + termination_power_port=termination_power_port, + termination_rear_port=termination_rear_port, + metadata=metadata, + ) + return result + + class Circuit: """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Circuit.""" @@ -729,27 +785,25 @@ def __new__( description: str | None = None, distance: float | None = None, distance_unit: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, assignments: ( - list[str | CircuitGroupAssignment | pb.CircuitGroupAssignment] | None - ) = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + list[CircuitGroupAssignment | pb.CircuitGroupAssignment] | None ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Circuit: """Create a new Circuit.""" provider = convert_to_protobuf(provider, pb.Provider) provider_account = convert_to_protobuf(provider_account, pb.ProviderAccount) type = convert_to_protobuf(type, pb.CircuitType) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) assignments = convert_to_protobuf_list(assignments, pb.CircuitGroupAssignment) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Circuit( cid=cid, provider=provider, @@ -763,12 +817,12 @@ def __new__( description=description, distance=distance, distance_unit=distance_unit, - owner=owner, comments=comments, tags=tags, assignments=assignments, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -782,30 +836,28 @@ def __new__( slug: str | None = None, description: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.CircuitGroup: """Create a new CircuitGroup.""" tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.CircuitGroup( name=name, slug=slug, description=description, tenant=tenant, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -862,9 +914,7 @@ def __new__( description: str | None = None, mark_connected: bool | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, ) -> pb.CircuitTermination: """Create a new CircuitTermination.""" @@ -911,29 +961,27 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.CircuitType: """Create a new CircuitType.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.CircuitType( name=name, slug=slug, color=color, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -953,13 +1001,11 @@ def __new__( scope_site: str | Site | pb.Site | None = None, scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Cluster: """Create a new Cluster.""" type = convert_to_protobuf(type, pb.ClusterType) @@ -969,10 +1015,10 @@ def __new__( scope_region = convert_to_protobuf(scope_region, pb.Region) scope_site = convert_to_protobuf(scope_site, pb.Site) scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Cluster( name=name, type=type, @@ -984,11 +1030,11 @@ def __new__( scope_site=scope_site, scope_site_group=scope_site_group, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -1001,28 +1047,26 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.ClusterGroup: """Create a new ClusterGroup.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ClusterGroup( name=name, slug=slug, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -1035,28 +1079,26 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.ClusterType: """Create a new ClusterType.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ClusterType( name=name, slug=slug, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -1067,27 +1109,25 @@ class ConsolePort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, speed: int | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ConsolePort: """Create a new ConsolePort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ConsolePort( device=device, module=module, @@ -1097,10 +1137,10 @@ def __new__( speed=speed, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -1111,27 +1151,25 @@ class ConsoleServerPort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, speed: int | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ConsoleServerPort: """Create a new ConsoleServerPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ConsoleServerPort( device=device, module=module, @@ -1141,10 +1179,10 @@ def __new__( speed=speed, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -1154,7 +1192,7 @@ class Contact: def __new__( cls, - groups: list[str | ContactGroup | pb.ContactGroup] | None = None, + group: str | ContactGroup | pb.ContactGroup | None = None, name: str | None = None, title: str | None = None, phone: str | None = None, @@ -1162,22 +1200,22 @@ def __new__( address: str | None = None, link: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + groups: list[str | ContactGroup | pb.ContactGroup] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Contact: """Create a new Contact.""" - groups = convert_to_protobuf_list(groups, pb.ContactGroup) - owner = convert_to_protobuf(owner, pb.Owner) + group = convert_to_protobuf(group, pb.ContactGroup) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + groups = convert_to_protobuf_list(groups, pb.ContactGroup) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Contact( - groups=groups, + group=group, name=name, title=title, phone=phone, @@ -1185,11 +1223,12 @@ def __new__( address=address, link=link, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + groups=groups, metadata=metadata, + owner=owner, ) return result @@ -1201,19 +1240,17 @@ def __new__( cls, object_asn: str | ASN | pb.ASN | None = None, object_asn_range: str | ASNRange | pb.ASNRange | None = None, - object_aggregate: str | Aggregate | pb.Aggregate | None = None, - object_cable: str | Cable | pb.Cable | None = None, - object_cable_path: str | CablePath | pb.CablePath | None = None, - object_cable_termination: ( - str | CableTermination | pb.CableTermination | None - ) = None, + object_aggregate: Aggregate | pb.Aggregate | None = None, + object_cable: Cable | pb.Cable | None = None, + object_cable_path: CablePath | pb.CablePath | None = None, + object_cable_termination: CableTermination | pb.CableTermination | None = None, object_circuit: str | Circuit | pb.Circuit | None = None, object_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, object_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, object_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitTermination | pb.CircuitTermination | None ) = None, object_circuit_type: str | CircuitType | pb.CircuitType | None = None, object_cluster: str | Cluster | pb.Cluster | None = None, @@ -1225,28 +1262,23 @@ def __new__( ) = None, object_contact: str | Contact | pb.Contact | None = None, object_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None + ContactAssignment | pb.ContactAssignment | None ) = None, object_contact_group: str | ContactGroup | pb.ContactGroup | None = None, object_contact_role: str | ContactRole | pb.ContactRole | None = None, - object_custom_field: str | CustomField | pb.CustomField | None = None, - object_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - object_custom_link: str | CustomLink | pb.CustomLink | None = None, object_device: str | Device | pb.Device | None = None, object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, object_device_role: str | DeviceRole | pb.DeviceRole | None = None, object_device_type: str | DeviceType | pb.DeviceType | None = None, object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, object_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, object_front_port: str | FrontPort | pb.FrontPort | None = None, object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, object_ip_address: str | IPAddress | pb.IPAddress | None = None, - object_ip_range: str | IPRange | pb.IPRange | None = None, + object_ip_range: IPRange | pb.IPRange | None = None, object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, object_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, object_ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -1255,22 +1287,14 @@ def __new__( object_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - object_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, object_l2vpn: str | L2VPN | pb.L2VPN | None = None, - object_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None - ) = None, + object_l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, object_location: str | Location | pb.Location | None = None, object_mac_address: str | MACAddress | pb.MACAddress | None = None, object_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - object_module: str | Module | pb.Module | None = None, + object_module: Module | pb.Module | None = None, object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, object_module_type: str | ModuleType | pb.ModuleType | None = None, - object_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - object_owner: str | Owner | pb.Owner | None = None, - object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, object_platform: str | Platform | pb.Platform | None = None, object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -1286,9 +1310,7 @@ def __new__( ) = None, object_rir: str | RIR | pb.RIR | None = None, object_rack: str | Rack | pb.Rack | None = None, - object_rack_reservation: ( - str | RackReservation | pb.RackReservation | None - ) = None, + object_rack_reservation: RackReservation | pb.RackReservation | None = None, object_rack_role: str | RackRole | pb.RackRole | None = None, object_rack_type: str | RackType | pb.RackType | None = None, object_rear_port: str | RearPort | pb.RearPort | None = None, @@ -1304,7 +1326,7 @@ def __new__( object_tunnel: str | Tunnel | pb.Tunnel | None = None, object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, object_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None + TunnelTermination | pb.TunnelTermination | None ) = None, object_vlan: str | VLAN | pb.VLAN | None = None, object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, @@ -1312,14 +1334,14 @@ def __new__( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, object_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, object_vm_interface: str | VMInterface | pb.VMInterface | None = None, object_vrf: str | VRF | pb.VRF | None = None, object_virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, object_virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, object_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, object_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -1333,14 +1355,23 @@ def __new__( object_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - object_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + object_wireless_link: WirelessLink | pb.WirelessLink | None = None, + object_custom_field: str | CustomField | pb.CustomField | None = None, + object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + object_journal_entry: JournalEntry | pb.JournalEntry | None = None, + object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + object_custom_link: str | CustomLink | pb.CustomLink | None = None, + object_owner: str | Owner | pb.Owner | None = None, + object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, contact: str | Contact | pb.Contact | None = None, role: str | ContactRole | pb.ContactRole | None = None, priority: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, ) -> pb.ContactAssignment: """Create a new ContactAssignment.""" @@ -1349,6 +1380,9 @@ def __new__( object_aggregate = convert_to_protobuf(object_aggregate, pb.Aggregate) object_cable = convert_to_protobuf(object_cable, pb.Cable) object_cable_path = convert_to_protobuf(object_cable_path, pb.CablePath) + object_cable_termination = convert_to_protobuf( + object_cable_termination, pb.CableTermination + ) object_circuit = convert_to_protobuf(object_circuit, pb.Circuit) object_circuit_group = convert_to_protobuf( object_circuit_group, pb.CircuitGroup @@ -1377,11 +1411,6 @@ def __new__( object_contact_group, pb.ContactGroup ) object_contact_role = convert_to_protobuf(object_contact_role, pb.ContactRole) - object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) - object_custom_field_choice_set = convert_to_protobuf( - object_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) object_device = convert_to_protobuf(object_device, pb.Device) object_device_bay = convert_to_protobuf(object_device_bay, pb.DeviceBay) object_device_role = convert_to_protobuf(object_device_role, pb.DeviceRole) @@ -1409,9 +1438,6 @@ def __new__( object_inventory_item_role = convert_to_protobuf( object_inventory_item_role, pb.InventoryItemRole ) - object_journal_entry = convert_to_protobuf( - object_journal_entry, pb.JournalEntry - ) object_l2vpn = convert_to_protobuf(object_l2vpn, pb.L2VPN) object_l2vpn_termination = convert_to_protobuf( object_l2vpn_termination, pb.L2VPNTermination @@ -1422,11 +1448,6 @@ def __new__( object_module = convert_to_protobuf(object_module, pb.Module) object_module_bay = convert_to_protobuf(object_module_bay, pb.ModuleBay) object_module_type = convert_to_protobuf(object_module_type, pb.ModuleType) - object_module_type_profile = convert_to_protobuf( - object_module_type_profile, pb.ModuleTypeProfile - ) - object_owner = convert_to_protobuf(object_owner, pb.Owner) - object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) object_platform = convert_to_protobuf(object_platform, pb.Platform) object_power_feed = convert_to_protobuf(object_power_feed, pb.PowerFeed) object_power_outlet = convert_to_protobuf(object_power_outlet, pb.PowerOutlet) @@ -1498,6 +1519,19 @@ def __new__( object_wireless_link = convert_to_protobuf( object_wireless_link, pb.WirelessLink ) + object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) + object_custom_field_choice_set = convert_to_protobuf( + object_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + object_journal_entry = convert_to_protobuf( + object_journal_entry, pb.JournalEntry + ) + object_module_type_profile = convert_to_protobuf( + object_module_type_profile, pb.ModuleTypeProfile + ) + object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) + object_owner = convert_to_protobuf(object_owner, pb.Owner) + object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) contact = convert_to_protobuf(contact, pb.Contact) role = convert_to_protobuf(role, pb.ContactRole) tags = convert_to_protobuf_list(tags, pb.Tag) @@ -1524,9 +1558,6 @@ def __new__( object_contact_assignment=object_contact_assignment, object_contact_group=object_contact_group, object_contact_role=object_contact_role, - object_custom_field=object_custom_field, - object_custom_field_choice_set=object_custom_field_choice_set, - object_custom_link=object_custom_link, object_device=object_device, object_device_bay=object_device_bay, object_device_role=object_device_role, @@ -1544,7 +1575,6 @@ def __new__( object_interface=object_interface, object_inventory_item=object_inventory_item, object_inventory_item_role=object_inventory_item_role, - object_journal_entry=object_journal_entry, object_l2vpn=object_l2vpn, object_l2vpn_termination=object_l2vpn_termination, object_location=object_location, @@ -1553,9 +1583,6 @@ def __new__( object_module=object_module, object_module_bay=object_module_bay, object_module_type=object_module_type, - object_module_type_profile=object_module_type_profile, - object_owner=object_owner, - object_owner_group=object_owner_group, object_platform=object_platform, object_power_feed=object_power_feed, object_power_outlet=object_power_outlet, @@ -1599,6 +1626,13 @@ def __new__( object_wireless_lan=object_wireless_lan, object_wireless_lan_group=object_wireless_lan_group, object_wireless_link=object_wireless_link, + object_custom_field=object_custom_field, + object_custom_field_choice_set=object_custom_field_choice_set, + object_journal_entry=object_journal_entry, + object_module_type_profile=object_module_type_profile, + object_custom_link=object_custom_link, + object_owner=object_owner, + object_owner_group=object_owner_group, contact=contact, role=role, priority=priority, @@ -1619,29 +1653,27 @@ def __new__( parent: str | ContactGroup | pb.ContactGroup | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ContactGroup: """Create a new ContactGroup.""" parent = convert_to_protobuf(parent, pb.ContactGroup) tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ContactGroup( name=name, slug=slug, parent=parent, description=description, tags=tags, - owner=owner, - comments=comments, custom_fields=custom_fields, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -1654,119 +1686,26 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.ContactRole: """Create a new ContactRole.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ContactRole( name=name, slug=slug, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, - ) - return result - - -class CustomField: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomField.""" - - def __new__( - cls, - object_types: list[str] | None = None, - type: str | None = None, - related_object_type: str | None = None, - name: str | None = None, - label: str | None = None, - group_name: str | None = None, - description: str | None = None, - required: bool | None = None, - unique: bool | None = None, - search_weight: int | None = None, - filter_logic: str | None = None, - ui_visible: str | None = None, - ui_editable: str | None = None, - is_cloneable: bool | None = None, - default: str | None = None, - related_object_filter: str | None = None, - weight: int | None = None, - validation_minimum: float | None = None, - validation_maximum: float | None = None, - validation_regex: str | None = None, - choice_set: str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.CustomField: - """Create a new CustomField.""" - choice_set = convert_to_protobuf(choice_set, pb.CustomFieldChoiceSet) - owner = convert_to_protobuf(owner, pb.Owner) - metadata = convert_dict_to_struct(metadata) - result = pb.CustomField( - object_types=object_types, - type=type, - related_object_type=related_object_type, - name=name, - label=label, - group_name=group_name, - description=description, - required=required, - unique=unique, - search_weight=search_weight, - filter_logic=filter_logic, - ui_visible=ui_visible, - ui_editable=ui_editable, - is_cloneable=is_cloneable, - default=default, - related_object_filter=related_object_filter, - weight=weight, - validation_minimum=validation_minimum, - validation_maximum=validation_maximum, - validation_regex=validation_regex, - choice_set=choice_set, owner=owner, comments=comments, - metadata=metadata, - ) - return result - - -class CustomFieldChoiceSet: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomFieldChoiceSet.""" - - def __new__( - cls, - name: str | None = None, - description: str | None = None, - base_choices: str | None = None, - extra_choices: list[str] | None = None, - order_alphabetically: bool | None = None, - owner: str | Owner | pb.Owner | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.CustomFieldChoiceSet: - """Create a new CustomFieldChoiceSet.""" - owner = convert_to_protobuf(owner, pb.Owner) - metadata = convert_dict_to_struct(metadata) - result = pb.CustomFieldChoiceSet( - name=name, - description=description, - base_choices=base_choices, - extra_choices=extra_choices, - order_alphabetically=order_alphabetically, - owner=owner, - metadata=metadata, ) return result @@ -1778,17 +1717,16 @@ def __new__( cls, asn: str | ASN | pb.ASN | None = None, asn_range: str | ASNRange | pb.ASNRange | None = None, - aggregate: str | Aggregate | pb.Aggregate | None = None, - cable: str | Cable | pb.Cable | None = None, - cable_path: str | CablePath | pb.CablePath | None = None, + aggregate: Aggregate | pb.Aggregate | None = None, + cable: Cable | pb.Cable | None = None, + cable_path: CablePath | pb.CablePath | None = None, + cable_termination: CableTermination | pb.CableTermination | None = None, circuit: str | Circuit | pb.Circuit | None = None, circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None - ) = None, - circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, + circuit_termination: CircuitTermination | pb.CircuitTermination | None = None, circuit_type: str | CircuitType | pb.CircuitType | None = None, cluster: str | Cluster | pb.Cluster | None = None, cluster_group: str | ClusterGroup | pb.ClusterGroup | None = None, @@ -1798,29 +1736,22 @@ def __new__( str | ConsoleServerPort | pb.ConsoleServerPort | None ) = None, contact: str | Contact | pb.Contact | None = None, - contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None - ) = None, + contact_assignment: ContactAssignment | pb.ContactAssignment | None = None, contact_group: str | ContactGroup | pb.ContactGroup | None = None, contact_role: str | ContactRole | pb.ContactRole | None = None, - custom_field: str | CustomField | pb.CustomField | None = None, - custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - custom_link: str | CustomLink | pb.CustomLink | None = None, device: str | Device | pb.Device | None = None, device_bay: str | DeviceBay | pb.DeviceBay | None = None, device_role: str | DeviceRole | pb.DeviceRole | None = None, device_type: str | DeviceType | pb.DeviceType | None = None, fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, front_port: str | FrontPort | pb.FrontPort | None = None, ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, ip_address: str | IPAddress | pb.IPAddress | None = None, - ip_range: str | IPRange | pb.IPRange | None = None, + ip_range: IPRange | pb.IPRange | None = None, ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -1829,20 +1760,14 @@ def __new__( inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - journal_entry: str | JournalEntry | pb.JournalEntry | None = None, l2vpn: str | L2VPN | pb.L2VPN | None = None, - l2vpn_termination: str | L2VPNTermination | pb.L2VPNTermination | None = None, + l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, location: str | Location | pb.Location | None = None, mac_address: str | MACAddress | pb.MACAddress | None = None, manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, module_bay: str | ModuleBay | pb.ModuleBay | None = None, module_type: str | ModuleType | pb.ModuleType | None = None, - module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - owner: str | Owner | pb.Owner | None = None, - owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, platform: str | Platform | pb.Platform | None = None, power_feed: str | PowerFeed | pb.PowerFeed | None = None, power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -1854,7 +1779,7 @@ def __new__( provider_network: str | ProviderNetwork | pb.ProviderNetwork | None = None, rir: str | RIR | pb.RIR | None = None, rack: str | Rack | pb.Rack | None = None, - rack_reservation: str | RackReservation | pb.RackReservation | None = None, + rack_reservation: RackReservation | pb.RackReservation | None = None, rack_role: str | RackRole | pb.RackRole | None = None, rack_type: str | RackType | pb.RackType | None = None, rear_port: str | RearPort | pb.RearPort | None = None, @@ -1869,23 +1794,21 @@ def __new__( tenant_group: str | TenantGroup | pb.TenantGroup | None = None, tunnel: str | Tunnel | pb.Tunnel | None = None, tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None - ) = None, + tunnel_termination: TunnelTermination | pb.TunnelTermination | None = None, vlan: str | VLAN | pb.VLAN | None = None, vlan_group: str | VLANGroup | pb.VLANGroup | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, vm_interface: str | VMInterface | pb.VMInterface | None = None, vrf: str | VRF | pb.VRF | None = None, virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -1897,7 +1820,18 @@ def __new__( virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, wireless_lan_group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, - wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + wireless_link: WirelessLink | pb.WirelessLink | None = None, + custom_field: str | CustomField | pb.CustomField | None = None, + custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + journal_entry: JournalEntry | pb.JournalEntry | None = None, + module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + custom_link: str | CustomLink | pb.CustomLink | None = None, + owner: str | Owner | pb.Owner | None = None, + owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, ) -> pb.CustomFieldObjectReference: """Create a new CustomFieldObjectReference.""" asn = convert_to_protobuf(asn, pb.ASN) @@ -1905,6 +1839,7 @@ def __new__( aggregate = convert_to_protobuf(aggregate, pb.Aggregate) cable = convert_to_protobuf(cable, pb.Cable) cable_path = convert_to_protobuf(cable_path, pb.CablePath) + cable_termination = convert_to_protobuf(cable_termination, pb.CableTermination) circuit = convert_to_protobuf(circuit, pb.Circuit) circuit_group = convert_to_protobuf(circuit_group, pb.CircuitGroup) circuit_group_assignment = convert_to_protobuf( @@ -1927,11 +1862,6 @@ def __new__( ) contact_group = convert_to_protobuf(contact_group, pb.ContactGroup) contact_role = convert_to_protobuf(contact_role, pb.ContactRole) - custom_field = convert_to_protobuf(custom_field, pb.CustomField) - custom_field_choice_set = convert_to_protobuf( - custom_field_choice_set, pb.CustomFieldChoiceSet - ) - custom_link = convert_to_protobuf(custom_link, pb.CustomLink) device = convert_to_protobuf(device, pb.Device) device_bay = convert_to_protobuf(device_bay, pb.DeviceBay) device_role = convert_to_protobuf(device_role, pb.DeviceRole) @@ -1953,7 +1883,6 @@ def __new__( inventory_item_role = convert_to_protobuf( inventory_item_role, pb.InventoryItemRole ) - journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) l2vpn_termination = convert_to_protobuf(l2vpn_termination, pb.L2VPNTermination) location = convert_to_protobuf(location, pb.Location) @@ -1962,11 +1891,6 @@ def __new__( module = convert_to_protobuf(module, pb.Module) module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) module_type = convert_to_protobuf(module_type, pb.ModuleType) - module_type_profile = convert_to_protobuf( - module_type_profile, pb.ModuleTypeProfile - ) - owner = convert_to_protobuf(owner, pb.Owner) - owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) platform = convert_to_protobuf(platform, pb.Platform) power_feed = convert_to_protobuf(power_feed, pb.PowerFeed) power_outlet = convert_to_protobuf(power_outlet, pb.PowerOutlet) @@ -2024,12 +1948,24 @@ def __new__( wireless_lan_group, pb.WirelessLANGroup ) wireless_link = convert_to_protobuf(wireless_link, pb.WirelessLink) + custom_field = convert_to_protobuf(custom_field, pb.CustomField) + custom_field_choice_set = convert_to_protobuf( + custom_field_choice_set, pb.CustomFieldChoiceSet + ) + journal_entry = convert_to_protobuf(journal_entry, pb.JournalEntry) + module_type_profile = convert_to_protobuf( + module_type_profile, pb.ModuleTypeProfile + ) + custom_link = convert_to_protobuf(custom_link, pb.CustomLink) + owner = convert_to_protobuf(owner, pb.Owner) + owner_group = convert_to_protobuf(owner_group, pb.OwnerGroup) result = pb.CustomFieldObjectReference( asn=asn, asn_range=asn_range, aggregate=aggregate, cable=cable, cable_path=cable_path, + cable_termination=cable_termination, circuit=circuit, circuit_group=circuit_group, circuit_group_assignment=circuit_group_assignment, @@ -2044,9 +1980,6 @@ def __new__( contact_assignment=contact_assignment, contact_group=contact_group, contact_role=contact_role, - custom_field=custom_field, - custom_field_choice_set=custom_field_choice_set, - custom_link=custom_link, device=device, device_bay=device_bay, device_role=device_role, @@ -2064,7 +1997,6 @@ def __new__( interface=interface, inventory_item=inventory_item, inventory_item_role=inventory_item_role, - journal_entry=journal_entry, l2vpn=l2vpn, l2vpn_termination=l2vpn_termination, location=location, @@ -2073,9 +2005,6 @@ def __new__( module=module, module_bay=module_bay, module_type=module_type, - module_type_profile=module_type_profile, - owner=owner, - owner_group=owner_group, platform=platform, power_feed=power_feed, power_outlet=power_outlet, @@ -2119,6 +2048,13 @@ def __new__( wireless_lan=wireless_lan, wireless_lan_group=wireless_lan_group, wireless_link=wireless_link, + custom_field=custom_field, + custom_field_choice_set=custom_field_choice_set, + journal_entry=journal_entry, + module_type_profile=module_type_profile, + custom_link=custom_link, + owner=owner, + owner_group=owner_group, ) return result @@ -2128,6 +2064,10 @@ class CustomFieldValue: def __new__( cls, + multiple_selection: list[str] | None = None, + multiple_objects: ( + list[CustomFieldObjectReference | pb.CustomFieldObjectReference] | None + ) = None, text: str | None = None, long_text: str | None = None, integer: int | None = None, @@ -2139,20 +2079,17 @@ def __new__( json: str | None = None, selection: str | None = None, object: ( - str | CustomFieldObjectReference | pb.CustomFieldObjectReference | None - ) = None, - multiple_selection: list[str] | None = None, - multiple_objects: ( - list[str | CustomFieldObjectReference | pb.CustomFieldObjectReference] - | None + CustomFieldObjectReference | pb.CustomFieldObjectReference | None ) = None, ) -> pb.CustomFieldValue: """Create a new CustomFieldValue.""" - object = convert_to_protobuf(object, pb.CustomFieldObjectReference) multiple_objects = convert_to_protobuf_list( multiple_objects, pb.CustomFieldObjectReference ) + object = convert_to_protobuf(object, pb.CustomFieldObjectReference) result = pb.CustomFieldValue( + multiple_selection=multiple_selection, + multiple_objects=multiple_objects, text=text, long_text=long_text, integer=integer, @@ -2164,50 +2101,12 @@ def __new__( json=json, selection=selection, object=object, - multiple_selection=multiple_selection, - multiple_objects=multiple_objects, ) return result -class CustomLink: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomLink.""" - - def __new__( - cls, - object_types: list[str] | None = None, - name: str | None = None, - enabled: bool | None = None, - link_text: str | None = None, - link_url: str | None = None, - weight: int | None = None, - group_name: str | None = None, - button_class: str | None = None, - new_window: bool | None = None, - owner: str | Owner | pb.Owner | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.CustomLink: - """Create a new CustomLink.""" - owner = convert_to_protobuf(owner, pb.Owner) - metadata = convert_dict_to_struct(metadata) - result = pb.CustomLink( - object_types=object_types, - name=name, - enabled=enabled, - link_text=link_text, - link_url=link_url, - weight=weight, - group_name=group_name, - button_class=button_class, - new_window=new_window, - owner=owner, - metadata=metadata, - ) - return result - - -class Device: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Device.""" +class Device: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Device.""" def __new__( cls, @@ -2235,13 +2134,12 @@ def __new__( vc_position: int | None = None, vc_priority: int | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + config: DeviceConfig | pb.DeviceConfig | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, ) -> pb.Device: @@ -2258,10 +2156,11 @@ def __new__( oob_ip = convert_to_protobuf(oob_ip, pb.IPAddress) cluster = convert_to_protobuf(cluster, pb.Cluster) virtual_chassis = convert_to_protobuf(virtual_chassis, pb.VirtualChassis) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + config = convert_to_protobuf(config, pb.DeviceConfig) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -2297,11 +2196,12 @@ def __new__( vc_position=vc_position, vc_priority=vc_priority, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + config=config, ) return result @@ -2316,30 +2216,28 @@ def __new__( label: str | None = None, description: str | None = None, installed_device: str | Device | pb.Device | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceBay: """Create a new DeviceBay.""" device = convert_to_protobuf(device, pb.Device) installed_device = convert_to_protobuf(installed_device, pb.Device) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceBay( device=device, name=name, label=label, description=description, installed_device=installed_device, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -2353,34 +2251,32 @@ def __new__( slug: str | None = None, color: str | None = None, vm_role: bool | None = None, - parent: str | DeviceRole | pb.DeviceRole | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + parent: str | DeviceRole | pb.DeviceRole | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceRole: """Create a new DeviceRole.""" - parent = convert_to_protobuf(parent, pb.DeviceRole) tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + parent = convert_to_protobuf(parent, pb.DeviceRole) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceRole( name=name, slug=slug, color=color, vm_role=vm_role, - parent=parent, description=description, tags=tags, - owner=owner, - comments=comments, custom_fields=custom_fields, + parent=parent, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -2403,21 +2299,19 @@ def __new__( weight: float | None = None, weight_unit: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.DeviceType: """Create a new DeviceType.""" manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) default_platform = convert_to_protobuf(default_platform, pb.Platform) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.DeviceType( manufacturer=manufacturer, default_platform=default_platform, @@ -2432,11 +2326,11 @@ def __new__( weight=weight, weight_unit=weight_unit, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -2452,19 +2346,17 @@ def __new__( auth_type: str | None = None, auth_key: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.FHRPGroup: """Create a new FHRPGroup.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.FHRPGroup( name=name, protocol=protocol, @@ -2472,11 +2364,11 @@ def __new__( auth_type=auth_type, auth_key=auth_key, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -2489,19 +2381,19 @@ def __new__( group: str | FHRPGroup | pb.FHRPGroup | None = None, interface_asn: str | ASN | pb.ASN | None = None, interface_asn_range: str | ASNRange | pb.ASNRange | None = None, - interface_aggregate: str | Aggregate | pb.Aggregate | None = None, - interface_cable: str | Cable | pb.Cable | None = None, - interface_cable_path: str | CablePath | pb.CablePath | None = None, + interface_aggregate: Aggregate | pb.Aggregate | None = None, + interface_cable: Cable | pb.Cable | None = None, + interface_cable_path: CablePath | pb.CablePath | None = None, interface_cable_termination: ( - str | CableTermination | pb.CableTermination | None + CableTermination | pb.CableTermination | None ) = None, interface_circuit: str | Circuit | pb.Circuit | None = None, interface_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, interface_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, interface_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitTermination | pb.CircuitTermination | None ) = None, interface_circuit_type: str | CircuitType | pb.CircuitType | None = None, interface_cluster: str | Cluster | pb.Cluster | None = None, @@ -2513,28 +2405,23 @@ def __new__( ) = None, interface_contact: str | Contact | pb.Contact | None = None, interface_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None + ContactAssignment | pb.ContactAssignment | None ) = None, interface_contact_group: str | ContactGroup | pb.ContactGroup | None = None, interface_contact_role: str | ContactRole | pb.ContactRole | None = None, - interface_custom_field: str | CustomField | pb.CustomField | None = None, - interface_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - interface_custom_link: str | CustomLink | pb.CustomLink | None = None, interface_device: str | Device | pb.Device | None = None, interface_device_bay: str | DeviceBay | pb.DeviceBay | None = None, interface_device_role: str | DeviceRole | pb.DeviceRole | None = None, interface_device_type: str | DeviceType | pb.DeviceType | None = None, interface_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, interface_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, interface_front_port: str | FrontPort | pb.FrontPort | None = None, interface_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, interface_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, interface_ip_address: str | IPAddress | pb.IPAddress | None = None, - interface_ip_range: str | IPRange | pb.IPRange | None = None, + interface_ip_range: IPRange | pb.IPRange | None = None, interface_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, interface_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, interface_ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -2543,22 +2430,16 @@ def __new__( interface_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - interface_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, interface_l2vpn: str | L2VPN | pb.L2VPN | None = None, interface_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None + L2VPNTermination | pb.L2VPNTermination | None ) = None, interface_location: str | Location | pb.Location | None = None, interface_mac_address: str | MACAddress | pb.MACAddress | None = None, interface_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - interface_module: str | Module | pb.Module | None = None, + interface_module: Module | pb.Module | None = None, interface_module_bay: str | ModuleBay | pb.ModuleBay | None = None, interface_module_type: str | ModuleType | pb.ModuleType | None = None, - interface_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - interface_owner: str | Owner | pb.Owner | None = None, - interface_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, interface_platform: str | Platform | pb.Platform | None = None, interface_power_feed: str | PowerFeed | pb.PowerFeed | None = None, interface_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -2574,9 +2455,7 @@ def __new__( ) = None, interface_rir: str | RIR | pb.RIR | None = None, interface_rack: str | Rack | pb.Rack | None = None, - interface_rack_reservation: ( - str | RackReservation | pb.RackReservation | None - ) = None, + interface_rack_reservation: RackReservation | pb.RackReservation | None = None, interface_rack_role: str | RackRole | pb.RackRole | None = None, interface_rack_type: str | RackType | pb.RackType | None = None, interface_rear_port: str | RearPort | pb.RearPort | None = None, @@ -2592,7 +2471,7 @@ def __new__( interface_tunnel: str | Tunnel | pb.Tunnel | None = None, interface_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, interface_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None + TunnelTermination | pb.TunnelTermination | None ) = None, interface_vlan: str | VLAN | pb.VLAN | None = None, interface_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, @@ -2600,7 +2479,7 @@ def __new__( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, interface_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, interface_vm_interface: str | VMInterface | pb.VMInterface | None = None, interface_vrf: str | VRF | pb.VRF | None = None, @@ -2611,7 +2490,7 @@ def __new__( str | VirtualCircuit | pb.VirtualCircuit | None ) = None, interface_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, interface_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -2627,7 +2506,18 @@ def __new__( interface_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - interface_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + interface_wireless_link: WirelessLink | pb.WirelessLink | None = None, + interface_custom_field: str | CustomField | pb.CustomField | None = None, + interface_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + interface_journal_entry: JournalEntry | pb.JournalEntry | None = None, + interface_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + interface_custom_link: str | CustomLink | pb.CustomLink | None = None, + interface_owner: str | Owner | pb.Owner | None = None, + interface_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, priority: int | None = None, metadata: dict[str, Any] | None = None, ) -> pb.FHRPGroupAssignment: @@ -2638,6 +2528,9 @@ def __new__( interface_aggregate = convert_to_protobuf(interface_aggregate, pb.Aggregate) interface_cable = convert_to_protobuf(interface_cable, pb.Cable) interface_cable_path = convert_to_protobuf(interface_cable_path, pb.CablePath) + interface_cable_termination = convert_to_protobuf( + interface_cable_termination, pb.CableTermination + ) interface_circuit = convert_to_protobuf(interface_circuit, pb.Circuit) interface_circuit_group = convert_to_protobuf( interface_circuit_group, pb.CircuitGroup @@ -2674,15 +2567,6 @@ def __new__( interface_contact_role = convert_to_protobuf( interface_contact_role, pb.ContactRole ) - interface_custom_field = convert_to_protobuf( - interface_custom_field, pb.CustomField - ) - interface_custom_field_choice_set = convert_to_protobuf( - interface_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - interface_custom_link = convert_to_protobuf( - interface_custom_link, pb.CustomLink - ) interface_device = convert_to_protobuf(interface_device, pb.Device) interface_device_bay = convert_to_protobuf(interface_device_bay, pb.DeviceBay) interface_device_role = convert_to_protobuf( @@ -2718,9 +2602,6 @@ def __new__( interface_inventory_item_role = convert_to_protobuf( interface_inventory_item_role, pb.InventoryItemRole ) - interface_journal_entry = convert_to_protobuf( - interface_journal_entry, pb.JournalEntry - ) interface_l2vpn = convert_to_protobuf(interface_l2vpn, pb.L2VPN) interface_l2vpn_termination = convert_to_protobuf( interface_l2vpn_termination, pb.L2VPNTermination @@ -2737,13 +2618,6 @@ def __new__( interface_module_type = convert_to_protobuf( interface_module_type, pb.ModuleType ) - interface_module_type_profile = convert_to_protobuf( - interface_module_type_profile, pb.ModuleTypeProfile - ) - interface_owner = convert_to_protobuf(interface_owner, pb.Owner) - interface_owner_group = convert_to_protobuf( - interface_owner_group, pb.OwnerGroup - ) interface_platform = convert_to_protobuf(interface_platform, pb.Platform) interface_power_feed = convert_to_protobuf(interface_power_feed, pb.PowerFeed) interface_power_outlet = convert_to_protobuf( @@ -2831,6 +2705,25 @@ def __new__( interface_wireless_link = convert_to_protobuf( interface_wireless_link, pb.WirelessLink ) + interface_custom_field = convert_to_protobuf( + interface_custom_field, pb.CustomField + ) + interface_custom_field_choice_set = convert_to_protobuf( + interface_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + interface_journal_entry = convert_to_protobuf( + interface_journal_entry, pb.JournalEntry + ) + interface_module_type_profile = convert_to_protobuf( + interface_module_type_profile, pb.ModuleTypeProfile + ) + interface_custom_link = convert_to_protobuf( + interface_custom_link, pb.CustomLink + ) + interface_owner = convert_to_protobuf(interface_owner, pb.Owner) + interface_owner_group = convert_to_protobuf( + interface_owner_group, pb.OwnerGroup + ) metadata = convert_dict_to_struct(metadata) result = pb.FHRPGroupAssignment( group=group, @@ -2854,9 +2747,6 @@ def __new__( interface_contact_assignment=interface_contact_assignment, interface_contact_group=interface_contact_group, interface_contact_role=interface_contact_role, - interface_custom_field=interface_custom_field, - interface_custom_field_choice_set=interface_custom_field_choice_set, - interface_custom_link=interface_custom_link, interface_device=interface_device, interface_device_bay=interface_device_bay, interface_device_role=interface_device_role, @@ -2874,7 +2764,6 @@ def __new__( interface_interface=interface_interface, interface_inventory_item=interface_inventory_item, interface_inventory_item_role=interface_inventory_item_role, - interface_journal_entry=interface_journal_entry, interface_l2vpn=interface_l2vpn, interface_l2vpn_termination=interface_l2vpn_termination, interface_location=interface_location, @@ -2883,9 +2772,6 @@ def __new__( interface_module=interface_module, interface_module_bay=interface_module_bay, interface_module_type=interface_module_type, - interface_module_type_profile=interface_module_type_profile, - interface_owner=interface_owner, - interface_owner_group=interface_owner_group, interface_platform=interface_platform, interface_power_feed=interface_power_feed, interface_power_outlet=interface_power_outlet, @@ -2929,6 +2815,13 @@ def __new__( interface_wireless_lan=interface_wireless_lan, interface_wireless_lan_group=interface_wireless_lan_group, interface_wireless_link=interface_wireless_link, + interface_custom_field=interface_custom_field, + interface_custom_field_choice_set=interface_custom_field_choice_set, + interface_journal_entry=interface_journal_entry, + interface_module_type_profile=interface_module_type_profile, + interface_custom_link=interface_custom_link, + interface_owner=interface_owner, + interface_owner_group=interface_owner_group, priority=priority, metadata=metadata, ) @@ -2941,28 +2834,29 @@ class FrontPort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, color: str | None = None, - positions: int | None = None, + rear_port: str | RearPort | pb.RearPort | None = None, + rear_port_position: int | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + positions: int | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.FrontPort: """Create a new FrontPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) + rear_port = convert_to_protobuf(rear_port, pb.RearPort) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.FrontPort( device=device, module=module, @@ -2970,13 +2864,15 @@ def __new__( label=label, type=type, color=color, - positions=positions, + rear_port=rear_port, + rear_port_position=rear_port_position, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + positions=positions, + owner=owner, ) return result @@ -2988,19 +2884,17 @@ def __new__( cls, object_asn: str | ASN | pb.ASN | None = None, object_asn_range: str | ASNRange | pb.ASNRange | None = None, - object_aggregate: str | Aggregate | pb.Aggregate | None = None, - object_cable: str | Cable | pb.Cable | None = None, - object_cable_path: str | CablePath | pb.CablePath | None = None, - object_cable_termination: ( - str | CableTermination | pb.CableTermination | None - ) = None, + object_aggregate: Aggregate | pb.Aggregate | None = None, + object_cable: Cable | pb.Cable | None = None, + object_cable_path: CablePath | pb.CablePath | None = None, + object_cable_termination: CableTermination | pb.CableTermination | None = None, object_circuit: str | Circuit | pb.Circuit | None = None, object_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, object_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, object_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitTermination | pb.CircuitTermination | None ) = None, object_circuit_type: str | CircuitType | pb.CircuitType | None = None, object_cluster: str | Cluster | pb.Cluster | None = None, @@ -3012,28 +2906,23 @@ def __new__( ) = None, object_contact: str | Contact | pb.Contact | None = None, object_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None + ContactAssignment | pb.ContactAssignment | None ) = None, object_contact_group: str | ContactGroup | pb.ContactGroup | None = None, object_contact_role: str | ContactRole | pb.ContactRole | None = None, - object_custom_field: str | CustomField | pb.CustomField | None = None, - object_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - object_custom_link: str | CustomLink | pb.CustomLink | None = None, object_device: str | Device | pb.Device | None = None, object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, object_device_role: str | DeviceRole | pb.DeviceRole | None = None, object_device_type: str | DeviceType | pb.DeviceType | None = None, object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, object_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, object_front_port: str | FrontPort | pb.FrontPort | None = None, object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, object_ip_address: str | IPAddress | pb.IPAddress | None = None, - object_ip_range: str | IPRange | pb.IPRange | None = None, + object_ip_range: IPRange | pb.IPRange | None = None, object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, object_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, object_ip_sec_proposal: str | IPSecProposal | pb.IPSecProposal | None = None, @@ -3042,22 +2931,14 @@ def __new__( object_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - object_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, object_l2vpn: str | L2VPN | pb.L2VPN | None = None, - object_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None - ) = None, + object_l2vpn_termination: L2VPNTermination | pb.L2VPNTermination | None = None, object_location: str | Location | pb.Location | None = None, object_mac_address: str | MACAddress | pb.MACAddress | None = None, object_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - object_module: str | Module | pb.Module | None = None, + object_module: Module | pb.Module | None = None, object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, object_module_type: str | ModuleType | pb.ModuleType | None = None, - object_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - object_owner: str | Owner | pb.Owner | None = None, - object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, object_platform: str | Platform | pb.Platform | None = None, object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -3073,9 +2954,7 @@ def __new__( ) = None, object_rir: str | RIR | pb.RIR | None = None, object_rack: str | Rack | pb.Rack | None = None, - object_rack_reservation: ( - str | RackReservation | pb.RackReservation | None - ) = None, + object_rack_reservation: RackReservation | pb.RackReservation | None = None, object_rack_role: str | RackRole | pb.RackRole | None = None, object_rack_type: str | RackType | pb.RackType | None = None, object_rear_port: str | RearPort | pb.RearPort | None = None, @@ -3091,7 +2970,7 @@ def __new__( object_tunnel: str | Tunnel | pb.Tunnel | None = None, object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, object_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None + TunnelTermination | pb.TunnelTermination | None ) = None, object_vlan: str | VLAN | pb.VLAN | None = None, object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, @@ -3099,14 +2978,14 @@ def __new__( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, object_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, object_vm_interface: str | VMInterface | pb.VMInterface | None = None, object_vrf: str | VRF | pb.VRF | None = None, object_virtual_chassis: str | VirtualChassis | pb.VirtualChassis | None = None, object_virtual_circuit: str | VirtualCircuit | pb.VirtualCircuit | None = None, object_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, object_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -3120,7 +2999,18 @@ def __new__( object_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - object_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + object_wireless_link: WirelessLink | pb.WirelessLink | None = None, + object_custom_field: str | CustomField | pb.CustomField | None = None, + object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + object_journal_entry: JournalEntry | pb.JournalEntry | None = None, + object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + object_custom_link: str | CustomLink | pb.CustomLink | None = None, + object_owner: str | Owner | pb.Owner | None = None, + object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, ) -> pb.GenericObject: """Create a new GenericObject.""" object_asn = convert_to_protobuf(object_asn, pb.ASN) @@ -3128,6 +3018,9 @@ def __new__( object_aggregate = convert_to_protobuf(object_aggregate, pb.Aggregate) object_cable = convert_to_protobuf(object_cable, pb.Cable) object_cable_path = convert_to_protobuf(object_cable_path, pb.CablePath) + object_cable_termination = convert_to_protobuf( + object_cable_termination, pb.CableTermination + ) object_circuit = convert_to_protobuf(object_circuit, pb.Circuit) object_circuit_group = convert_to_protobuf( object_circuit_group, pb.CircuitGroup @@ -3156,11 +3049,6 @@ def __new__( object_contact_group, pb.ContactGroup ) object_contact_role = convert_to_protobuf(object_contact_role, pb.ContactRole) - object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) - object_custom_field_choice_set = convert_to_protobuf( - object_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) object_device = convert_to_protobuf(object_device, pb.Device) object_device_bay = convert_to_protobuf(object_device_bay, pb.DeviceBay) object_device_role = convert_to_protobuf(object_device_role, pb.DeviceRole) @@ -3188,9 +3076,6 @@ def __new__( object_inventory_item_role = convert_to_protobuf( object_inventory_item_role, pb.InventoryItemRole ) - object_journal_entry = convert_to_protobuf( - object_journal_entry, pb.JournalEntry - ) object_l2vpn = convert_to_protobuf(object_l2vpn, pb.L2VPN) object_l2vpn_termination = convert_to_protobuf( object_l2vpn_termination, pb.L2VPNTermination @@ -3201,11 +3086,6 @@ def __new__( object_module = convert_to_protobuf(object_module, pb.Module) object_module_bay = convert_to_protobuf(object_module_bay, pb.ModuleBay) object_module_type = convert_to_protobuf(object_module_type, pb.ModuleType) - object_module_type_profile = convert_to_protobuf( - object_module_type_profile, pb.ModuleTypeProfile - ) - object_owner = convert_to_protobuf(object_owner, pb.Owner) - object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) object_platform = convert_to_protobuf(object_platform, pb.Platform) object_power_feed = convert_to_protobuf(object_power_feed, pb.PowerFeed) object_power_outlet = convert_to_protobuf(object_power_outlet, pb.PowerOutlet) @@ -3277,6 +3157,19 @@ def __new__( object_wireless_link = convert_to_protobuf( object_wireless_link, pb.WirelessLink ) + object_custom_field = convert_to_protobuf(object_custom_field, pb.CustomField) + object_custom_field_choice_set = convert_to_protobuf( + object_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + object_journal_entry = convert_to_protobuf( + object_journal_entry, pb.JournalEntry + ) + object_module_type_profile = convert_to_protobuf( + object_module_type_profile, pb.ModuleTypeProfile + ) + object_custom_link = convert_to_protobuf(object_custom_link, pb.CustomLink) + object_owner = convert_to_protobuf(object_owner, pb.Owner) + object_owner_group = convert_to_protobuf(object_owner_group, pb.OwnerGroup) result = pb.GenericObject( object_asn=object_asn, object_asn_range=object_asn_range, @@ -3298,9 +3191,6 @@ def __new__( object_contact_assignment=object_contact_assignment, object_contact_group=object_contact_group, object_contact_role=object_contact_role, - object_custom_field=object_custom_field, - object_custom_field_choice_set=object_custom_field_choice_set, - object_custom_link=object_custom_link, object_device=object_device, object_device_bay=object_device_bay, object_device_role=object_device_role, @@ -3318,7 +3208,6 @@ def __new__( object_interface=object_interface, object_inventory_item=object_inventory_item, object_inventory_item_role=object_inventory_item_role, - object_journal_entry=object_journal_entry, object_l2vpn=object_l2vpn, object_l2vpn_termination=object_l2vpn_termination, object_location=object_location, @@ -3327,9 +3216,6 @@ def __new__( object_module=object_module, object_module_bay=object_module_bay, object_module_type=object_module_type, - object_module_type_profile=object_module_type_profile, - object_owner=object_owner, - object_owner_group=object_owner_group, object_platform=object_platform, object_power_feed=object_power_feed, object_power_outlet=object_power_outlet, @@ -3373,6 +3259,13 @@ def __new__( object_wireless_lan=object_wireless_lan, object_wireless_lan_group=object_wireless_lan_group, object_wireless_link=object_wireless_link, + object_custom_field=object_custom_field, + object_custom_field_choice_set=object_custom_field_choice_set, + object_journal_entry=object_journal_entry, + object_module_type_profile=object_module_type_profile, + object_custom_link=object_custom_link, + object_owner=object_owner, + object_owner_group=object_owner_group, ) return result @@ -3386,34 +3279,32 @@ def __new__( description: str | None = None, version: int | None = None, mode: str | None = None, - proposals: list[str | IKEProposal | pb.IKEProposal] | None = None, preshared_key: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + proposals: list[str | IKEProposal | pb.IKEProposal] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IKEPolicy: """Create a new IKEPolicy.""" - proposals = convert_to_protobuf_list(proposals, pb.IKEProposal) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + proposals = convert_to_protobuf_list(proposals, pb.IKEProposal) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IKEPolicy( name=name, description=description, version=version, mode=mode, - proposals=proposals, preshared_key=preshared_key, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + proposals=proposals, metadata=metadata, + owner=owner, ) return result @@ -3430,19 +3321,17 @@ def __new__( authentication_algorithm: str | None = None, group: int | None = None, sa_lifetime: int | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IKEProposal: """Create a new IKEProposal.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IKEProposal( name=name, description=description, @@ -3451,11 +3340,11 @@ def __new__( authentication_algorithm=authentication_algorithm, group=group, sa_lifetime=sa_lifetime, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -3476,13 +3365,11 @@ def __new__( nat_inside: str | IPAddress | pb.IPAddress | None = None, dns_name: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, device_type: str | DeviceType | pb.DeviceType = None, @@ -3504,10 +3391,10 @@ def __new__( assigned_object_vm_interface, pb.VMInterface ) nat_inside = convert_to_protobuf(nat_inside, pb.IPAddress) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -3558,11 +3445,11 @@ def __new__( nat_inside=nat_inside, dns_name=dns_name, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -3579,24 +3466,22 @@ def __new__( status: str | None = None, role: str | Role | pb.Role | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - mark_populated: bool | None = None, mark_utilized: bool | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + mark_populated: bool | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IPRange: """Create a new IPRange.""" vrf = convert_to_protobuf(vrf, pb.VRF) tenant = convert_to_protobuf(tenant, pb.Tenant) role = convert_to_protobuf(role, pb.Role) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPRange( start_address=start_address, end_address=end_address, @@ -3605,13 +3490,13 @@ def __new__( status=status, role=role, description=description, - owner=owner, comments=comments, tags=tags, - mark_populated=mark_populated, mark_utilized=mark_utilized, custom_fields=custom_fields, + mark_populated=mark_populated, metadata=metadata, + owner=owner, ) return result @@ -3623,32 +3508,30 @@ def __new__( cls, name: str | None = None, description: str | None = None, - proposals: list[str | IPSecProposal | pb.IPSecProposal] | None = None, pfs_group: int | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + proposals: list[str | IPSecProposal | pb.IPSecProposal] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecPolicy: """Create a new IPSecPolicy.""" - proposals = convert_to_protobuf_list(proposals, pb.IPSecProposal) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + proposals = convert_to_protobuf_list(proposals, pb.IPSecProposal) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecPolicy( name=name, description=description, - proposals=proposals, pfs_group=pfs_group, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + proposals=proposals, metadata=metadata, + owner=owner, ) return result @@ -3663,32 +3546,30 @@ def __new__( mode: str | None = None, ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, ipsec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecProfile: """Create a new IPSecProfile.""" ike_policy = convert_to_protobuf(ike_policy, pb.IKEPolicy) ipsec_policy = convert_to_protobuf(ipsec_policy, pb.IPSecPolicy) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecProfile( name=name, description=description, mode=mode, ike_policy=ike_policy, ipsec_policy=ipsec_policy, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -3704,19 +3585,17 @@ def __new__( authentication_algorithm: str | None = None, sa_lifetime_seconds: int | None = None, sa_lifetime_data: int | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.IPSecProposal: """Create a new IPSecProposal.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.IPSecProposal( name=name, description=description, @@ -3724,11 +3603,11 @@ def __new__( authentication_algorithm=authentication_algorithm, sa_lifetime_seconds=sa_lifetime_seconds, sa_lifetime_data=sa_lifetime_data, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -3739,8 +3618,7 @@ class Interface: def __new__( cls, device: str | Device | pb.Device | None = None, - vdcs: list[str | VirtualDeviceContext | pb.VirtualDeviceContext] | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, @@ -3764,20 +3642,19 @@ def __new__( rf_channel_width: float | None = None, tx_power: int | None = None, untagged_vlan: str | VLAN | pb.VLAN | None = None, - tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, qinq_svlan: str | VLAN | pb.VLAN | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, mark_connected: bool | None = None, - wireless_lans: list[str | WirelessLAN | pb.WirelessLAN] | None = None, vrf: str | VRF | pb.VRF | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + vdcs: list[str | VirtualDeviceContext | pb.VirtualDeviceContext] | None = None, + tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, + wireless_lans: list[str | WirelessLAN | pb.WirelessLAN] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, # shortcuts manufacturer: str | Manufacturer | pb.Manufacturer = None, device_type: str | DeviceType | pb.DeviceType = None, @@ -3787,24 +3664,24 @@ def __new__( ) -> pb.Interface: """Create a new Interface.""" device = convert_to_protobuf(device, pb.Device) - vdcs = convert_to_protobuf_list(vdcs, pb.VirtualDeviceContext) module = convert_to_protobuf(module, pb.Module) parent = convert_to_protobuf(parent, pb.Interface) bridge = convert_to_protobuf(bridge, pb.Interface) lag = convert_to_protobuf(lag, pb.Interface) primary_mac_address = convert_to_protobuf(primary_mac_address, pb.MACAddress) untagged_vlan = convert_to_protobuf(untagged_vlan, pb.VLAN) - tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) vlan_translation_policy = convert_to_protobuf( vlan_translation_policy, pb.VLANTranslationPolicy ) - wireless_lans = convert_to_protobuf_list(wireless_lans, pb.WirelessLAN) vrf = convert_to_protobuf(vrf, pb.VRF) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + vdcs = convert_to_protobuf_list(vdcs, pb.VirtualDeviceContext) + tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) + wireless_lans = convert_to_protobuf_list(wireless_lans, pb.WirelessLAN) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) # shortcut types (not directly used) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) @@ -3833,7 +3710,6 @@ def __new__( device.role.CopyFrom(role) result = pb.Interface( device=device, - vdcs=vdcs, module=module, name=name, label=label, @@ -3858,16 +3734,17 @@ def __new__( rf_channel_width=rf_channel_width, tx_power=tx_power, untagged_vlan=untagged_vlan, - tagged_vlans=tagged_vlans, qinq_svlan=qinq_svlan, vlan_translation_policy=vlan_translation_policy, mark_connected=mark_connected, - wireless_lans=wireless_lans, vrf=vrf, - owner=owner, tags=tags, custom_fields=custom_fields, + vdcs=vdcs, + tagged_vlans=tagged_vlans, + wireless_lans=wireless_lans, metadata=metadata, + owner=owner, ) return result @@ -3898,12 +3775,10 @@ def __new__( component_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, component_power_port: str | PowerPort | pb.PowerPort | None = None, component_rear_port: str | RearPort | pb.RearPort | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.InventoryItem: """Create a new InventoryItem.""" device = convert_to_protobuf(device, pb.Device) @@ -3923,10 +3798,10 @@ def __new__( ) component_power_port = convert_to_protobuf(component_power_port, pb.PowerPort) component_rear_port = convert_to_protobuf(component_rear_port, pb.RearPort) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.InventoryItem( device=device, parent=parent, @@ -3947,10 +3822,10 @@ def __new__( component_power_outlet=component_power_outlet, component_power_port=component_power_port, component_rear_port=component_rear_port, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -3964,55 +3839,104 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.InventoryItemRole: """Create a new InventoryItemRole.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.InventoryItemRole( name=name, slug=slug, color=color, description=description, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, owner=owner, comments=comments, + ) + return result + + +class L2VPN: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPN.""" + + def __new__( + cls, + identifier: int | None = None, + name: str | None = None, + slug: str | None = None, + type: str | None = None, + description: str | None = None, + comments: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, + export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, + status: str | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.L2VPN: + """Create a new L2VPN.""" + tenant = convert_to_protobuf(tenant, pb.Tenant) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) + export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.L2VPN( + identifier=identifier, + name=name, + slug=slug, + type=type, + description=description, + comments=comments, + tenant=tenant, tags=tags, custom_fields=custom_fields, + import_targets=import_targets, + export_targets=export_targets, + status=status, metadata=metadata, + owner=owner, ) return result -class JournalEntry: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.JournalEntry.""" +class L2VPNTermination: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPNTermination.""" def __new__( cls, + l2vpn: str | L2VPN | pb.L2VPN | None = None, + assigned_object_interface: str | Interface | pb.Interface | None = None, + assigned_object_vlan: str | VLAN | pb.VLAN | None = None, + assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, assigned_object_asn: str | ASN | pb.ASN | None = None, assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, - assigned_object_aggregate: str | Aggregate | pb.Aggregate | None = None, - assigned_object_cable: str | Cable | pb.Cable | None = None, - assigned_object_cable_path: str | CablePath | pb.CablePath | None = None, + assigned_object_aggregate: Aggregate | pb.Aggregate | None = None, + assigned_object_cable: Cable | pb.Cable | None = None, + assigned_object_cable_path: CablePath | pb.CablePath | None = None, assigned_object_cable_termination: ( - str | CableTermination | pb.CableTermination | None + CableTermination | pb.CableTermination | None ) = None, assigned_object_circuit: str | Circuit | pb.Circuit | None = None, assigned_object_circuit_group: ( str | CircuitGroup | pb.CircuitGroup | None ) = None, assigned_object_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, assigned_object_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitTermination | pb.CircuitTermination | None ) = None, assigned_object_circuit_type: str | CircuitType | pb.CircuitType | None = None, assigned_object_cluster: str | Cluster | pb.Cluster | None = None, @@ -4026,7 +3950,7 @@ def __new__( ) = None, assigned_object_contact: str | Contact | pb.Contact | None = None, assigned_object_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None + ContactAssignment | pb.ContactAssignment | None ) = None, assigned_object_contact_group: ( str | ContactGroup | pb.ContactGroup | None @@ -4036,20 +3960,19 @@ def __new__( assigned_object_custom_field_choice_set: ( str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None ) = None, - assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, assigned_object_device: str | Device | pb.Device | None = None, assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, assigned_object_device_type: str | DeviceType | pb.DeviceType | None = None, assigned_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, assigned_object_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, assigned_object_front_port: str | FrontPort | pb.FrontPort | None = None, assigned_object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, assigned_object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, assigned_object_ip_address: str | IPAddress | pb.IPAddress | None = None, - assigned_object_ip_range: str | IPRange | pb.IPRange | None = None, + assigned_object_ip_range: IPRange | pb.IPRange | None = None, assigned_object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, assigned_object_ip_sec_profile: ( str | IPSecProfile | pb.IPSecProfile | None @@ -4057,33 +3980,28 @@ def __new__( assigned_object_ip_sec_proposal: ( str | IPSecProposal | pb.IPSecProposal | None ) = None, - assigned_object_interface: str | Interface | pb.Interface | None = None, assigned_object_inventory_item: ( str | InventoryItem | pb.InventoryItem | None ) = None, assigned_object_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - assigned_object_journal_entry: ( - str | JournalEntry | pb.JournalEntry | None - ) = None, + assigned_object_journal_entry: JournalEntry | pb.JournalEntry | None = None, assigned_object_l2vpn: str | L2VPN | pb.L2VPN | None = None, assigned_object_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None + L2VPNTermination | pb.L2VPNTermination | None ) = None, assigned_object_location: str | Location | pb.Location | None = None, assigned_object_mac_address: str | MACAddress | pb.MACAddress | None = None, assigned_object_manufacturer: ( str | Manufacturer | pb.Manufacturer | None ) = None, - assigned_object_module: str | Module | pb.Module | None = None, + assigned_object_module: Module | pb.Module | None = None, assigned_object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, assigned_object_module_type: str | ModuleType | pb.ModuleType | None = None, assigned_object_module_type_profile: ( str | ModuleTypeProfile | pb.ModuleTypeProfile | None ) = None, - assigned_object_owner: str | Owner | pb.Owner | None = None, - assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, assigned_object_platform: str | Platform | pb.Platform | None = None, assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -4100,7 +4018,7 @@ def __new__( assigned_object_rir: str | RIR | pb.RIR | None = None, assigned_object_rack: str | Rack | pb.Rack | None = None, assigned_object_rack_reservation: ( - str | RackReservation | pb.RackReservation | None + RackReservation | pb.RackReservation | None ) = None, assigned_object_rack_role: str | RackRole | pb.RackRole | None = None, assigned_object_rack_type: str | RackType | pb.RackType | None = None, @@ -4117,17 +4035,15 @@ def __new__( assigned_object_tunnel: str | Tunnel | pb.Tunnel | None = None, assigned_object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, assigned_object_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None + TunnelTermination | pb.TunnelTermination | None ) = None, - assigned_object_vlan: str | VLAN | pb.VLAN | None = None, assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, assigned_object_vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, assigned_object_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, - assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, assigned_object_vrf: str | VRF | pb.VRF | None = None, assigned_object_virtual_chassis: ( str | VirtualChassis | pb.VirtualChassis | None @@ -4136,7 +4052,7 @@ def __new__( str | VirtualCircuit | pb.VirtualCircuit | None ) = None, assigned_object_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, assigned_object_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -4152,18 +4068,23 @@ def __new__( assigned_object_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - assigned_object_wireless_link: ( - str | WirelessLink | pb.WirelessLink | None - ) = None, - kind: str | None = None, - comments: str | None = None, + assigned_object_wireless_link: WirelessLink | pb.WirelessLink | None = None, + assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, + assigned_object_owner: str | Owner | pb.Owner | None = None, + assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.JournalEntry: - """Create a new JournalEntry.""" + ) -> pb.L2VPNTermination: + """Create a new L2VPNTermination.""" + l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) + assigned_object_interface = convert_to_protobuf( + assigned_object_interface, pb.Interface + ) + assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface + ) assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) assigned_object_asn_range = convert_to_protobuf( assigned_object_asn_range, pb.ASNRange @@ -4175,6 +4096,9 @@ def __new__( assigned_object_cable_path = convert_to_protobuf( assigned_object_cable_path, pb.CablePath ) + assigned_object_cable_termination = convert_to_protobuf( + assigned_object_cable_termination, pb.CableTermination + ) assigned_object_circuit = convert_to_protobuf( assigned_object_circuit, pb.Circuit ) @@ -4223,9 +4147,6 @@ def __new__( assigned_object_custom_field_choice_set = convert_to_protobuf( assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet ) - assigned_object_custom_link = convert_to_protobuf( - assigned_object_custom_link, pb.CustomLink - ) assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) assigned_object_device_bay = convert_to_protobuf( assigned_object_device_bay, pb.DeviceBay @@ -4266,9 +4187,6 @@ def __new__( assigned_object_ip_sec_proposal = convert_to_protobuf( assigned_object_ip_sec_proposal, pb.IPSecProposal ) - assigned_object_interface = convert_to_protobuf( - assigned_object_interface, pb.Interface - ) assigned_object_inventory_item = convert_to_protobuf( assigned_object_inventory_item, pb.InventoryItem ) @@ -4301,10 +4219,6 @@ def __new__( assigned_object_module_type_profile = convert_to_protobuf( assigned_object_module_type_profile, pb.ModuleTypeProfile ) - assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) - assigned_object_owner_group = convert_to_protobuf( - assigned_object_owner_group, pb.OwnerGroup - ) assigned_object_platform = convert_to_protobuf( assigned_object_platform, pb.Platform ) @@ -4368,7 +4282,6 @@ def __new__( assigned_object_tunnel_termination = convert_to_protobuf( assigned_object_tunnel_termination, pb.TunnelTermination ) - assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) assigned_object_vlan_group = convert_to_protobuf( assigned_object_vlan_group, pb.VLANGroup ) @@ -4378,9 +4291,6 @@ def __new__( assigned_object_vlan_translation_rule = convert_to_protobuf( assigned_object_vlan_translation_rule, pb.VLANTranslationRule ) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface - ) assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) assigned_object_virtual_chassis = convert_to_protobuf( assigned_object_virtual_chassis, pb.VirtualChassis @@ -4412,10 +4322,21 @@ def __new__( assigned_object_wireless_link = convert_to_protobuf( assigned_object_wireless_link, pb.WirelessLink ) + assigned_object_custom_link = convert_to_protobuf( + assigned_object_custom_link, pb.CustomLink + ) + assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) + assigned_object_owner_group = convert_to_protobuf( + assigned_object_owner_group, pb.OwnerGroup + ) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.JournalEntry( + result = pb.L2VPNTermination( + l2vpn=l2vpn, + assigned_object_interface=assigned_object_interface, + assigned_object_vlan=assigned_object_vlan, + assigned_object_vm_interface=assigned_object_vm_interface, assigned_object_asn=assigned_object_asn, assigned_object_asn_range=assigned_object_asn_range, assigned_object_aggregate=assigned_object_aggregate, @@ -4438,7 +4359,6 @@ def __new__( assigned_object_contact_role=assigned_object_contact_role, assigned_object_custom_field=assigned_object_custom_field, assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, - assigned_object_custom_link=assigned_object_custom_link, assigned_object_device=assigned_object_device, assigned_object_device_bay=assigned_object_device_bay, assigned_object_device_role=assigned_object_device_role, @@ -4453,7 +4373,6 @@ def __new__( assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, - assigned_object_interface=assigned_object_interface, assigned_object_inventory_item=assigned_object_inventory_item, assigned_object_inventory_item_role=assigned_object_inventory_item_role, assigned_object_journal_entry=assigned_object_journal_entry, @@ -4466,8 +4385,6 @@ def __new__( assigned_object_module_bay=assigned_object_module_bay, assigned_object_module_type=assigned_object_module_type, assigned_object_module_type_profile=assigned_object_module_type_profile, - assigned_object_owner=assigned_object_owner, - assigned_object_owner_group=assigned_object_owner_group, assigned_object_platform=assigned_object_platform, assigned_object_power_feed=assigned_object_power_feed, assigned_object_power_outlet=assigned_object_power_outlet, @@ -4495,11 +4412,9 @@ def __new__( assigned_object_tunnel=assigned_object_tunnel, assigned_object_tunnel_group=assigned_object_tunnel_group, assigned_object_tunnel_termination=assigned_object_tunnel_termination, - assigned_object_vlan=assigned_object_vlan, assigned_object_vlan_group=assigned_object_vlan_group, assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, - assigned_object_vm_interface=assigned_object_vm_interface, assigned_object_vrf=assigned_object_vrf, assigned_object_virtual_chassis=assigned_object_virtual_chassis, assigned_object_virtual_circuit=assigned_object_virtual_circuit, @@ -4511,8 +4426,9 @@ def __new__( assigned_object_wireless_lan=assigned_object_wireless_lan, assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, assigned_object_wireless_link=assigned_object_wireless_link, - kind=kind, - comments=comments, + assigned_object_custom_link=assigned_object_custom_link, + assigned_object_owner=assigned_object_owner, + assigned_object_owner_group=assigned_object_owner_group, tags=tags, custom_fields=custom_fields, metadata=metadata, @@ -4520,702 +4436,119 @@ def __new__( return result -class L2VPN: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPN.""" +class Location: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Location.""" def __new__( cls, - identifier: int | None = None, name: str | None = None, slug: str | None = None, - type: str | None = None, + site: str | Site | pb.Site | None = None, + parent: str | Location | pb.Location | None = None, status: str | None = None, - import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, + facility: str | None = None, + description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + comments: str | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.L2VPN: - """Create a new L2VPN.""" - import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) - export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) - owner = convert_to_protobuf(owner, pb.Owner) + owner: str | Owner | pb.Owner | None = None, + ) -> pb.Location: + """Create a new Location.""" + site = convert_to_protobuf(site, pb.Site) + parent = convert_to_protobuf(parent, pb.Location) tenant = convert_to_protobuf(tenant, pb.Tenant) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.L2VPN( - identifier=identifier, + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.Location( name=name, slug=slug, - type=type, + site=site, + parent=parent, status=status, - import_targets=import_targets, - export_targets=export_targets, - description=description, - owner=owner, - comments=comments, tenant=tenant, + facility=facility, + description=description, tags=tags, custom_fields=custom_fields, + comments=comments, metadata=metadata, + owner=owner, ) return result -class L2VPNTermination: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.L2VPNTermination.""" +class MACAddress: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.MACAddress.""" def __new__( cls, - l2vpn: str | L2VPN | pb.L2VPN | None = None, - assigned_object_asn: str | ASN | pb.ASN | None = None, - assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, - assigned_object_aggregate: str | Aggregate | pb.Aggregate | None = None, - assigned_object_cable: str | Cable | pb.Cable | None = None, - assigned_object_cable_path: str | CablePath | pb.CablePath | None = None, - assigned_object_cable_termination: ( - str | CableTermination | pb.CableTermination | None - ) = None, - assigned_object_circuit: str | Circuit | pb.Circuit | None = None, - assigned_object_circuit_group: ( - str | CircuitGroup | pb.CircuitGroup | None - ) = None, - assigned_object_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None - ) = None, - assigned_object_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None - ) = None, - assigned_object_circuit_type: str | CircuitType | pb.CircuitType | None = None, - assigned_object_cluster: str | Cluster | pb.Cluster | None = None, - assigned_object_cluster_group: ( - str | ClusterGroup | pb.ClusterGroup | None - ) = None, - assigned_object_cluster_type: str | ClusterType | pb.ClusterType | None = None, - assigned_object_console_port: str | ConsolePort | pb.ConsolePort | None = None, - assigned_object_console_server_port: ( - str | ConsoleServerPort | pb.ConsoleServerPort | None - ) = None, - assigned_object_contact: str | Contact | pb.Contact | None = None, - assigned_object_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None - ) = None, - assigned_object_contact_group: ( - str | ContactGroup | pb.ContactGroup | None - ) = None, - assigned_object_contact_role: str | ContactRole | pb.ContactRole | None = None, - assigned_object_custom_field: str | CustomField | pb.CustomField | None = None, - assigned_object_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, - assigned_object_device: str | Device | pb.Device | None = None, - assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, - assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, - assigned_object_device_type: str | DeviceType | pb.DeviceType | None = None, - assigned_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, - assigned_object_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None - ) = None, - assigned_object_front_port: str | FrontPort | pb.FrontPort | None = None, - assigned_object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, - assigned_object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, - assigned_object_ip_address: str | IPAddress | pb.IPAddress | None = None, - assigned_object_ip_range: str | IPRange | pb.IPRange | None = None, - assigned_object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, - assigned_object_ip_sec_profile: ( - str | IPSecProfile | pb.IPSecProfile | None - ) = None, - assigned_object_ip_sec_proposal: ( - str | IPSecProposal | pb.IPSecProposal | None - ) = None, + mac_address: str | None = None, assigned_object_interface: str | Interface | pb.Interface | None = None, - assigned_object_inventory_item: ( - str | InventoryItem | pb.InventoryItem | None - ) = None, - assigned_object_inventory_item_role: ( - str | InventoryItemRole | pb.InventoryItemRole | None - ) = None, - assigned_object_journal_entry: ( - str | JournalEntry | pb.JournalEntry | None - ) = None, - assigned_object_l2vpn: str | L2VPN | pb.L2VPN | None = None, - assigned_object_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None - ) = None, - assigned_object_location: str | Location | pb.Location | None = None, - assigned_object_mac_address: str | MACAddress | pb.MACAddress | None = None, - assigned_object_manufacturer: ( - str | Manufacturer | pb.Manufacturer | None - ) = None, - assigned_object_module: str | Module | pb.Module | None = None, - assigned_object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, - assigned_object_module_type: str | ModuleType | pb.ModuleType | None = None, - assigned_object_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - assigned_object_owner: str | Owner | pb.Owner | None = None, - assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, - assigned_object_platform: str | Platform | pb.Platform | None = None, - assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, - assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, - assigned_object_power_panel: str | PowerPanel | pb.PowerPanel | None = None, - assigned_object_power_port: str | PowerPort | pb.PowerPort | None = None, - assigned_object_prefix: str | Prefix | pb.Prefix | None = None, - assigned_object_provider: str | Provider | pb.Provider | None = None, - assigned_object_provider_account: ( - str | ProviderAccount | pb.ProviderAccount | None - ) = None, - assigned_object_provider_network: ( - str | ProviderNetwork | pb.ProviderNetwork | None - ) = None, - assigned_object_rir: str | RIR | pb.RIR | None = None, - assigned_object_rack: str | Rack | pb.Rack | None = None, - assigned_object_rack_reservation: ( - str | RackReservation | pb.RackReservation | None - ) = None, - assigned_object_rack_role: str | RackRole | pb.RackRole | None = None, - assigned_object_rack_type: str | RackType | pb.RackType | None = None, - assigned_object_rear_port: str | RearPort | pb.RearPort | None = None, - assigned_object_region: str | Region | pb.Region | None = None, - assigned_object_role: str | Role | pb.Role | None = None, - assigned_object_route_target: str | RouteTarget | pb.RouteTarget | None = None, - assigned_object_service: str | Service | pb.Service | None = None, - assigned_object_site: str | Site | pb.Site | None = None, - assigned_object_site_group: str | SiteGroup | pb.SiteGroup | None = None, - assigned_object_tag: str | Tag | pb.Tag | None = None, - assigned_object_tenant: str | Tenant | pb.Tenant | None = None, - assigned_object_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, - assigned_object_tunnel: str | Tunnel | pb.Tunnel | None = None, - assigned_object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, - assigned_object_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None - ) = None, - assigned_object_vlan: str | VLAN | pb.VLAN | None = None, - assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, - assigned_object_vlan_translation_policy: ( - str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None - ) = None, - assigned_object_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None - ) = None, assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, - assigned_object_vrf: str | VRF | pb.VRF | None = None, - assigned_object_virtual_chassis: ( - str | VirtualChassis | pb.VirtualChassis | None - ) = None, - assigned_object_virtual_circuit: ( - str | VirtualCircuit | pb.VirtualCircuit | None - ) = None, - assigned_object_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None - ) = None, - assigned_object_virtual_circuit_type: ( - str | VirtualCircuitType | pb.VirtualCircuitType | None - ) = None, - assigned_object_virtual_device_context: ( - str | VirtualDeviceContext | pb.VirtualDeviceContext | None - ) = None, - assigned_object_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, - assigned_object_virtual_machine: ( - str | VirtualMachine | pb.VirtualMachine | None - ) = None, - assigned_object_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, - assigned_object_wireless_lan_group: ( - str | WirelessLANGroup | pb.WirelessLANGroup | None - ) = None, - assigned_object_wireless_link: ( - str | WirelessLink | pb.WirelessLink | None - ) = None, + description: str | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.L2VPNTermination: - """Create a new L2VPNTermination.""" - l2vpn = convert_to_protobuf(l2vpn, pb.L2VPN) - assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) - assigned_object_asn_range = convert_to_protobuf( - assigned_object_asn_range, pb.ASNRange - ) - assigned_object_aggregate = convert_to_protobuf( - assigned_object_aggregate, pb.Aggregate - ) - assigned_object_cable = convert_to_protobuf(assigned_object_cable, pb.Cable) - assigned_object_cable_path = convert_to_protobuf( - assigned_object_cable_path, pb.CablePath - ) - assigned_object_circuit = convert_to_protobuf( - assigned_object_circuit, pb.Circuit - ) - assigned_object_circuit_group = convert_to_protobuf( - assigned_object_circuit_group, pb.CircuitGroup - ) - assigned_object_circuit_group_assignment = convert_to_protobuf( - assigned_object_circuit_group_assignment, pb.CircuitGroupAssignment - ) - assigned_object_circuit_termination = convert_to_protobuf( - assigned_object_circuit_termination, pb.CircuitTermination - ) - assigned_object_circuit_type = convert_to_protobuf( - assigned_object_circuit_type, pb.CircuitType - ) - assigned_object_cluster = convert_to_protobuf( - assigned_object_cluster, pb.Cluster - ) - assigned_object_cluster_group = convert_to_protobuf( - assigned_object_cluster_group, pb.ClusterGroup - ) - assigned_object_cluster_type = convert_to_protobuf( - assigned_object_cluster_type, pb.ClusterType - ) - assigned_object_console_port = convert_to_protobuf( - assigned_object_console_port, pb.ConsolePort - ) - assigned_object_console_server_port = convert_to_protobuf( - assigned_object_console_server_port, pb.ConsoleServerPort - ) - assigned_object_contact = convert_to_protobuf( - assigned_object_contact, pb.Contact - ) - assigned_object_contact_assignment = convert_to_protobuf( - assigned_object_contact_assignment, pb.ContactAssignment - ) - assigned_object_contact_group = convert_to_protobuf( - assigned_object_contact_group, pb.ContactGroup - ) - assigned_object_contact_role = convert_to_protobuf( - assigned_object_contact_role, pb.ContactRole - ) - assigned_object_custom_field = convert_to_protobuf( - assigned_object_custom_field, pb.CustomField - ) - assigned_object_custom_field_choice_set = convert_to_protobuf( - assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - assigned_object_custom_link = convert_to_protobuf( - assigned_object_custom_link, pb.CustomLink - ) - assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) - assigned_object_device_bay = convert_to_protobuf( - assigned_object_device_bay, pb.DeviceBay - ) - assigned_object_device_role = convert_to_protobuf( - assigned_object_device_role, pb.DeviceRole - ) - assigned_object_device_type = convert_to_protobuf( - assigned_object_device_type, pb.DeviceType - ) - assigned_object_fhrp_group = convert_to_protobuf( - assigned_object_fhrp_group, pb.FHRPGroup - ) - assigned_object_fhrp_group_assignment = convert_to_protobuf( - assigned_object_fhrp_group_assignment, pb.FHRPGroupAssignment - ) - assigned_object_front_port = convert_to_protobuf( - assigned_object_front_port, pb.FrontPort - ) - assigned_object_ike_policy = convert_to_protobuf( - assigned_object_ike_policy, pb.IKEPolicy - ) - assigned_object_ike_proposal = convert_to_protobuf( - assigned_object_ike_proposal, pb.IKEProposal - ) - assigned_object_ip_address = convert_to_protobuf( - assigned_object_ip_address, pb.IPAddress - ) - assigned_object_ip_range = convert_to_protobuf( - assigned_object_ip_range, pb.IPRange - ) - assigned_object_ip_sec_policy = convert_to_protobuf( - assigned_object_ip_sec_policy, pb.IPSecPolicy - ) - assigned_object_ip_sec_profile = convert_to_protobuf( - assigned_object_ip_sec_profile, pb.IPSecProfile - ) - assigned_object_ip_sec_proposal = convert_to_protobuf( - assigned_object_ip_sec_proposal, pb.IPSecProposal - ) + owner: str | Owner | pb.Owner | None = None, + ) -> pb.MACAddress: + """Create a new MACAddress.""" assigned_object_interface = convert_to_protobuf( assigned_object_interface, pb.Interface ) - assigned_object_inventory_item = convert_to_protobuf( - assigned_object_inventory_item, pb.InventoryItem - ) - assigned_object_inventory_item_role = convert_to_protobuf( - assigned_object_inventory_item_role, pb.InventoryItemRole + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface ) - assigned_object_journal_entry = convert_to_protobuf( - assigned_object_journal_entry, pb.JournalEntry - ) - assigned_object_l2vpn = convert_to_protobuf(assigned_object_l2vpn, pb.L2VPN) - assigned_object_l2vpn_termination = convert_to_protobuf( - assigned_object_l2vpn_termination, pb.L2VPNTermination - ) - assigned_object_location = convert_to_protobuf( - assigned_object_location, pb.Location - ) - assigned_object_mac_address = convert_to_protobuf( - assigned_object_mac_address, pb.MACAddress - ) - assigned_object_manufacturer = convert_to_protobuf( - assigned_object_manufacturer, pb.Manufacturer - ) - assigned_object_module = convert_to_protobuf(assigned_object_module, pb.Module) - assigned_object_module_bay = convert_to_protobuf( - assigned_object_module_bay, pb.ModuleBay - ) - assigned_object_module_type = convert_to_protobuf( - assigned_object_module_type, pb.ModuleType - ) - assigned_object_module_type_profile = convert_to_protobuf( - assigned_object_module_type_profile, pb.ModuleTypeProfile - ) - assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) - assigned_object_owner_group = convert_to_protobuf( - assigned_object_owner_group, pb.OwnerGroup - ) - assigned_object_platform = convert_to_protobuf( - assigned_object_platform, pb.Platform - ) - assigned_object_power_feed = convert_to_protobuf( - assigned_object_power_feed, pb.PowerFeed - ) - assigned_object_power_outlet = convert_to_protobuf( - assigned_object_power_outlet, pb.PowerOutlet - ) - assigned_object_power_panel = convert_to_protobuf( - assigned_object_power_panel, pb.PowerPanel - ) - assigned_object_power_port = convert_to_protobuf( - assigned_object_power_port, pb.PowerPort - ) - assigned_object_prefix = convert_to_protobuf(assigned_object_prefix, pb.Prefix) - assigned_object_provider = convert_to_protobuf( - assigned_object_provider, pb.Provider - ) - assigned_object_provider_account = convert_to_protobuf( - assigned_object_provider_account, pb.ProviderAccount - ) - assigned_object_provider_network = convert_to_protobuf( - assigned_object_provider_network, pb.ProviderNetwork - ) - assigned_object_rir = convert_to_protobuf(assigned_object_rir, pb.RIR) - assigned_object_rack = convert_to_protobuf(assigned_object_rack, pb.Rack) - assigned_object_rack_reservation = convert_to_protobuf( - assigned_object_rack_reservation, pb.RackReservation - ) - assigned_object_rack_role = convert_to_protobuf( - assigned_object_rack_role, pb.RackRole - ) - assigned_object_rack_type = convert_to_protobuf( - assigned_object_rack_type, pb.RackType - ) - assigned_object_rear_port = convert_to_protobuf( - assigned_object_rear_port, pb.RearPort - ) - assigned_object_region = convert_to_protobuf(assigned_object_region, pb.Region) - assigned_object_role = convert_to_protobuf(assigned_object_role, pb.Role) - assigned_object_route_target = convert_to_protobuf( - assigned_object_route_target, pb.RouteTarget - ) - assigned_object_service = convert_to_protobuf( - assigned_object_service, pb.Service - ) - assigned_object_site = convert_to_protobuf(assigned_object_site, pb.Site) - assigned_object_site_group = convert_to_protobuf( - assigned_object_site_group, pb.SiteGroup - ) - assigned_object_tag = convert_to_protobuf(assigned_object_tag, pb.Tag) - assigned_object_tenant = convert_to_protobuf(assigned_object_tenant, pb.Tenant) - assigned_object_tenant_group = convert_to_protobuf( - assigned_object_tenant_group, pb.TenantGroup - ) - assigned_object_tunnel = convert_to_protobuf(assigned_object_tunnel, pb.Tunnel) - assigned_object_tunnel_group = convert_to_protobuf( - assigned_object_tunnel_group, pb.TunnelGroup - ) - assigned_object_tunnel_termination = convert_to_protobuf( - assigned_object_tunnel_termination, pb.TunnelTermination - ) - assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) - assigned_object_vlan_group = convert_to_protobuf( - assigned_object_vlan_group, pb.VLANGroup - ) - assigned_object_vlan_translation_policy = convert_to_protobuf( - assigned_object_vlan_translation_policy, pb.VLANTranslationPolicy - ) - assigned_object_vlan_translation_rule = convert_to_protobuf( - assigned_object_vlan_translation_rule, pb.VLANTranslationRule - ) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface - ) - assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) - assigned_object_virtual_chassis = convert_to_protobuf( - assigned_object_virtual_chassis, pb.VirtualChassis - ) - assigned_object_virtual_circuit = convert_to_protobuf( - assigned_object_virtual_circuit, pb.VirtualCircuit - ) - assigned_object_virtual_circuit_termination = convert_to_protobuf( - assigned_object_virtual_circuit_termination, pb.VirtualCircuitTermination - ) - assigned_object_virtual_circuit_type = convert_to_protobuf( - assigned_object_virtual_circuit_type, pb.VirtualCircuitType - ) - assigned_object_virtual_device_context = convert_to_protobuf( - assigned_object_virtual_device_context, pb.VirtualDeviceContext - ) - assigned_object_virtual_disk = convert_to_protobuf( - assigned_object_virtual_disk, pb.VirtualDisk - ) - assigned_object_virtual_machine = convert_to_protobuf( - assigned_object_virtual_machine, pb.VirtualMachine - ) - assigned_object_wireless_lan = convert_to_protobuf( - assigned_object_wireless_lan, pb.WirelessLAN - ) - assigned_object_wireless_lan_group = convert_to_protobuf( - assigned_object_wireless_lan_group, pb.WirelessLANGroup - ) - assigned_object_wireless_link = convert_to_protobuf( - assigned_object_wireless_link, pb.WirelessLink - ) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - result = pb.L2VPNTermination( - l2vpn=l2vpn, - assigned_object_asn=assigned_object_asn, - assigned_object_asn_range=assigned_object_asn_range, - assigned_object_aggregate=assigned_object_aggregate, - assigned_object_cable=assigned_object_cable, - assigned_object_cable_path=assigned_object_cable_path, - assigned_object_cable_termination=assigned_object_cable_termination, - assigned_object_circuit=assigned_object_circuit, - assigned_object_circuit_group=assigned_object_circuit_group, - assigned_object_circuit_group_assignment=assigned_object_circuit_group_assignment, - assigned_object_circuit_termination=assigned_object_circuit_termination, - assigned_object_circuit_type=assigned_object_circuit_type, - assigned_object_cluster=assigned_object_cluster, - assigned_object_cluster_group=assigned_object_cluster_group, - assigned_object_cluster_type=assigned_object_cluster_type, - assigned_object_console_port=assigned_object_console_port, - assigned_object_console_server_port=assigned_object_console_server_port, - assigned_object_contact=assigned_object_contact, - assigned_object_contact_assignment=assigned_object_contact_assignment, - assigned_object_contact_group=assigned_object_contact_group, - assigned_object_contact_role=assigned_object_contact_role, - assigned_object_custom_field=assigned_object_custom_field, - assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, - assigned_object_custom_link=assigned_object_custom_link, - assigned_object_device=assigned_object_device, - assigned_object_device_bay=assigned_object_device_bay, - assigned_object_device_role=assigned_object_device_role, - assigned_object_device_type=assigned_object_device_type, - assigned_object_fhrp_group=assigned_object_fhrp_group, - assigned_object_fhrp_group_assignment=assigned_object_fhrp_group_assignment, - assigned_object_front_port=assigned_object_front_port, - assigned_object_ike_policy=assigned_object_ike_policy, - assigned_object_ike_proposal=assigned_object_ike_proposal, - assigned_object_ip_address=assigned_object_ip_address, - assigned_object_ip_range=assigned_object_ip_range, - assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, - assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, - assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, - assigned_object_interface=assigned_object_interface, - assigned_object_inventory_item=assigned_object_inventory_item, - assigned_object_inventory_item_role=assigned_object_inventory_item_role, - assigned_object_journal_entry=assigned_object_journal_entry, - assigned_object_l2vpn=assigned_object_l2vpn, - assigned_object_l2vpn_termination=assigned_object_l2vpn_termination, - assigned_object_location=assigned_object_location, - assigned_object_mac_address=assigned_object_mac_address, - assigned_object_manufacturer=assigned_object_manufacturer, - assigned_object_module=assigned_object_module, - assigned_object_module_bay=assigned_object_module_bay, - assigned_object_module_type=assigned_object_module_type, - assigned_object_module_type_profile=assigned_object_module_type_profile, - assigned_object_owner=assigned_object_owner, - assigned_object_owner_group=assigned_object_owner_group, - assigned_object_platform=assigned_object_platform, - assigned_object_power_feed=assigned_object_power_feed, - assigned_object_power_outlet=assigned_object_power_outlet, - assigned_object_power_panel=assigned_object_power_panel, - assigned_object_power_port=assigned_object_power_port, - assigned_object_prefix=assigned_object_prefix, - assigned_object_provider=assigned_object_provider, - assigned_object_provider_account=assigned_object_provider_account, - assigned_object_provider_network=assigned_object_provider_network, - assigned_object_rir=assigned_object_rir, - assigned_object_rack=assigned_object_rack, - assigned_object_rack_reservation=assigned_object_rack_reservation, - assigned_object_rack_role=assigned_object_rack_role, - assigned_object_rack_type=assigned_object_rack_type, - assigned_object_rear_port=assigned_object_rear_port, - assigned_object_region=assigned_object_region, - assigned_object_role=assigned_object_role, - assigned_object_route_target=assigned_object_route_target, - assigned_object_service=assigned_object_service, - assigned_object_site=assigned_object_site, - assigned_object_site_group=assigned_object_site_group, - assigned_object_tag=assigned_object_tag, - assigned_object_tenant=assigned_object_tenant, - assigned_object_tenant_group=assigned_object_tenant_group, - assigned_object_tunnel=assigned_object_tunnel, - assigned_object_tunnel_group=assigned_object_tunnel_group, - assigned_object_tunnel_termination=assigned_object_tunnel_termination, - assigned_object_vlan=assigned_object_vlan, - assigned_object_vlan_group=assigned_object_vlan_group, - assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, - assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, - assigned_object_vm_interface=assigned_object_vm_interface, - assigned_object_vrf=assigned_object_vrf, - assigned_object_virtual_chassis=assigned_object_virtual_chassis, - assigned_object_virtual_circuit=assigned_object_virtual_circuit, - assigned_object_virtual_circuit_termination=assigned_object_virtual_circuit_termination, - assigned_object_virtual_circuit_type=assigned_object_virtual_circuit_type, - assigned_object_virtual_device_context=assigned_object_virtual_device_context, - assigned_object_virtual_disk=assigned_object_virtual_disk, - assigned_object_virtual_machine=assigned_object_virtual_machine, - assigned_object_wireless_lan=assigned_object_wireless_lan, - assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, - assigned_object_wireless_link=assigned_object_wireless_link, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.MACAddress( + mac_address=mac_address, + assigned_object_interface=assigned_object_interface, + assigned_object_vm_interface=assigned_object_vm_interface, + description=description, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + owner=owner, ) return result -class Location: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Location.""" +class Manufacturer: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Manufacturer.""" def __new__( cls, name: str | None = None, slug: str | None = None, - site: str | Site | pb.Site | None = None, - parent: str | Location | pb.Location | None = None, - status: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - facility: str | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - ) -> pb.Location: - """Create a new Location.""" - site = convert_to_protobuf(site, pb.Site) - parent = convert_to_protobuf(parent, pb.Location) - tenant = convert_to_protobuf(tenant, pb.Tenant) + ) -> pb.Manufacturer: + """Create a new Manufacturer.""" tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.Location( - name=name, - slug=slug, - site=site, - parent=parent, - status=status, - tenant=tenant, - facility=facility, - description=description, - tags=tags, - owner=owner, - comments=comments, - custom_fields=custom_fields, - metadata=metadata, - ) - return result - - -class MACAddress: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.MACAddress.""" - - def __new__( - cls, - mac_address: str | None = None, - assigned_object_interface: str | Interface | pb.Interface | None = None, - assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, - description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - ) -> pb.MACAddress: - """Create a new MACAddress.""" - assigned_object_interface = convert_to_protobuf( - assigned_object_interface, pb.Interface - ) - assigned_object_vm_interface = convert_to_protobuf( - assigned_object_vm_interface, pb.VMInterface - ) - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - result = pb.MACAddress( - mac_address=mac_address, - assigned_object_interface=assigned_object_interface, - assigned_object_vm_interface=assigned_object_vm_interface, - description=description, - owner=owner, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - ) - return result - - -class Manufacturer: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Manufacturer.""" - - def __new__( - cls, - name: str | None = None, - slug: str | None = None, - description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - ) -> pb.Manufacturer: - """Create a new Manufacturer.""" owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) result = pb.Manufacturer( name=name, slug=slug, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -5232,22 +4565,20 @@ def __new__( serial: str | None = None, asset_tag: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Module: """Create a new Module.""" device = convert_to_protobuf(device, pb.Device) module_bay = convert_to_protobuf(module_bay, pb.ModuleBay) module_type = convert_to_protobuf(module_type, pb.ModuleType) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Module( device=device, module_bay=module_bay, @@ -5256,11 +4587,11 @@ def __new__( serial=serial, asset_tag=asset_tag, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5271,27 +4602,25 @@ class ModuleBay: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, - installed_module: str | Module | pb.Module | None = None, + installed_module: Module | pb.Module | None = None, label: str | None = None, position: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ModuleBay: """Create a new ModuleBay.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) installed_module = convert_to_protobuf(installed_module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ModuleBay( device=device, module=module, @@ -5300,10 +4629,10 @@ def __new__( label=label, position=position, description=description, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5313,7 +4642,6 @@ class ModuleType: def __new__( cls, - profile: str | ModuleTypeProfile | pb.ModuleTypeProfile | None = None, manufacturer: str | Manufacturer | pb.Manufacturer | None = None, model: str | None = None, part_number: str | None = None, @@ -5321,24 +4649,22 @@ def __new__( weight: float | None = None, weight_unit: str | None = None, description: str | None = None, - attributes: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + profile: str | ModuleTypeProfile | pb.ModuleTypeProfile | None = None, + attributes: str | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ModuleType: """Create a new ModuleType.""" - profile = convert_to_protobuf(profile, pb.ModuleTypeProfile) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + profile = convert_to_protobuf(profile, pb.ModuleTypeProfile) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ModuleType( - profile=profile, manufacturer=manufacturer, model=model, part_number=part_number, @@ -5346,87 +4672,13 @@ def __new__( weight=weight, weight_unit=weight_unit, description=description, - attributes=attributes, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + profile=profile, + attributes=attributes, metadata=metadata, - ) - return result - - -class ModuleTypeProfile: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleTypeProfile.""" - - def __new__( - cls, - name: str | None = None, - description: str | None = None, - schema: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, - metadata: dict[str, Any] | None = None, - ) -> pb.ModuleTypeProfile: - """Create a new ModuleTypeProfile.""" - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - result = pb.ModuleTypeProfile( - name=name, - description=description, - schema=schema, owner=owner, - comments=comments, - tags=tags, - custom_fields=custom_fields, - metadata=metadata, - ) - return result - - -class Owner: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Owner.""" - - def __new__( - cls, - name: str | None = None, - group: str | OwnerGroup | pb.OwnerGroup | None = None, - description: str | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.Owner: - """Create a new Owner.""" - group = convert_to_protobuf(group, pb.OwnerGroup) - metadata = convert_dict_to_struct(metadata) - result = pb.Owner( - name=name, - group=group, - description=description, - metadata=metadata, - ) - return result - - -class OwnerGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.OwnerGroup.""" - - def __new__( - cls, - name: str | None = None, - description: str | None = None, - metadata: dict[str, Any] | None = None, - ) -> pb.OwnerGroup: - """Create a new OwnerGroup.""" - metadata = convert_dict_to_struct(metadata) - result = pb.OwnerGroup( - name=name, - description=description, - metadata=metadata, ) return result @@ -5436,37 +4688,35 @@ class Platform: def __new__( cls, - parent: str | Platform | pb.Platform | None = None, name: str | None = None, slug: str | None = None, manufacturer: str | Manufacturer | pb.Manufacturer | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + parent: str | Platform | pb.Platform | None = None, + comments: str | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Platform: """Create a new Platform.""" - parent = convert_to_protobuf(parent, pb.Platform) manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + parent = convert_to_protobuf(parent, pb.Platform) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Platform( - parent=parent, name=name, slug=slug, manufacturer=manufacturer, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, + parent=parent, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -5489,22 +4739,20 @@ def __new__( mark_connected: bool | None = None, description: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.PowerFeed: """Create a new PowerFeed.""" power_panel = convert_to_protobuf(power_panel, pb.PowerPanel) rack = convert_to_protobuf(rack, pb.Rack) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.PowerFeed( power_panel=power_panel, rack=rack, @@ -5519,11 +4767,11 @@ def __new__( mark_connected=mark_connected, description=description, tenant=tenant, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5534,47 +4782,45 @@ class PowerOutlet: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, - status: str | None = None, color: str | None = None, power_port: str | PowerPort | pb.PowerPort | None = None, feed_leg: str | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + status: str | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.PowerOutlet: """Create a new PowerOutlet.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) power_port = convert_to_protobuf(power_port, pb.PowerPort) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.PowerOutlet( device=device, module=module, name=name, label=label, type=type, - status=status, color=color, power_port=power_port, feed_leg=feed_leg, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, + status=status, metadata=metadata, + owner=owner, ) return result @@ -5588,31 +4834,29 @@ def __new__( location: str | Location | pb.Location | None = None, name: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.PowerPanel: """Create a new PowerPanel.""" site = convert_to_protobuf(site, pb.Site) location = convert_to_protobuf(location, pb.Location) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.PowerPanel( site=site, location=location, name=name, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5623,7 +4867,7 @@ class PowerPort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, @@ -5631,20 +4875,18 @@ def __new__( allocated_draw: int | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.PowerPort: """Create a new PowerPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.PowerPort( device=device, module=module, @@ -5655,10 +4897,10 @@ def __new__( allocated_draw=allocated_draw, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5681,13 +4923,11 @@ def __new__( is_pool: bool | None = None, mark_utilized: bool | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Prefix: """Create a new Prefix.""" vrf = convert_to_protobuf(vrf, pb.VRF) @@ -5698,10 +4938,10 @@ def __new__( tenant = convert_to_protobuf(tenant, pb.Tenant) vlan = convert_to_protobuf(vlan, pb.VLAN) role = convert_to_protobuf(role, pb.Role) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Prefix( prefix=prefix, vrf=vrf, @@ -5716,11 +4956,11 @@ def __new__( is_pool=is_pool, mark_utilized=mark_utilized, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5732,35 +4972,33 @@ def __new__( cls, name: str | None = None, slug: str | None = None, - accounts: list[str | ProviderAccount | pb.ProviderAccount] | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - asns: list[str | ASN | pb.ASN] | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + accounts: list[str | ProviderAccount | pb.ProviderAccount] | None = None, + asns: list[str | ASN | pb.ASN] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Provider: """Create a new Provider.""" - accounts = convert_to_protobuf_list(accounts, pb.ProviderAccount) - owner = convert_to_protobuf(owner, pb.Owner) - asns = convert_to_protobuf_list(asns, pb.ASN) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + accounts = convert_to_protobuf_list(accounts, pb.ProviderAccount) + asns = convert_to_protobuf_list(asns, pb.ASN) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Provider( name=name, slug=slug, - accounts=accounts, description=description, - owner=owner, comments=comments, - asns=asns, tags=tags, custom_fields=custom_fields, + accounts=accounts, + asns=asns, metadata=metadata, + owner=owner, ) return result @@ -5774,30 +5012,28 @@ def __new__( name: str | None = None, account: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ProviderAccount: """Create a new ProviderAccount.""" provider = convert_to_protobuf(provider, pb.Provider) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ProviderAccount( provider=provider, name=name, account=account, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5811,30 +5047,28 @@ def __new__( name: str | None = None, service_id: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.ProviderNetwork: """Create a new ProviderNetwork.""" provider = convert_to_protobuf(provider, pb.Provider) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.ProviderNetwork( provider=provider, name=name, service_id=service_id, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -5848,29 +5082,27 @@ def __new__( slug: str | None = None, is_private: bool | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.RIR: """Create a new RIR.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RIR( name=name, slug=slug, is_private=is_private, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -5899,19 +5131,17 @@ def __new__( weight_unit: str | None = None, desc_units: bool | None = None, outer_width: int | None = None, - outer_height: int | None = None, outer_depth: int | None = None, outer_unit: str | None = None, mounting_depth: int | None = None, airflow: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + outer_height: int | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Rack: """Create a new Rack.""" site = convert_to_protobuf(site, pb.Site) @@ -5919,10 +5149,10 @@ def __new__( tenant = convert_to_protobuf(tenant, pb.Tenant) role = convert_to_protobuf(role, pb.RackRole) rack_type = convert_to_protobuf(rack_type, pb.RackType) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Rack( name=name, facility_id=facility_id, @@ -5943,17 +5173,17 @@ def __new__( weight_unit=weight_unit, desc_units=desc_units, outer_width=outer_width, - outer_height=outer_height, outer_depth=outer_depth, outer_unit=outer_unit, mounting_depth=mounting_depth, airflow=airflow, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + outer_height=outer_height, metadata=metadata, + owner=owner, ) return result @@ -5965,35 +5195,33 @@ def __new__( cls, rack: str | Rack | pb.Rack | None = None, units: list[int] | None = None, - status: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + status: str | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.RackReservation: """Create a new RackReservation.""" rack = convert_to_protobuf(rack, pb.Rack) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RackReservation( rack=rack, units=units, - status=status, tenant=tenant, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + status=status, metadata=metadata, + owner=owner, ) return result @@ -6007,29 +5235,27 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.RackRole: """Create a new RackRole.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RackRole( name=name, slug=slug, color=color, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -6049,27 +5275,25 @@ def __new__( starting_unit: int | None = None, desc_units: bool | None = None, outer_width: int | None = None, - outer_height: int | None = None, outer_depth: int | None = None, outer_unit: str | None = None, weight: float | None = None, max_weight: int | None = None, weight_unit: str | None = None, mounting_depth: int | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + outer_height: int | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.RackType: """Create a new RackType.""" manufacturer = convert_to_protobuf(manufacturer, pb.Manufacturer) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RackType( manufacturer=manufacturer, model=model, @@ -6081,18 +5305,18 @@ def __new__( starting_unit=starting_unit, desc_units=desc_units, outer_width=outer_width, - outer_height=outer_height, outer_depth=outer_depth, outer_unit=outer_unit, weight=weight, max_weight=max_weight, weight_unit=weight_unit, mounting_depth=mounting_depth, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + outer_height=outer_height, metadata=metadata, + owner=owner, ) return result @@ -6103,7 +5327,7 @@ class RearPort: def __new__( cls, device: str | Device | pb.Device | None = None, - module: str | Module | pb.Module | None = None, + module: Module | pb.Module | None = None, name: str | None = None, label: str | None = None, type: str | None = None, @@ -6111,20 +5335,18 @@ def __new__( positions: int | None = None, description: str | None = None, mark_connected: bool | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.RearPort: """Create a new RearPort.""" device = convert_to_protobuf(device, pb.Device) module = convert_to_protobuf(module, pb.Module) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RearPort( device=device, module=module, @@ -6135,10 +5357,10 @@ def __new__( positions=positions, description=description, mark_connected=mark_connected, - owner=owner, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -6153,29 +5375,27 @@ def __new__( parent: str | Region | pb.Region | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Region: """Create a new Region.""" parent = convert_to_protobuf(parent, pb.Region) tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Region( name=name, slug=slug, parent=parent, description=description, tags=tags, - owner=owner, - comments=comments, custom_fields=custom_fields, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -6189,29 +5409,27 @@ def __new__( slug: str | None = None, weight: int | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.Role: """Create a new Role.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Role( name=name, slug=slug, weight=weight, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -6224,29 +5442,27 @@ def __new__( name: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.RouteTarget: """Create a new RouteTarget.""" tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.RouteTarget( name=name, tenant=tenant, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -6256,25 +5472,30 @@ class Service: def __new__( cls, - parent_object_device: str | Device | pb.Device | None = None, - parent_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, - parent_object_virtual_machine: ( - str | VirtualMachine | pb.VirtualMachine | None - ) = None, + device: str | Device | pb.Device | None = None, + virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, name: str | None = None, protocol: str | None = None, ports: list[int] | None = None, - ipaddresses: list[str | IPAddress | pb.IPAddress] | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + ipaddresses: list[str | IPAddress | pb.IPAddress] | None = None, + parent_object_device: str | Device | pb.Device | None = None, + parent_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, + parent_object_virtual_machine: ( + str | VirtualMachine | pb.VirtualMachine | None ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Service: """Create a new Service.""" + device = convert_to_protobuf(device, pb.Device) + virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + ipaddresses = convert_to_protobuf_list(ipaddresses, pb.IPAddress) parent_object_device = convert_to_protobuf(parent_object_device, pb.Device) parent_object_fhrp_group = convert_to_protobuf( parent_object_fhrp_group, pb.FHRPGroup @@ -6282,25 +5503,24 @@ def __new__( parent_object_virtual_machine = convert_to_protobuf( parent_object_virtual_machine, pb.VirtualMachine ) - ipaddresses = convert_to_protobuf_list(ipaddresses, pb.IPAddress) - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Service( - parent_object_device=parent_object_device, - parent_object_fhrp_group=parent_object_fhrp_group, - parent_object_virtual_machine=parent_object_virtual_machine, + device=device, + virtual_machine=virtual_machine, name=name, protocol=protocol, ports=ports, - ipaddresses=ipaddresses, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, + ipaddresses=ipaddresses, + parent_object_device=parent_object_device, + parent_object_fhrp_group=parent_object_fhrp_group, + parent_object_virtual_machine=parent_object_virtual_machine, metadata=metadata, + owner=owner, ) return result @@ -6323,24 +5543,22 @@ def __new__( shipping_address: str | None = None, latitude: float | None = None, longitude: float | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - asns: list[str | ASN | pb.ASN] | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + asns: list[str | ASN | pb.ASN] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Site: """Create a new Site.""" region = convert_to_protobuf(region, pb.Region) group = convert_to_protobuf(group, pb.SiteGroup) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) - asns = convert_to_protobuf_list(asns, pb.ASN) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + asns = convert_to_protobuf_list(asns, pb.ASN) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Site( name=name, slug=slug, @@ -6355,12 +5573,12 @@ def __new__( shipping_address=shipping_address, latitude=latitude, longitude=longitude, - owner=owner, comments=comments, - asns=asns, tags=tags, custom_fields=custom_fields, + asns=asns, metadata=metadata, + owner=owner, ) return result @@ -6375,29 +5593,27 @@ def __new__( parent: str | SiteGroup | pb.SiteGroup | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.SiteGroup: """Create a new SiteGroup.""" parent = convert_to_protobuf(parent, pb.SiteGroup) tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.SiteGroup( name=name, slug=slug, parent=parent, description=description, tags=tags, - owner=owner, - comments=comments, custom_fields=custom_fields, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -6438,30 +5654,28 @@ def __new__( slug: str | None = None, group: str | TenantGroup | pb.TenantGroup | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Tenant: """Create a new Tenant.""" group = convert_to_protobuf(group, pb.TenantGroup) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Tenant( name=name, slug=slug, group=group, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -6476,29 +5690,27 @@ def __new__( parent: str | TenantGroup | pb.TenantGroup | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.TenantGroup: """Create a new TenantGroup.""" parent = convert_to_protobuf(parent, pb.TenantGroup) tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.TenantGroup( name=name, slug=slug, parent=parent, description=description, tags=tags, - owner=owner, - comments=comments, custom_fields=custom_fields, + comments=comments, metadata=metadata, + owner=owner, ) return result @@ -6516,22 +5728,20 @@ def __new__( tenant: str | Tenant | pb.Tenant | None = None, tunnel_id: int | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.Tunnel: """Create a new Tunnel.""" group = convert_to_protobuf(group, pb.TunnelGroup) ipsec_profile = convert_to_protobuf(ipsec_profile, pb.IPSecProfile) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.Tunnel( name=name, status=status, @@ -6541,11 +5751,11 @@ def __new__( tenant=tenant, tunnel_id=tunnel_id, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -6558,28 +5768,26 @@ def __new__( name: str | None = None, slug: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.TunnelGroup: """Create a new TunnelGroup.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.TunnelGroup( name=name, slug=slug, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -6593,19 +5801,19 @@ def __new__( role: str | None = None, termination_asn: str | ASN | pb.ASN | None = None, termination_asn_range: str | ASNRange | pb.ASNRange | None = None, - termination_aggregate: str | Aggregate | pb.Aggregate | None = None, - termination_cable: str | Cable | pb.Cable | None = None, - termination_cable_path: str | CablePath | pb.CablePath | None = None, + termination_aggregate: Aggregate | pb.Aggregate | None = None, + termination_cable: Cable | pb.Cable | None = None, + termination_cable_path: CablePath | pb.CablePath | None = None, termination_cable_termination: ( - str | CableTermination | pb.CableTermination | None + CableTermination | pb.CableTermination | None ) = None, termination_circuit: str | Circuit | pb.Circuit | None = None, termination_circuit_group: str | CircuitGroup | pb.CircuitGroup | None = None, termination_circuit_group_assignment: ( - str | CircuitGroupAssignment | pb.CircuitGroupAssignment | None + CircuitGroupAssignment | pb.CircuitGroupAssignment | None ) = None, termination_circuit_termination: ( - str | CircuitTermination | pb.CircuitTermination | None + CircuitTermination | pb.CircuitTermination | None ) = None, termination_circuit_type: str | CircuitType | pb.CircuitType | None = None, termination_cluster: str | Cluster | pb.Cluster | None = None, @@ -6617,28 +5825,23 @@ def __new__( ) = None, termination_contact: str | Contact | pb.Contact | None = None, termination_contact_assignment: ( - str | ContactAssignment | pb.ContactAssignment | None + ContactAssignment | pb.ContactAssignment | None ) = None, termination_contact_group: str | ContactGroup | pb.ContactGroup | None = None, termination_contact_role: str | ContactRole | pb.ContactRole | None = None, - termination_custom_field: str | CustomField | pb.CustomField | None = None, - termination_custom_field_choice_set: ( - str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None - ) = None, - termination_custom_link: str | CustomLink | pb.CustomLink | None = None, termination_device: str | Device | pb.Device | None = None, termination_device_bay: str | DeviceBay | pb.DeviceBay | None = None, termination_device_role: str | DeviceRole | pb.DeviceRole | None = None, termination_device_type: str | DeviceType | pb.DeviceType | None = None, termination_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, termination_fhrp_group_assignment: ( - str | FHRPGroupAssignment | pb.FHRPGroupAssignment | None + FHRPGroupAssignment | pb.FHRPGroupAssignment | None ) = None, termination_front_port: str | FrontPort | pb.FrontPort | None = None, termination_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, termination_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, termination_ip_address: str | IPAddress | pb.IPAddress | None = None, - termination_ip_range: str | IPRange | pb.IPRange | None = None, + termination_ip_range: IPRange | pb.IPRange | None = None, termination_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, termination_ip_sec_profile: str | IPSecProfile | pb.IPSecProfile | None = None, termination_ip_sec_proposal: ( @@ -6651,22 +5854,16 @@ def __new__( termination_inventory_item_role: ( str | InventoryItemRole | pb.InventoryItemRole | None ) = None, - termination_journal_entry: str | JournalEntry | pb.JournalEntry | None = None, termination_l2vpn: str | L2VPN | pb.L2VPN | None = None, termination_l2vpn_termination: ( - str | L2VPNTermination | pb.L2VPNTermination | None + L2VPNTermination | pb.L2VPNTermination | None ) = None, termination_location: str | Location | pb.Location | None = None, termination_mac_address: str | MACAddress | pb.MACAddress | None = None, termination_manufacturer: str | Manufacturer | pb.Manufacturer | None = None, - termination_module: str | Module | pb.Module | None = None, + termination_module: Module | pb.Module | None = None, termination_module_bay: str | ModuleBay | pb.ModuleBay | None = None, termination_module_type: str | ModuleType | pb.ModuleType | None = None, - termination_module_type_profile: ( - str | ModuleTypeProfile | pb.ModuleTypeProfile | None - ) = None, - termination_owner: str | Owner | pb.Owner | None = None, - termination_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, termination_platform: str | Platform | pb.Platform | None = None, termination_power_feed: str | PowerFeed | pb.PowerFeed | None = None, termination_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, @@ -6683,7 +5880,7 @@ def __new__( termination_rir: str | RIR | pb.RIR | None = None, termination_rack: str | Rack | pb.Rack | None = None, termination_rack_reservation: ( - str | RackReservation | pb.RackReservation | None + RackReservation | pb.RackReservation | None ) = None, termination_rack_role: str | RackRole | pb.RackRole | None = None, termination_rack_type: str | RackType | pb.RackType | None = None, @@ -6700,7 +5897,7 @@ def __new__( termination_tunnel: str | Tunnel | pb.Tunnel | None = None, termination_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, termination_tunnel_termination: ( - str | TunnelTermination | pb.TunnelTermination | None + TunnelTermination | pb.TunnelTermination | None ) = None, termination_vlan: str | VLAN | pb.VLAN | None = None, termination_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, @@ -6708,7 +5905,7 @@ def __new__( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, termination_vlan_translation_rule: ( - str | VLANTranslationRule | pb.VLANTranslationRule | None + VLANTranslationRule | pb.VLANTranslationRule | None ) = None, termination_vm_interface: str | VMInterface | pb.VMInterface | None = None, termination_vrf: str | VRF | pb.VRF | None = None, @@ -6719,7 +5916,7 @@ def __new__( str | VirtualCircuit | pb.VirtualCircuit | None ) = None, termination_virtual_circuit_termination: ( - str | VirtualCircuitTermination | pb.VirtualCircuitTermination | None + VirtualCircuitTermination | pb.VirtualCircuitTermination | None ) = None, termination_virtual_circuit_type: ( str | VirtualCircuitType | pb.VirtualCircuitType | None @@ -6735,12 +5932,21 @@ def __new__( termination_wireless_lan_group: ( str | WirelessLANGroup | pb.WirelessLANGroup | None ) = None, - termination_wireless_link: str | WirelessLink | pb.WirelessLink | None = None, + termination_wireless_link: WirelessLink | pb.WirelessLink | None = None, + termination_custom_field: str | CustomField | pb.CustomField | None = None, + termination_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + termination_journal_entry: JournalEntry | pb.JournalEntry | None = None, + termination_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + termination_custom_link: str | CustomLink | pb.CustomLink | None = None, + termination_owner: str | Owner | pb.Owner | None = None, + termination_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, outside_ip: str | IPAddress | pb.IPAddress | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, ) -> pb.TunnelTermination: """Create a new TunnelTermination.""" @@ -6752,6 +5958,9 @@ def __new__( termination_cable_path = convert_to_protobuf( termination_cable_path, pb.CablePath ) + termination_cable_termination = convert_to_protobuf( + termination_cable_termination, pb.CableTermination + ) termination_circuit = convert_to_protobuf(termination_circuit, pb.Circuit) termination_circuit_group = convert_to_protobuf( termination_circuit_group, pb.CircuitGroup @@ -6788,15 +5997,6 @@ def __new__( termination_contact_role = convert_to_protobuf( termination_contact_role, pb.ContactRole ) - termination_custom_field = convert_to_protobuf( - termination_custom_field, pb.CustomField - ) - termination_custom_field_choice_set = convert_to_protobuf( - termination_custom_field_choice_set, pb.CustomFieldChoiceSet - ) - termination_custom_link = convert_to_protobuf( - termination_custom_link, pb.CustomLink - ) termination_device = convert_to_protobuf(termination_device, pb.Device) termination_device_bay = convert_to_protobuf( termination_device_bay, pb.DeviceBay @@ -6842,9 +6042,6 @@ def __new__( termination_inventory_item_role = convert_to_protobuf( termination_inventory_item_role, pb.InventoryItemRole ) - termination_journal_entry = convert_to_protobuf( - termination_journal_entry, pb.JournalEntry - ) termination_l2vpn = convert_to_protobuf(termination_l2vpn, pb.L2VPN) termination_l2vpn_termination = convert_to_protobuf( termination_l2vpn_termination, pb.L2VPNTermination @@ -6863,13 +6060,6 @@ def __new__( termination_module_type = convert_to_protobuf( termination_module_type, pb.ModuleType ) - termination_module_type_profile = convert_to_protobuf( - termination_module_type_profile, pb.ModuleTypeProfile - ) - termination_owner = convert_to_protobuf(termination_owner, pb.Owner) - termination_owner_group = convert_to_protobuf( - termination_owner_group, pb.OwnerGroup - ) termination_platform = convert_to_protobuf(termination_platform, pb.Platform) termination_power_feed = convert_to_protobuf( termination_power_feed, pb.PowerFeed @@ -6965,24 +6155,43 @@ def __new__( termination_wireless_link = convert_to_protobuf( termination_wireless_link, pb.WirelessLink ) - outside_ip = convert_to_protobuf(outside_ip, pb.IPAddress) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) - metadata = convert_dict_to_struct(metadata) - result = pb.TunnelTermination( - tunnel=tunnel, - role=role, - termination_asn=termination_asn, - termination_asn_range=termination_asn_range, - termination_aggregate=termination_aggregate, - termination_cable=termination_cable, - termination_cable_path=termination_cable_path, - termination_cable_termination=termination_cable_termination, - termination_circuit=termination_circuit, - termination_circuit_group=termination_circuit_group, - termination_circuit_group_assignment=termination_circuit_group_assignment, - termination_circuit_termination=termination_circuit_termination, - termination_circuit_type=termination_circuit_type, + termination_custom_field = convert_to_protobuf( + termination_custom_field, pb.CustomField + ) + termination_custom_field_choice_set = convert_to_protobuf( + termination_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + termination_journal_entry = convert_to_protobuf( + termination_journal_entry, pb.JournalEntry + ) + termination_module_type_profile = convert_to_protobuf( + termination_module_type_profile, pb.ModuleTypeProfile + ) + termination_custom_link = convert_to_protobuf( + termination_custom_link, pb.CustomLink + ) + termination_owner = convert_to_protobuf(termination_owner, pb.Owner) + termination_owner_group = convert_to_protobuf( + termination_owner_group, pb.OwnerGroup + ) + outside_ip = convert_to_protobuf(outside_ip, pb.IPAddress) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.TunnelTermination( + tunnel=tunnel, + role=role, + termination_asn=termination_asn, + termination_asn_range=termination_asn_range, + termination_aggregate=termination_aggregate, + termination_cable=termination_cable, + termination_cable_path=termination_cable_path, + termination_cable_termination=termination_cable_termination, + termination_circuit=termination_circuit, + termination_circuit_group=termination_circuit_group, + termination_circuit_group_assignment=termination_circuit_group_assignment, + termination_circuit_termination=termination_circuit_termination, + termination_circuit_type=termination_circuit_type, termination_cluster=termination_cluster, termination_cluster_group=termination_cluster_group, termination_cluster_type=termination_cluster_type, @@ -6992,9 +6201,6 @@ def __new__( termination_contact_assignment=termination_contact_assignment, termination_contact_group=termination_contact_group, termination_contact_role=termination_contact_role, - termination_custom_field=termination_custom_field, - termination_custom_field_choice_set=termination_custom_field_choice_set, - termination_custom_link=termination_custom_link, termination_device=termination_device, termination_device_bay=termination_device_bay, termination_device_role=termination_device_role, @@ -7012,7 +6218,6 @@ def __new__( termination_interface=termination_interface, termination_inventory_item=termination_inventory_item, termination_inventory_item_role=termination_inventory_item_role, - termination_journal_entry=termination_journal_entry, termination_l2vpn=termination_l2vpn, termination_l2vpn_termination=termination_l2vpn_termination, termination_location=termination_location, @@ -7021,9 +6226,6 @@ def __new__( termination_module=termination_module, termination_module_bay=termination_module_bay, termination_module_type=termination_module_type, - termination_module_type_profile=termination_module_type_profile, - termination_owner=termination_owner, - termination_owner_group=termination_owner_group, termination_platform=termination_platform, termination_power_feed=termination_power_feed, termination_power_outlet=termination_power_outlet, @@ -7067,6 +6269,13 @@ def __new__( termination_wireless_lan=termination_wireless_lan, termination_wireless_lan_group=termination_wireless_lan_group, termination_wireless_link=termination_wireless_link, + termination_custom_field=termination_custom_field, + termination_custom_field_choice_set=termination_custom_field_choice_set, + termination_journal_entry=termination_journal_entry, + termination_module_type_profile=termination_module_type_profile, + termination_custom_link=termination_custom_link, + termination_owner=termination_owner, + termination_owner_group=termination_owner_group, outside_ip=outside_ip, tags=tags, custom_fields=custom_fields, @@ -7090,13 +6299,11 @@ def __new__( description: str | None = None, qinq_role: str | None = None, qinq_svlan: str | VLAN | pb.VLAN | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VLAN: """Create a new VLAN.""" site = convert_to_protobuf(site, pb.Site) @@ -7104,10 +6311,10 @@ def __new__( tenant = convert_to_protobuf(tenant, pb.Tenant) role = convert_to_protobuf(role, pb.Role) qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VLAN( site=site, group=group, @@ -7119,11 +6326,11 @@ def __new__( description=description, qinq_role=qinq_role, qinq_svlan=qinq_svlan, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -7143,15 +6350,13 @@ def __new__( scope_site: str | Site | pb.Site | None = None, scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, vid_ranges: list[int] | None = None, - tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + tenant: str | Tenant | pb.Tenant | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.VLANGroup: """Create a new VLANGroup.""" scope_cluster = convert_to_protobuf(scope_cluster, pb.Cluster) @@ -7161,11 +6366,11 @@ def __new__( scope_region = convert_to_protobuf(scope_region, pb.Region) scope_site = convert_to_protobuf(scope_site, pb.Site) scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) - tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + tenant = convert_to_protobuf(tenant, pb.Tenant) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VLANGroup( name=name, slug=slug, @@ -7177,13 +6382,13 @@ def __new__( scope_site=scope_site, scope_site_group=scope_site_group, vid_ranges=vid_ranges, - tenant=tenant, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, + tenant=tenant, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -7195,19 +6400,19 @@ def __new__( cls, name: str | None = None, description: str | None = None, + metadata: dict[str, Any] | None = None, owner: str | Owner | pb.Owner | None = None, comments: str | None = None, - metadata: dict[str, Any] | None = None, ) -> pb.VLANTranslationPolicy: """Create a new VLANTranslationPolicy.""" - owner = convert_to_protobuf(owner, pb.Owner) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VLANTranslationPolicy( name=name, description=description, + metadata=metadata, owner=owner, comments=comments, - metadata=metadata, ) return result @@ -7251,18 +6456,16 @@ def __new__( description: str | None = None, mode: str | None = None, untagged_vlan: str | VLAN | pb.VLAN | None = None, - tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, qinq_svlan: str | VLAN | pb.VLAN | None = None, vlan_translation_policy: ( str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None ) = None, vrf: str | VRF | pb.VRF | None = None, - owner: str | Owner | pb.Owner | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + tagged_vlans: list[str | VLAN | pb.VLAN] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VMInterface: """Create a new VMInterface.""" virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) @@ -7270,16 +6473,16 @@ def __new__( bridge = convert_to_protobuf(bridge, pb.VMInterface) primary_mac_address = convert_to_protobuf(primary_mac_address, pb.MACAddress) untagged_vlan = convert_to_protobuf(untagged_vlan, pb.VLAN) - tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) qinq_svlan = convert_to_protobuf(qinq_svlan, pb.VLAN) vlan_translation_policy = convert_to_protobuf( vlan_translation_policy, pb.VLANTranslationPolicy ) vrf = convert_to_protobuf(vrf, pb.VRF) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + tagged_vlans = convert_to_protobuf_list(tagged_vlans, pb.VLAN) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VMInterface( virtual_machine=virtual_machine, name=name, @@ -7291,14 +6494,14 @@ def __new__( description=description, mode=mode, untagged_vlan=untagged_vlan, - tagged_vlans=tagged_vlans, qinq_svlan=qinq_svlan, vlan_translation_policy=vlan_translation_policy, vrf=vrf, - owner=owner, tags=tags, custom_fields=custom_fields, + tagged_vlans=tagged_vlans, metadata=metadata, + owner=owner, ) return result @@ -7313,37 +6516,35 @@ def __new__( tenant: str | Tenant | pb.Tenant | None = None, enforce_unique: bool | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, import_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, export_targets: list[str | RouteTarget | pb.RouteTarget] | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VRF: """Create a new VRF.""" tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) - import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) - export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + import_targets = convert_to_protobuf_list(import_targets, pb.RouteTarget) + export_targets = convert_to_protobuf_list(export_targets, pb.RouteTarget) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VRF( name=name, rd=rd, tenant=tenant, enforce_unique=enforce_unique, description=description, - owner=owner, comments=comments, - import_targets=import_targets, - export_targets=export_targets, tags=tags, custom_fields=custom_fields, + import_targets=import_targets, + export_targets=export_targets, metadata=metadata, + owner=owner, ) return result @@ -7357,30 +6558,28 @@ def __new__( domain: str | None = None, master: str | Device | pb.Device | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VirtualChassis: """Create a new VirtualChassis.""" master = convert_to_protobuf(master, pb.Device) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VirtualChassis( name=name, domain=domain, master=master, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -7397,23 +6596,21 @@ def __new__( status: str | None = None, tenant: str | Tenant | pb.Tenant | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VirtualCircuit: """Create a new VirtualCircuit.""" provider_network = convert_to_protobuf(provider_network, pb.ProviderNetwork) provider_account = convert_to_protobuf(provider_account, pb.ProviderAccount) type = convert_to_protobuf(type, pb.VirtualCircuitType) tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VirtualCircuit( cid=cid, provider_network=provider_network, @@ -7422,11 +6619,11 @@ def __new__( status=status, tenant=tenant, description=description, - owner=owner, comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result @@ -7441,9 +6638,7 @@ def __new__( interface: str | Interface | pb.Interface | None = None, description: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, ) -> pb.VirtualCircuitTermination: """Create a new VirtualCircuitTermination.""" @@ -7473,29 +6668,27 @@ def __new__( slug: str | None = None, color: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + comments: str | None = None, ) -> pb.VirtualCircuitType: """Create a new VirtualCircuitType.""" - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VirtualCircuitType( name=name, slug=slug, color=color, description=description, - owner=owner, - comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, + comments=comments, ) return result @@ -7513,23 +6706,21 @@ def __new__( primary_ip6: str | IPAddress | pb.IPAddress | None = None, status: str | None = None, description: str | None = None, - owner: str | Owner | pb.Owner | None = None, comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, ) -> pb.VirtualDeviceContext: """Create a new VirtualDeviceContext.""" device = convert_to_protobuf(device, pb.Device) tenant = convert_to_protobuf(tenant, pb.Tenant) primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) - owner = convert_to_protobuf(owner, pb.Owner) tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) result = pb.VirtualDeviceContext( name=name, device=device, @@ -7539,7 +6730,881 @@ def __new__( primary_ip6=primary_ip6, status=status, description=description, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + owner=owner, + ) + return result + + +class VirtualDisk: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDisk.""" + + def __new__( + cls, + virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, + name: str | None = None, + description: str | None = None, + size: int | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.VirtualDisk: + """Create a new VirtualDisk.""" + virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.VirtualDisk( + virtual_machine=virtual_machine, + name=name, + description=description, + size=size, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + owner=owner, + ) + return result + + +class VirtualMachine: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualMachine.""" + + def __new__( + cls, + name: str | None = None, + status: str | None = None, + site: str | Site | pb.Site | None = None, + cluster: str | Cluster | pb.Cluster | None = None, + device: str | Device | pb.Device | None = None, + serial: str | None = None, + role: str | DeviceRole | pb.DeviceRole | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + platform: str | Platform | pb.Platform | None = None, + primary_ip4: str | IPAddress | pb.IPAddress | None = None, + primary_ip6: str | IPAddress | pb.IPAddress | None = None, + vcpus: float | None = None, + memory: int | None = None, + disk: int | None = None, + description: str | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, + start_on_boot: str | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.VirtualMachine: + """Create a new VirtualMachine.""" + site = convert_to_protobuf(site, pb.Site) + cluster = convert_to_protobuf(cluster, pb.Cluster) + device = convert_to_protobuf(device, pb.Device) + role = convert_to_protobuf(role, pb.DeviceRole) + tenant = convert_to_protobuf(tenant, pb.Tenant) + platform = convert_to_protobuf(platform, pb.Platform) + primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) + primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + + # apply shortcuts + if platform is not None: + if device is not None and not device.HasField("platform"): + device.platform.CopyFrom(platform) + if site is not None: + if device is not None and not device.HasField("site"): + device.site.CopyFrom(site) + if cluster is not None and not cluster.HasField("scope_site"): + cluster.scope_site.CopyFrom(site) + if role is not None: + if device is not None and not device.HasField("role"): + device.role.CopyFrom(role) + result = pb.VirtualMachine( + name=name, + status=status, + site=site, + cluster=cluster, + device=device, + serial=serial, + role=role, + tenant=tenant, + platform=platform, + primary_ip4=primary_ip4, + primary_ip6=primary_ip6, + vcpus=vcpus, + memory=memory, + disk=disk, + description=description, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + start_on_boot=start_on_boot, owner=owner, + ) + return result + + +class WirelessLAN: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLAN.""" + + def __new__( + cls, + ssid: str | None = None, + description: str | None = None, + group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, + status: str | None = None, + vlan: str | VLAN | pb.VLAN | None = None, + scope_location: str | Location | pb.Location | None = None, + scope_region: str | Region | pb.Region | None = None, + scope_site: str | Site | pb.Site | None = None, + scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + auth_type: str | None = None, + auth_cipher: str | None = None, + auth_psk: str | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.WirelessLAN: + """Create a new WirelessLAN.""" + group = convert_to_protobuf(group, pb.WirelessLANGroup) + vlan = convert_to_protobuf(vlan, pb.VLAN) + scope_location = convert_to_protobuf(scope_location, pb.Location) + scope_region = convert_to_protobuf(scope_region, pb.Region) + scope_site = convert_to_protobuf(scope_site, pb.Site) + scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) + tenant = convert_to_protobuf(tenant, pb.Tenant) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.WirelessLAN( + ssid=ssid, + description=description, + group=group, + status=status, + vlan=vlan, + scope_location=scope_location, + scope_region=scope_region, + scope_site=scope_site, + scope_site_group=scope_site_group, + tenant=tenant, + auth_type=auth_type, + auth_cipher=auth_cipher, + auth_psk=auth_psk, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + owner=owner, + ) + return result + + +class WirelessLANGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLANGroup.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + parent: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, + description: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + comments: str | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.WirelessLANGroup: + """Create a new WirelessLANGroup.""" + parent = convert_to_protobuf(parent, pb.WirelessLANGroup) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.WirelessLANGroup( + name=name, + slug=slug, + parent=parent, + description=description, + tags=tags, + custom_fields=custom_fields, + comments=comments, + metadata=metadata, + owner=owner, + ) + return result + + +class WirelessLink: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLink.""" + + def __new__( + cls, + interface_a: str | Interface | pb.Interface | None = None, + interface_b: str | Interface | pb.Interface | None = None, + ssid: str | None = None, + status: str | None = None, + tenant: str | Tenant | pb.Tenant | None = None, + auth_type: str | None = None, + auth_cipher: str | None = None, + auth_psk: str | None = None, + distance: float | None = None, + distance_unit: str | None = None, + description: str | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.WirelessLink: + """Create a new WirelessLink.""" + interface_a = convert_to_protobuf(interface_a, pb.Interface) + interface_b = convert_to_protobuf(interface_b, pb.Interface) + tenant = convert_to_protobuf(tenant, pb.Tenant) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.WirelessLink( + interface_a=interface_a, + interface_b=interface_b, + ssid=ssid, + status=status, + tenant=tenant, + auth_type=auth_type, + auth_cipher=auth_cipher, + auth_psk=auth_psk, + distance=distance, + distance_unit=distance_unit, + description=description, + comments=comments, + tags=tags, + custom_fields=custom_fields, + metadata=metadata, + owner=owner, + ) + return result + + +class CustomField: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomField.""" + + def __new__( + cls, + type: str | None = None, + related_object_type: str | None = None, + name: str | None = None, + label: str | None = None, + group_name: str | None = None, + description: str | None = None, + required: bool | None = None, + unique: bool | None = None, + search_weight: int | None = None, + filter_logic: str | None = None, + ui_visible: str | None = None, + ui_editable: str | None = None, + is_cloneable: bool | None = None, + default: str | None = None, + related_object_filter: str | None = None, + weight: int | None = None, + validation_minimum: float | None = None, + validation_maximum: float | None = None, + validation_regex: str | None = None, + choice_set: str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None = None, + comments: str | None = None, + object_types: list[str] | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.CustomField: + """Create a new CustomField.""" + choice_set = convert_to_protobuf(choice_set, pb.CustomFieldChoiceSet) + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.CustomField( + type=type, + related_object_type=related_object_type, + name=name, + label=label, + group_name=group_name, + description=description, + required=required, + unique=unique, + search_weight=search_weight, + filter_logic=filter_logic, + ui_visible=ui_visible, + ui_editable=ui_editable, + is_cloneable=is_cloneable, + default=default, + related_object_filter=related_object_filter, + weight=weight, + validation_minimum=validation_minimum, + validation_maximum=validation_maximum, + validation_regex=validation_regex, + choice_set=choice_set, + comments=comments, + object_types=object_types, + metadata=metadata, + owner=owner, + ) + return result + + +class CustomFieldChoiceSet: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomFieldChoiceSet.""" + + def __new__( + cls, + name: str | None = None, + description: str | None = None, + base_choices: str | None = None, + order_alphabetically: bool | None = None, + extra_choices: list[str] | None = None, + metadata: dict[str, Any] | None = None, + owner: str | Owner | pb.Owner | None = None, + ) -> pb.CustomFieldChoiceSet: + """Create a new CustomFieldChoiceSet.""" + metadata = convert_dict_to_struct(metadata) + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.CustomFieldChoiceSet( + name=name, + description=description, + base_choices=base_choices, + order_alphabetically=order_alphabetically, + extra_choices=extra_choices, + metadata=metadata, + owner=owner, + ) + return result + + +class JournalEntry: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.JournalEntry.""" + + def __new__( + cls, + assigned_object_asn: str | ASN | pb.ASN | None = None, + assigned_object_asn_range: str | ASNRange | pb.ASNRange | None = None, + assigned_object_aggregate: Aggregate | pb.Aggregate | None = None, + assigned_object_cable: Cable | pb.Cable | None = None, + assigned_object_cable_path: CablePath | pb.CablePath | None = None, + assigned_object_cable_termination: ( + CableTermination | pb.CableTermination | None + ) = None, + assigned_object_circuit: str | Circuit | pb.Circuit | None = None, + assigned_object_circuit_group: ( + str | CircuitGroup | pb.CircuitGroup | None + ) = None, + assigned_object_circuit_group_assignment: ( + CircuitGroupAssignment | pb.CircuitGroupAssignment | None + ) = None, + assigned_object_circuit_termination: ( + CircuitTermination | pb.CircuitTermination | None + ) = None, + assigned_object_circuit_type: str | CircuitType | pb.CircuitType | None = None, + assigned_object_cluster: str | Cluster | pb.Cluster | None = None, + assigned_object_cluster_group: ( + str | ClusterGroup | pb.ClusterGroup | None + ) = None, + assigned_object_cluster_type: str | ClusterType | pb.ClusterType | None = None, + assigned_object_console_port: str | ConsolePort | pb.ConsolePort | None = None, + assigned_object_console_server_port: ( + str | ConsoleServerPort | pb.ConsoleServerPort | None + ) = None, + assigned_object_contact: str | Contact | pb.Contact | None = None, + assigned_object_contact_assignment: ( + ContactAssignment | pb.ContactAssignment | None + ) = None, + assigned_object_contact_group: ( + str | ContactGroup | pb.ContactGroup | None + ) = None, + assigned_object_contact_role: str | ContactRole | pb.ContactRole | None = None, + assigned_object_custom_field: str | CustomField | pb.CustomField | None = None, + assigned_object_custom_field_choice_set: ( + str | CustomFieldChoiceSet | pb.CustomFieldChoiceSet | None + ) = None, + assigned_object_device: str | Device | pb.Device | None = None, + assigned_object_device_bay: str | DeviceBay | pb.DeviceBay | None = None, + assigned_object_device_role: str | DeviceRole | pb.DeviceRole | None = None, + assigned_object_device_type: str | DeviceType | pb.DeviceType | None = None, + assigned_object_fhrp_group: str | FHRPGroup | pb.FHRPGroup | None = None, + assigned_object_fhrp_group_assignment: ( + FHRPGroupAssignment | pb.FHRPGroupAssignment | None + ) = None, + assigned_object_front_port: str | FrontPort | pb.FrontPort | None = None, + assigned_object_ike_policy: str | IKEPolicy | pb.IKEPolicy | None = None, + assigned_object_ike_proposal: str | IKEProposal | pb.IKEProposal | None = None, + assigned_object_ip_address: str | IPAddress | pb.IPAddress | None = None, + assigned_object_ip_range: IPRange | pb.IPRange | None = None, + assigned_object_ip_sec_policy: str | IPSecPolicy | pb.IPSecPolicy | None = None, + assigned_object_ip_sec_profile: ( + str | IPSecProfile | pb.IPSecProfile | None + ) = None, + assigned_object_ip_sec_proposal: ( + str | IPSecProposal | pb.IPSecProposal | None + ) = None, + assigned_object_interface: str | Interface | pb.Interface | None = None, + assigned_object_inventory_item: ( + str | InventoryItem | pb.InventoryItem | None + ) = None, + assigned_object_inventory_item_role: ( + str | InventoryItemRole | pb.InventoryItemRole | None + ) = None, + assigned_object_journal_entry: JournalEntry | pb.JournalEntry | None = None, + assigned_object_l2vpn: str | L2VPN | pb.L2VPN | None = None, + assigned_object_l2vpn_termination: ( + L2VPNTermination | pb.L2VPNTermination | None + ) = None, + assigned_object_location: str | Location | pb.Location | None = None, + assigned_object_mac_address: str | MACAddress | pb.MACAddress | None = None, + assigned_object_manufacturer: ( + str | Manufacturer | pb.Manufacturer | None + ) = None, + assigned_object_module: Module | pb.Module | None = None, + assigned_object_module_bay: str | ModuleBay | pb.ModuleBay | None = None, + assigned_object_module_type: str | ModuleType | pb.ModuleType | None = None, + assigned_object_module_type_profile: ( + str | ModuleTypeProfile | pb.ModuleTypeProfile | None + ) = None, + assigned_object_platform: str | Platform | pb.Platform | None = None, + assigned_object_power_feed: str | PowerFeed | pb.PowerFeed | None = None, + assigned_object_power_outlet: str | PowerOutlet | pb.PowerOutlet | None = None, + assigned_object_power_panel: str | PowerPanel | pb.PowerPanel | None = None, + assigned_object_power_port: str | PowerPort | pb.PowerPort | None = None, + assigned_object_prefix: str | Prefix | pb.Prefix | None = None, + assigned_object_provider: str | Provider | pb.Provider | None = None, + assigned_object_provider_account: ( + str | ProviderAccount | pb.ProviderAccount | None + ) = None, + assigned_object_provider_network: ( + str | ProviderNetwork | pb.ProviderNetwork | None + ) = None, + assigned_object_rir: str | RIR | pb.RIR | None = None, + assigned_object_rack: str | Rack | pb.Rack | None = None, + assigned_object_rack_reservation: ( + RackReservation | pb.RackReservation | None + ) = None, + assigned_object_rack_role: str | RackRole | pb.RackRole | None = None, + assigned_object_rack_type: str | RackType | pb.RackType | None = None, + assigned_object_rear_port: str | RearPort | pb.RearPort | None = None, + assigned_object_region: str | Region | pb.Region | None = None, + assigned_object_role: str | Role | pb.Role | None = None, + assigned_object_route_target: str | RouteTarget | pb.RouteTarget | None = None, + assigned_object_service: str | Service | pb.Service | None = None, + assigned_object_site: str | Site | pb.Site | None = None, + assigned_object_site_group: str | SiteGroup | pb.SiteGroup | None = None, + assigned_object_tag: str | Tag | pb.Tag | None = None, + assigned_object_tenant: str | Tenant | pb.Tenant | None = None, + assigned_object_tenant_group: str | TenantGroup | pb.TenantGroup | None = None, + assigned_object_tunnel: str | Tunnel | pb.Tunnel | None = None, + assigned_object_tunnel_group: str | TunnelGroup | pb.TunnelGroup | None = None, + assigned_object_tunnel_termination: ( + TunnelTermination | pb.TunnelTermination | None + ) = None, + assigned_object_vlan: str | VLAN | pb.VLAN | None = None, + assigned_object_vlan_group: str | VLANGroup | pb.VLANGroup | None = None, + assigned_object_vlan_translation_policy: ( + str | VLANTranslationPolicy | pb.VLANTranslationPolicy | None + ) = None, + assigned_object_vlan_translation_rule: ( + VLANTranslationRule | pb.VLANTranslationRule | None + ) = None, + assigned_object_vm_interface: str | VMInterface | pb.VMInterface | None = None, + assigned_object_vrf: str | VRF | pb.VRF | None = None, + assigned_object_virtual_chassis: ( + str | VirtualChassis | pb.VirtualChassis | None + ) = None, + assigned_object_virtual_circuit: ( + str | VirtualCircuit | pb.VirtualCircuit | None + ) = None, + assigned_object_virtual_circuit_termination: ( + VirtualCircuitTermination | pb.VirtualCircuitTermination | None + ) = None, + assigned_object_virtual_circuit_type: ( + str | VirtualCircuitType | pb.VirtualCircuitType | None + ) = None, + assigned_object_virtual_device_context: ( + str | VirtualDeviceContext | pb.VirtualDeviceContext | None + ) = None, + assigned_object_virtual_disk: str | VirtualDisk | pb.VirtualDisk | None = None, + assigned_object_virtual_machine: ( + str | VirtualMachine | pb.VirtualMachine | None + ) = None, + assigned_object_wireless_lan: str | WirelessLAN | pb.WirelessLAN | None = None, + assigned_object_wireless_lan_group: ( + str | WirelessLANGroup | pb.WirelessLANGroup | None + ) = None, + assigned_object_wireless_link: WirelessLink | pb.WirelessLink | None = None, + assigned_object_custom_link: str | CustomLink | pb.CustomLink | None = None, + assigned_object_owner: str | Owner | pb.Owner | None = None, + assigned_object_owner_group: str | OwnerGroup | pb.OwnerGroup | None = None, + kind: str | None = None, + comments: str | None = None, + tags: list[str | Tag | pb.Tag] | None = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, + metadata: dict[str, Any] | None = None, + ) -> pb.JournalEntry: + """Create a new JournalEntry.""" + assigned_object_asn = convert_to_protobuf(assigned_object_asn, pb.ASN) + assigned_object_asn_range = convert_to_protobuf( + assigned_object_asn_range, pb.ASNRange + ) + assigned_object_aggregate = convert_to_protobuf( + assigned_object_aggregate, pb.Aggregate + ) + assigned_object_cable = convert_to_protobuf(assigned_object_cable, pb.Cable) + assigned_object_cable_path = convert_to_protobuf( + assigned_object_cable_path, pb.CablePath + ) + assigned_object_cable_termination = convert_to_protobuf( + assigned_object_cable_termination, pb.CableTermination + ) + assigned_object_circuit = convert_to_protobuf( + assigned_object_circuit, pb.Circuit + ) + assigned_object_circuit_group = convert_to_protobuf( + assigned_object_circuit_group, pb.CircuitGroup + ) + assigned_object_circuit_group_assignment = convert_to_protobuf( + assigned_object_circuit_group_assignment, pb.CircuitGroupAssignment + ) + assigned_object_circuit_termination = convert_to_protobuf( + assigned_object_circuit_termination, pb.CircuitTermination + ) + assigned_object_circuit_type = convert_to_protobuf( + assigned_object_circuit_type, pb.CircuitType + ) + assigned_object_cluster = convert_to_protobuf( + assigned_object_cluster, pb.Cluster + ) + assigned_object_cluster_group = convert_to_protobuf( + assigned_object_cluster_group, pb.ClusterGroup + ) + assigned_object_cluster_type = convert_to_protobuf( + assigned_object_cluster_type, pb.ClusterType + ) + assigned_object_console_port = convert_to_protobuf( + assigned_object_console_port, pb.ConsolePort + ) + assigned_object_console_server_port = convert_to_protobuf( + assigned_object_console_server_port, pb.ConsoleServerPort + ) + assigned_object_contact = convert_to_protobuf( + assigned_object_contact, pb.Contact + ) + assigned_object_contact_assignment = convert_to_protobuf( + assigned_object_contact_assignment, pb.ContactAssignment + ) + assigned_object_contact_group = convert_to_protobuf( + assigned_object_contact_group, pb.ContactGroup + ) + assigned_object_contact_role = convert_to_protobuf( + assigned_object_contact_role, pb.ContactRole + ) + assigned_object_custom_field = convert_to_protobuf( + assigned_object_custom_field, pb.CustomField + ) + assigned_object_custom_field_choice_set = convert_to_protobuf( + assigned_object_custom_field_choice_set, pb.CustomFieldChoiceSet + ) + assigned_object_device = convert_to_protobuf(assigned_object_device, pb.Device) + assigned_object_device_bay = convert_to_protobuf( + assigned_object_device_bay, pb.DeviceBay + ) + assigned_object_device_role = convert_to_protobuf( + assigned_object_device_role, pb.DeviceRole + ) + assigned_object_device_type = convert_to_protobuf( + assigned_object_device_type, pb.DeviceType + ) + assigned_object_fhrp_group = convert_to_protobuf( + assigned_object_fhrp_group, pb.FHRPGroup + ) + assigned_object_fhrp_group_assignment = convert_to_protobuf( + assigned_object_fhrp_group_assignment, pb.FHRPGroupAssignment + ) + assigned_object_front_port = convert_to_protobuf( + assigned_object_front_port, pb.FrontPort + ) + assigned_object_ike_policy = convert_to_protobuf( + assigned_object_ike_policy, pb.IKEPolicy + ) + assigned_object_ike_proposal = convert_to_protobuf( + assigned_object_ike_proposal, pb.IKEProposal + ) + assigned_object_ip_address = convert_to_protobuf( + assigned_object_ip_address, pb.IPAddress + ) + assigned_object_ip_range = convert_to_protobuf( + assigned_object_ip_range, pb.IPRange + ) + assigned_object_ip_sec_policy = convert_to_protobuf( + assigned_object_ip_sec_policy, pb.IPSecPolicy + ) + assigned_object_ip_sec_profile = convert_to_protobuf( + assigned_object_ip_sec_profile, pb.IPSecProfile + ) + assigned_object_ip_sec_proposal = convert_to_protobuf( + assigned_object_ip_sec_proposal, pb.IPSecProposal + ) + assigned_object_interface = convert_to_protobuf( + assigned_object_interface, pb.Interface + ) + assigned_object_inventory_item = convert_to_protobuf( + assigned_object_inventory_item, pb.InventoryItem + ) + assigned_object_inventory_item_role = convert_to_protobuf( + assigned_object_inventory_item_role, pb.InventoryItemRole + ) + assigned_object_journal_entry = convert_to_protobuf( + assigned_object_journal_entry, pb.JournalEntry + ) + assigned_object_l2vpn = convert_to_protobuf(assigned_object_l2vpn, pb.L2VPN) + assigned_object_l2vpn_termination = convert_to_protobuf( + assigned_object_l2vpn_termination, pb.L2VPNTermination + ) + assigned_object_location = convert_to_protobuf( + assigned_object_location, pb.Location + ) + assigned_object_mac_address = convert_to_protobuf( + assigned_object_mac_address, pb.MACAddress + ) + assigned_object_manufacturer = convert_to_protobuf( + assigned_object_manufacturer, pb.Manufacturer + ) + assigned_object_module = convert_to_protobuf(assigned_object_module, pb.Module) + assigned_object_module_bay = convert_to_protobuf( + assigned_object_module_bay, pb.ModuleBay + ) + assigned_object_module_type = convert_to_protobuf( + assigned_object_module_type, pb.ModuleType + ) + assigned_object_module_type_profile = convert_to_protobuf( + assigned_object_module_type_profile, pb.ModuleTypeProfile + ) + assigned_object_platform = convert_to_protobuf( + assigned_object_platform, pb.Platform + ) + assigned_object_power_feed = convert_to_protobuf( + assigned_object_power_feed, pb.PowerFeed + ) + assigned_object_power_outlet = convert_to_protobuf( + assigned_object_power_outlet, pb.PowerOutlet + ) + assigned_object_power_panel = convert_to_protobuf( + assigned_object_power_panel, pb.PowerPanel + ) + assigned_object_power_port = convert_to_protobuf( + assigned_object_power_port, pb.PowerPort + ) + assigned_object_prefix = convert_to_protobuf(assigned_object_prefix, pb.Prefix) + assigned_object_provider = convert_to_protobuf( + assigned_object_provider, pb.Provider + ) + assigned_object_provider_account = convert_to_protobuf( + assigned_object_provider_account, pb.ProviderAccount + ) + assigned_object_provider_network = convert_to_protobuf( + assigned_object_provider_network, pb.ProviderNetwork + ) + assigned_object_rir = convert_to_protobuf(assigned_object_rir, pb.RIR) + assigned_object_rack = convert_to_protobuf(assigned_object_rack, pb.Rack) + assigned_object_rack_reservation = convert_to_protobuf( + assigned_object_rack_reservation, pb.RackReservation + ) + assigned_object_rack_role = convert_to_protobuf( + assigned_object_rack_role, pb.RackRole + ) + assigned_object_rack_type = convert_to_protobuf( + assigned_object_rack_type, pb.RackType + ) + assigned_object_rear_port = convert_to_protobuf( + assigned_object_rear_port, pb.RearPort + ) + assigned_object_region = convert_to_protobuf(assigned_object_region, pb.Region) + assigned_object_role = convert_to_protobuf(assigned_object_role, pb.Role) + assigned_object_route_target = convert_to_protobuf( + assigned_object_route_target, pb.RouteTarget + ) + assigned_object_service = convert_to_protobuf( + assigned_object_service, pb.Service + ) + assigned_object_site = convert_to_protobuf(assigned_object_site, pb.Site) + assigned_object_site_group = convert_to_protobuf( + assigned_object_site_group, pb.SiteGroup + ) + assigned_object_tag = convert_to_protobuf(assigned_object_tag, pb.Tag) + assigned_object_tenant = convert_to_protobuf(assigned_object_tenant, pb.Tenant) + assigned_object_tenant_group = convert_to_protobuf( + assigned_object_tenant_group, pb.TenantGroup + ) + assigned_object_tunnel = convert_to_protobuf(assigned_object_tunnel, pb.Tunnel) + assigned_object_tunnel_group = convert_to_protobuf( + assigned_object_tunnel_group, pb.TunnelGroup + ) + assigned_object_tunnel_termination = convert_to_protobuf( + assigned_object_tunnel_termination, pb.TunnelTermination + ) + assigned_object_vlan = convert_to_protobuf(assigned_object_vlan, pb.VLAN) + assigned_object_vlan_group = convert_to_protobuf( + assigned_object_vlan_group, pb.VLANGroup + ) + assigned_object_vlan_translation_policy = convert_to_protobuf( + assigned_object_vlan_translation_policy, pb.VLANTranslationPolicy + ) + assigned_object_vlan_translation_rule = convert_to_protobuf( + assigned_object_vlan_translation_rule, pb.VLANTranslationRule + ) + assigned_object_vm_interface = convert_to_protobuf( + assigned_object_vm_interface, pb.VMInterface + ) + assigned_object_vrf = convert_to_protobuf(assigned_object_vrf, pb.VRF) + assigned_object_virtual_chassis = convert_to_protobuf( + assigned_object_virtual_chassis, pb.VirtualChassis + ) + assigned_object_virtual_circuit = convert_to_protobuf( + assigned_object_virtual_circuit, pb.VirtualCircuit + ) + assigned_object_virtual_circuit_termination = convert_to_protobuf( + assigned_object_virtual_circuit_termination, pb.VirtualCircuitTermination + ) + assigned_object_virtual_circuit_type = convert_to_protobuf( + assigned_object_virtual_circuit_type, pb.VirtualCircuitType + ) + assigned_object_virtual_device_context = convert_to_protobuf( + assigned_object_virtual_device_context, pb.VirtualDeviceContext + ) + assigned_object_virtual_disk = convert_to_protobuf( + assigned_object_virtual_disk, pb.VirtualDisk + ) + assigned_object_virtual_machine = convert_to_protobuf( + assigned_object_virtual_machine, pb.VirtualMachine + ) + assigned_object_wireless_lan = convert_to_protobuf( + assigned_object_wireless_lan, pb.WirelessLAN + ) + assigned_object_wireless_lan_group = convert_to_protobuf( + assigned_object_wireless_lan_group, pb.WirelessLANGroup + ) + assigned_object_wireless_link = convert_to_protobuf( + assigned_object_wireless_link, pb.WirelessLink + ) + assigned_object_custom_link = convert_to_protobuf( + assigned_object_custom_link, pb.CustomLink + ) + assigned_object_owner = convert_to_protobuf(assigned_object_owner, pb.Owner) + assigned_object_owner_group = convert_to_protobuf( + assigned_object_owner_group, pb.OwnerGroup + ) + tags = convert_to_protobuf_list(tags, pb.Tag) + custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + metadata = convert_dict_to_struct(metadata) + result = pb.JournalEntry( + assigned_object_asn=assigned_object_asn, + assigned_object_asn_range=assigned_object_asn_range, + assigned_object_aggregate=assigned_object_aggregate, + assigned_object_cable=assigned_object_cable, + assigned_object_cable_path=assigned_object_cable_path, + assigned_object_cable_termination=assigned_object_cable_termination, + assigned_object_circuit=assigned_object_circuit, + assigned_object_circuit_group=assigned_object_circuit_group, + assigned_object_circuit_group_assignment=assigned_object_circuit_group_assignment, + assigned_object_circuit_termination=assigned_object_circuit_termination, + assigned_object_circuit_type=assigned_object_circuit_type, + assigned_object_cluster=assigned_object_cluster, + assigned_object_cluster_group=assigned_object_cluster_group, + assigned_object_cluster_type=assigned_object_cluster_type, + assigned_object_console_port=assigned_object_console_port, + assigned_object_console_server_port=assigned_object_console_server_port, + assigned_object_contact=assigned_object_contact, + assigned_object_contact_assignment=assigned_object_contact_assignment, + assigned_object_contact_group=assigned_object_contact_group, + assigned_object_contact_role=assigned_object_contact_role, + assigned_object_custom_field=assigned_object_custom_field, + assigned_object_custom_field_choice_set=assigned_object_custom_field_choice_set, + assigned_object_device=assigned_object_device, + assigned_object_device_bay=assigned_object_device_bay, + assigned_object_device_role=assigned_object_device_role, + assigned_object_device_type=assigned_object_device_type, + assigned_object_fhrp_group=assigned_object_fhrp_group, + assigned_object_fhrp_group_assignment=assigned_object_fhrp_group_assignment, + assigned_object_front_port=assigned_object_front_port, + assigned_object_ike_policy=assigned_object_ike_policy, + assigned_object_ike_proposal=assigned_object_ike_proposal, + assigned_object_ip_address=assigned_object_ip_address, + assigned_object_ip_range=assigned_object_ip_range, + assigned_object_ip_sec_policy=assigned_object_ip_sec_policy, + assigned_object_ip_sec_profile=assigned_object_ip_sec_profile, + assigned_object_ip_sec_proposal=assigned_object_ip_sec_proposal, + assigned_object_interface=assigned_object_interface, + assigned_object_inventory_item=assigned_object_inventory_item, + assigned_object_inventory_item_role=assigned_object_inventory_item_role, + assigned_object_journal_entry=assigned_object_journal_entry, + assigned_object_l2vpn=assigned_object_l2vpn, + assigned_object_l2vpn_termination=assigned_object_l2vpn_termination, + assigned_object_location=assigned_object_location, + assigned_object_mac_address=assigned_object_mac_address, + assigned_object_manufacturer=assigned_object_manufacturer, + assigned_object_module=assigned_object_module, + assigned_object_module_bay=assigned_object_module_bay, + assigned_object_module_type=assigned_object_module_type, + assigned_object_module_type_profile=assigned_object_module_type_profile, + assigned_object_platform=assigned_object_platform, + assigned_object_power_feed=assigned_object_power_feed, + assigned_object_power_outlet=assigned_object_power_outlet, + assigned_object_power_panel=assigned_object_power_panel, + assigned_object_power_port=assigned_object_power_port, + assigned_object_prefix=assigned_object_prefix, + assigned_object_provider=assigned_object_provider, + assigned_object_provider_account=assigned_object_provider_account, + assigned_object_provider_network=assigned_object_provider_network, + assigned_object_rir=assigned_object_rir, + assigned_object_rack=assigned_object_rack, + assigned_object_rack_reservation=assigned_object_rack_reservation, + assigned_object_rack_role=assigned_object_rack_role, + assigned_object_rack_type=assigned_object_rack_type, + assigned_object_rear_port=assigned_object_rear_port, + assigned_object_region=assigned_object_region, + assigned_object_role=assigned_object_role, + assigned_object_route_target=assigned_object_route_target, + assigned_object_service=assigned_object_service, + assigned_object_site=assigned_object_site, + assigned_object_site_group=assigned_object_site_group, + assigned_object_tag=assigned_object_tag, + assigned_object_tenant=assigned_object_tenant, + assigned_object_tenant_group=assigned_object_tenant_group, + assigned_object_tunnel=assigned_object_tunnel, + assigned_object_tunnel_group=assigned_object_tunnel_group, + assigned_object_tunnel_termination=assigned_object_tunnel_termination, + assigned_object_vlan=assigned_object_vlan, + assigned_object_vlan_group=assigned_object_vlan_group, + assigned_object_vlan_translation_policy=assigned_object_vlan_translation_policy, + assigned_object_vlan_translation_rule=assigned_object_vlan_translation_rule, + assigned_object_vm_interface=assigned_object_vm_interface, + assigned_object_vrf=assigned_object_vrf, + assigned_object_virtual_chassis=assigned_object_virtual_chassis, + assigned_object_virtual_circuit=assigned_object_virtual_circuit, + assigned_object_virtual_circuit_termination=assigned_object_virtual_circuit_termination, + assigned_object_virtual_circuit_type=assigned_object_virtual_circuit_type, + assigned_object_virtual_device_context=assigned_object_virtual_device_context, + assigned_object_virtual_disk=assigned_object_virtual_disk, + assigned_object_virtual_machine=assigned_object_virtual_machine, + assigned_object_wireless_lan=assigned_object_wireless_lan, + assigned_object_wireless_lan_group=assigned_object_wireless_lan_group, + assigned_object_wireless_link=assigned_object_wireless_link, + assigned_object_custom_link=assigned_object_custom_link, + assigned_object_owner=assigned_object_owner, + assigned_object_owner_group=assigned_object_owner_group, + kind=kind, comments=comments, tags=tags, custom_fields=custom_fields, @@ -7548,268 +7613,131 @@ def __new__( return result -class VirtualDisk: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualDisk.""" +class ModuleTypeProfile: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.ModuleTypeProfile.""" def __new__( cls, - virtual_machine: str | VirtualMachine | pb.VirtualMachine | None = None, name: str | None = None, description: str | None = None, - size: int | None = None, - owner: str | Owner | pb.Owner | None = None, + schema: str | None = None, + comments: str | None = None, tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + custom_fields: dict[str, CustomFieldValue | pb.CustomFieldValue] | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.VirtualDisk: - """Create a new VirtualDisk.""" - virtual_machine = convert_to_protobuf(virtual_machine, pb.VirtualMachine) - owner = convert_to_protobuf(owner, pb.Owner) + owner: str | Owner | pb.Owner | None = None, + ) -> pb.ModuleTypeProfile: + """Create a new ModuleTypeProfile.""" tags = convert_to_protobuf_list(tags, pb.Tag) custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) metadata = convert_dict_to_struct(metadata) - result = pb.VirtualDisk( - virtual_machine=virtual_machine, + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.ModuleTypeProfile( name=name, description=description, - size=size, - owner=owner, + schema=schema, + comments=comments, tags=tags, custom_fields=custom_fields, metadata=metadata, + owner=owner, ) return result -class VirtualMachine: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.VirtualMachine.""" +class CustomLink: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.CustomLink.""" def __new__( cls, name: str | None = None, - status: str | None = None, - start_on_boot: str | None = None, - site: str | Site | pb.Site | None = None, - cluster: str | Cluster | pb.Cluster | None = None, - device: str | Device | pb.Device | None = None, - serial: str | None = None, - role: str | DeviceRole | pb.DeviceRole | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - platform: str | Platform | pb.Platform | None = None, - primary_ip4: str | IPAddress | pb.IPAddress | None = None, - primary_ip6: str | IPAddress | pb.IPAddress | None = None, - vcpus: float | None = None, - memory: int | None = None, - disk: int | None = None, - description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + enabled: bool | None = None, + link_text: str | None = None, + link_url: str | None = None, + weight: int | None = None, + group_name: str | None = None, + button_class: str | None = None, + new_window: bool | None = None, + object_types: list[str] | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.VirtualMachine: - """Create a new VirtualMachine.""" - site = convert_to_protobuf(site, pb.Site) - cluster = convert_to_protobuf(cluster, pb.Cluster) - device = convert_to_protobuf(device, pb.Device) - role = convert_to_protobuf(role, pb.DeviceRole) - tenant = convert_to_protobuf(tenant, pb.Tenant) - platform = convert_to_protobuf(platform, pb.Platform) - primary_ip4 = convert_to_protobuf(primary_ip4, pb.IPAddress) - primary_ip6 = convert_to_protobuf(primary_ip6, pb.IPAddress) - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + owner: str | Owner | pb.Owner | None = None, + ) -> pb.CustomLink: + """Create a new CustomLink.""" metadata = convert_dict_to_struct(metadata) - - # apply shortcuts - if platform is not None: - if device is not None and not device.HasField("platform"): - device.platform.CopyFrom(platform) - if site is not None: - if device is not None and not device.HasField("site"): - device.site.CopyFrom(site) - if cluster is not None and not cluster.HasField("scope_site"): - cluster.scope_site.CopyFrom(site) - if role is not None: - if device is not None and not device.HasField("role"): - device.role.CopyFrom(role) - result = pb.VirtualMachine( + owner = convert_to_protobuf(owner, pb.Owner) + result = pb.CustomLink( name=name, - status=status, - start_on_boot=start_on_boot, - site=site, - cluster=cluster, - device=device, - serial=serial, - role=role, - tenant=tenant, - platform=platform, - primary_ip4=primary_ip4, - primary_ip6=primary_ip6, - vcpus=vcpus, - memory=memory, - disk=disk, - description=description, - owner=owner, - comments=comments, - tags=tags, - custom_fields=custom_fields, + enabled=enabled, + link_text=link_text, + link_url=link_url, + weight=weight, + group_name=group_name, + button_class=button_class, + new_window=new_window, + object_types=object_types, metadata=metadata, + owner=owner, ) return result -class WirelessLAN: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLAN.""" +class Owner: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.Owner.""" def __new__( cls, - ssid: str | None = None, + name: str | None = None, + group: str | OwnerGroup | pb.OwnerGroup | None = None, description: str | None = None, - group: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, - status: str | None = None, - vlan: str | VLAN | pb.VLAN | None = None, - scope_location: str | Location | pb.Location | None = None, - scope_region: str | Region | pb.Region | None = None, - scope_site: str | Site | pb.Site | None = None, - scope_site_group: str | SiteGroup | pb.SiteGroup | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - auth_type: str | None = None, - auth_cipher: str | None = None, - auth_psk: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.WirelessLAN: - """Create a new WirelessLAN.""" - group = convert_to_protobuf(group, pb.WirelessLANGroup) - vlan = convert_to_protobuf(vlan, pb.VLAN) - scope_location = convert_to_protobuf(scope_location, pb.Location) - scope_region = convert_to_protobuf(scope_region, pb.Region) - scope_site = convert_to_protobuf(scope_site, pb.Site) - scope_site_group = convert_to_protobuf(scope_site_group, pb.SiteGroup) - tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + ) -> pb.Owner: + """Create a new Owner.""" + group = convert_to_protobuf(group, pb.OwnerGroup) metadata = convert_dict_to_struct(metadata) - result = pb.WirelessLAN( - ssid=ssid, - description=description, + result = pb.Owner( + name=name, group=group, - status=status, - vlan=vlan, - scope_location=scope_location, - scope_region=scope_region, - scope_site=scope_site, - scope_site_group=scope_site_group, - tenant=tenant, - auth_type=auth_type, - auth_cipher=auth_cipher, - auth_psk=auth_psk, - owner=owner, - comments=comments, - tags=tags, - custom_fields=custom_fields, + description=description, metadata=metadata, ) return result -class WirelessLANGroup: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLANGroup.""" +class OwnerGroup: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.OwnerGroup.""" def __new__( cls, name: str | None = None, - slug: str | None = None, - parent: str | WirelessLANGroup | pb.WirelessLANGroup | None = None, description: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, metadata: dict[str, Any] | None = None, - ) -> pb.WirelessLANGroup: - """Create a new WirelessLANGroup.""" - parent = convert_to_protobuf(parent, pb.WirelessLANGroup) - tags = convert_to_protobuf_list(tags, pb.Tag) - owner = convert_to_protobuf(owner, pb.Owner) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + ) -> pb.OwnerGroup: + """Create a new OwnerGroup.""" metadata = convert_dict_to_struct(metadata) - result = pb.WirelessLANGroup( + result = pb.OwnerGroup( name=name, - slug=slug, - parent=parent, description=description, - tags=tags, - owner=owner, - comments=comments, - custom_fields=custom_fields, metadata=metadata, ) return result -class WirelessLink: - """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.WirelessLink.""" +class DeviceConfig: + """wrapper for netboxlabs.diode.sdk.diode.v1.ingester_pb2.DeviceConfig.""" def __new__( cls, - interface_a: str | Interface | pb.Interface | None = None, - interface_b: str | Interface | pb.Interface | None = None, - ssid: str | None = None, - status: str | None = None, - tenant: str | Tenant | pb.Tenant | None = None, - auth_type: str | None = None, - auth_cipher: str | None = None, - auth_psk: str | None = None, - distance: float | None = None, - distance_unit: str | None = None, - description: str | None = None, - owner: str | Owner | pb.Owner | None = None, - comments: str | None = None, - tags: list[str | Tag | pb.Tag] | None = None, - custom_fields: ( - dict[str, str | CustomFieldValue | pb.CustomFieldValue] | None - ) = None, + startup: bytes | None = None, + running: bytes | None = None, + candidate: bytes | None = None, metadata: dict[str, Any] | None = None, - ) -> pb.WirelessLink: - """Create a new WirelessLink.""" - interface_a = convert_to_protobuf(interface_a, pb.Interface) - interface_b = convert_to_protobuf(interface_b, pb.Interface) - tenant = convert_to_protobuf(tenant, pb.Tenant) - owner = convert_to_protobuf(owner, pb.Owner) - tags = convert_to_protobuf_list(tags, pb.Tag) - custom_fields = convert_to_protobuf_dict(custom_fields, pb.CustomFieldValue) + ) -> pb.DeviceConfig: + """Create a new DeviceConfig.""" metadata = convert_dict_to_struct(metadata) - result = pb.WirelessLink( - interface_a=interface_a, - interface_b=interface_b, - ssid=ssid, - status=status, - tenant=tenant, - auth_type=auth_type, - auth_cipher=auth_cipher, - auth_psk=auth_psk, - distance=distance, - distance_unit=distance_unit, - description=description, - owner=owner, - comments=comments, - tags=tags, - custom_fields=custom_fields, + result = pb.DeviceConfig( + startup=startup, + running=running, + candidate=candidate, metadata=metadata, ) return result From bc18d9086376e95af43a1bf4785c100071e2486e Mon Sep 17 00:00:00 2001 From: Paul Stuart Date: Fri, 13 Feb 2026 13:44:23 -0800 Subject: [PATCH 6/8] redo after adding diffs from develop --- docs/README.md | 18 +++-- docs/examples/aggregate.py | 45 +++++-------- docs/examples/asn.py | 41 +++++------- docs/examples/asn_range.py | 45 +++++-------- docs/examples/cable.py | 29 +++----- docs/examples/cable_path.py | 20 ++---- docs/examples/circuit.py | 43 +++++------- docs/examples/circuit_group.py | 27 +++----- docs/examples/circuit_group_assignment.py | 32 ++++----- docs/examples/circuit_termination.py | 38 +++++------ docs/examples/circuit_type.py | 23 +++---- docs/examples/cluster.py | 37 ++++------- docs/examples/cluster_group.py | 23 +++---- docs/examples/cluster_type.py | 23 +++---- docs/examples/console_port.py | 40 ++++------- docs/examples/console_server_port.py | 42 ++++-------- docs/examples/contact.py | 23 +++---- docs/examples/contact_assignment.py | 33 ++++----- docs/examples/contact_group.py | 23 +++---- docs/examples/contact_role.py | 23 +++---- docs/examples/custom_field.py | 27 +++----- docs/examples/custom_field_choice_set.py | 26 +++----- docs/examples/custom_link.py | 32 ++++----- docs/examples/device.py | 56 ++++++---------- docs/examples/device_bay.py | 40 ++++------- docs/examples/device_config.py | 38 +++++------ docs/examples/device_role.py | 23 +++---- docs/examples/device_type.py | 33 ++++----- docs/examples/fhrp_group.py | 21 +++--- docs/examples/fhrp_group_assignment.py | 28 ++++---- docs/examples/front_port.py | 60 +++++------------ docs/examples/ike_policy.py | 29 ++++---- docs/examples/ike_proposal.py | 29 ++++---- docs/examples/interface_example.py | 60 ++++++----------- docs/examples/inventory_item.py | 49 +++++--------- docs/examples/inventory_item_role.py | 31 +++++---- docs/examples/ip_address.py | 33 ++++----- docs/examples/ip_range.py | 45 ++++++------- docs/examples/ip_sec_policy.py | 29 ++++---- docs/examples/ip_sec_profile.py | 50 ++++++-------- docs/examples/ip_sec_proposal.py | 29 ++++---- docs/examples/journal_entry.py | 18 +++-- docs/examples/l2vpn.py | 25 +++---- docs/examples/l2vpn_termination.py | 24 +++---- docs/examples/location.py | 31 ++++----- docs/examples/mac_address.py | 27 ++++---- docs/examples/manufacturer.py | 21 +++--- docs/examples/module.py | 70 +++++--------------- docs/examples/module_bay.py | 40 ++++------- docs/examples/module_type.py | 31 ++++----- docs/examples/module_type_profile.py | 23 +++---- docs/examples/owner.py | 38 +++++------ docs/examples/owner_group.py | 32 ++++----- docs/examples/platform.py | 21 +++--- docs/examples/power_feed.py | 33 ++++----- docs/examples/power_outlet.py | 40 ++++------- docs/examples/power_panel.py | 27 +++----- docs/examples/power_port.py | 40 ++++------- docs/examples/prefix.py | 25 +++---- docs/examples/provider.py | 21 +++--- docs/examples/provider_account.py | 37 +++++------ docs/examples/provider_network.py | 31 ++++----- docs/examples/rack.py | 32 ++++----- docs/examples/rack_reservation.py | 35 ++++------ docs/examples/rack_role.py | 21 +++--- docs/examples/rack_type.py | 31 ++++----- docs/examples/rear_port.py | 40 ++++------- docs/examples/region.py | 21 +++--- docs/examples/rir.py | 21 +++--- docs/examples/role.py | 21 +++--- docs/examples/route_target.py | 25 +++---- docs/examples/service.py | 21 +++--- docs/examples/site.py | 25 +++---- docs/examples/site_group.py | 21 +++--- docs/examples/tag.py | 24 +++---- docs/examples/tenant.py | 21 +++--- docs/examples/tenant_group.py | 21 +++--- docs/examples/tunnel.py | 25 +++---- docs/examples/tunnel_group.py | 21 +++--- docs/examples/tunnel_termination.py | 28 ++++---- docs/examples/virtual_chassis.py | 21 +++--- docs/examples/virtual_circuit.py | 43 +++++------- docs/examples/virtual_circuit_termination.py | 56 +++++----------- docs/examples/virtual_circuit_type.py | 23 +++---- docs/examples/virtual_device_context.py | 45 +++++-------- docs/examples/virtual_disk.py | 31 ++++----- docs/examples/virtual_machine.py | 29 +++----- docs/examples/vlan.py | 31 ++++----- docs/examples/vlan_group.py | 25 +++---- docs/examples/vlan_translation_policy.py | 27 +++----- docs/examples/vlan_translation_rule.py | 31 ++++----- docs/examples/vm_interface.py | 31 ++++----- docs/examples/vrf.py | 25 +++---- docs/examples/wireless_lan.py | 31 ++++----- docs/examples/wireless_lan_group.py | 23 +++---- docs/examples/wireless_link.py | 67 +++++-------------- netboxlabs/diode/sdk/ingester.py | 3 +- 97 files changed, 1178 insertions(+), 1869 deletions(-) diff --git a/docs/README.md b/docs/README.md index 0fd7baa..f5ba992 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,7 +1,7 @@ # Diode Python SDK - Entity Examples Source: NetBox v4.5.0 -Generated: 2026-02-11 02:15:59Z +Generated: 2026-02-13 21:40:42Z ## Prerequisites @@ -16,12 +16,12 @@ pip install netboxlabs-diode-sdk ## Configuration -Each example reads configuration from environment variables with sensible defaults: +Each example uses constants for configuration. You can modify these in the example code: -```bash -export DIODE_TARGET="grpc://localhost:8080/diode" # optional, this is the default -export DIODE_CLIENT_ID="diode" # optional -export DIODE_CLIENT_SECRET="changeme" # optional +```python +TARGET = "grpc://localhost:8080/diode" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" ``` ## Quick Start @@ -62,11 +62,11 @@ Switch between patterns by uncommenting the desired function call in `main()`. - [Cable](examples/cable.py) - [CablePath](examples/cable_path.py) +- [CableTermination](examples/cable_termination.py) - [ConsolePort](examples/console_port.py) - [ConsoleServerPort](examples/console_server_port.py) - [Device](examples/device.py) - [DeviceBay](examples/device_bay.py) -- [DeviceConfig](examples/device_config.py) - [DeviceRole](examples/device_role.py) - [DeviceType](examples/device_type.py) - [FrontPort](examples/front_port.py) @@ -124,6 +124,10 @@ Switch between patterns by uncommenting the desired function call in `main()`. - [VLANTranslationRule](examples/vlan_translation_rule.py) - [VRF](examples/vrf.py) +### Other + +- [DeviceConfig](examples/device_config.py) + ### Tenancy - [Contact](examples/contact.py) diff --git a/docs/examples/aggregate.py b/docs/examples/aggregate.py index d64b66b..c2ae030 100644 --- a/docs/examples/aggregate.py +++ b/docs/examples/aggregate.py @@ -7,26 +7,24 @@ - aggregate_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Aggregate, + Entity, RIR, Tag, Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "aggregate-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an Aggregate entity.""" + """Main execution - demonstrates ingesting a Aggregate entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -35,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = aggregate_minimal() - # entity = aggregate_extended() - # entity = aggregate_explicit() + aggregate = aggregate_minimal() + # aggregate = aggregate_extended() + # aggregate = aggregate_explicit() - response = client.ingest(entities=[Entity(aggregate=entity)]) + response = client.ingest(entities=[Entity(aggregate=aggregate)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -47,45 +45,38 @@ def main(): def aggregate_minimal() -> Aggregate: - """Create an Aggregate with only required fields using flat strings.""" + """Create a Aggregate with only required fields using flat strings.""" return Aggregate( prefix="192.0.2.0/24", - rir="example-rir", # flat string -> RIR + rir="Example RIR", # flat string -> RIR metadata={"source": "example"}, ) def aggregate_extended() -> Aggregate: - """Create an Aggregate with common optional fields.""" + """Create a Aggregate with common optional fields.""" return Aggregate( prefix="192.0.2.0/24", - rir="example-rir", - description="Example description", - comments="Example comments", + rir="Example RIR", metadata={"source": "example"}, + description="Example description", ) def aggregate_explicit() -> Aggregate: - """Create an Aggregate with fully nested objects and all common fields.""" + """Create a Aggregate with fully nested objects and all common fields.""" return Aggregate( prefix="192.0.2.0/24", rir=RIR( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), + metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/asn.py b/docs/examples/asn.py index d6f997d..698cce7 100644 --- a/docs/examples/asn.py +++ b/docs/examples/asn.py @@ -7,25 +7,23 @@ - asn_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, ASN, + Entity, Tag, Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "asn-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an ASN entity.""" + """Main execution - demonstrates ingesting a ASN entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = asn_minimal() - # entity = asn_extended() - # entity = asn_explicit() + asn = asn_minimal() + # asn = asn_extended() + # asn = asn_explicit() - response = client.ingest(entities=[Entity(asn=entity)]) + response = client.ingest(entities=[Entity(asn=asn)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,36 +44,33 @@ def main(): def asn_minimal() -> ASN: - """Create an ASN with only required fields using flat strings.""" + """Create a ASN with only required fields using flat strings.""" return ASN( - asn=65001, + asn=64512, metadata={"source": "example"}, ) def asn_extended() -> ASN: - """Create an ASN with common optional fields.""" + """Create a ASN with common optional fields.""" return ASN( - asn=65001, - description="Example description", - comments="Example comments", + asn=64512, metadata={"source": "example"}, + description="Example description", ) def asn_explicit() -> ASN: - """Create an ASN with fully nested objects and all common fields.""" + """Create a ASN with fully nested objects and all common fields.""" return ASN( - asn=65001, + asn=64512, + metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/asn_range.py b/docs/examples/asn_range.py index f8b9929..492504e 100644 --- a/docs/examples/asn_range.py +++ b/docs/examples/asn_range.py @@ -7,26 +7,24 @@ - asn_range_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, ASNRange, + Entity, RIR, Tag, Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "asn_range-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an ASNRange entity.""" + """Main execution - demonstrates ingesting a ASNRange entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -35,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = asn_range_minimal() - # entity = asn_range_extended() - # entity = asn_range_explicit() + asn_range = asn_range_minimal() + # asn_range = asn_range_extended() + # asn_range = asn_range_explicit() - response = client.ingest(entities=[Entity(asn_range=entity)]) + response = client.ingest(entities=[Entity(asn_range=asn_range)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -47,11 +45,11 @@ def main(): def asn_range_minimal() -> ASNRange: - """Create an ASNRange with only required fields using flat strings.""" + """Create a ASNRange with only required fields using flat strings.""" return ASNRange( name="Example Name", slug="example-slug", - rir="example-rir", # flat string -> RIR + rir="Example RIR", # flat string -> RIR start=1, end=1, metadata={"source": "example"}, @@ -59,42 +57,35 @@ def asn_range_minimal() -> ASNRange: def asn_range_extended() -> ASNRange: - """Create an ASNRange with common optional fields.""" + """Create a ASNRange with common optional fields.""" return ASNRange( name="Example Name", slug="example-slug", - rir="example-rir", + rir="Example RIR", start=1, end=1, - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) def asn_range_explicit() -> ASNRange: - """Create an ASNRange with fully nested objects and all common fields.""" + """Create a ASNRange with fully nested objects and all common fields.""" return ASNRange( name="Example Name", slug="example-slug", rir=RIR( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), start=1, end=1, + metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/cable.py b/docs/examples/cable.py index e0f58e6..c3bc9c3 100644 --- a/docs/examples/cable.py +++ b/docs/examples/cable.py @@ -7,21 +7,19 @@ - cable_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Cable, + Entity, Tag, Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "cable-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = cable_minimal() - # entity = cable_extended() - # entity = cable_explicit() + cable = cable_minimal() + # cable = cable_extended() + # cable = cable_explicit() - response = client.ingest(entities=[Entity(cable=entity)]) + response = client.ingest(entities=[Entity(cable=cable)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -55,30 +53,25 @@ def cable_minimal() -> Cable: def cable_extended() -> Cable: """Create a Cable with common optional fields.""" return Cable( + metadata={"source": "example"}, status="connected", - label="Example label", color="0000ff", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) def cable_explicit() -> Cable: """Create a Cable with fully nested objects and all common fields.""" return Cable( + metadata={"source": "example"}, status="connected", - label="Example label", color="0000ff", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/cable_path.py b/docs/examples/cable_path.py index fc03902..4bdd078 100644 --- a/docs/examples/cable_path.py +++ b/docs/examples/cable_path.py @@ -7,19 +7,13 @@ - cable_path_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - CablePath, -) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "cable_path-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -32,11 +26,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = cable_path_minimal() - # entity = cable_path_extended() - # entity = cable_path_explicit() + cable_path = cable_path_minimal() + # cable_path = cable_path_extended() + # cable_path = cable_path_explicit() - response = client.ingest(entities=[Entity(cable_path=entity)]) + response = client.ingest(entities=[Entity(cable_path=cable_path)]) if response.errors: print(f"Errors: {response.errors}") else: diff --git a/docs/examples/circuit.py b/docs/examples/circuit.py index 91bdf84..7364e6c 100644 --- a/docs/examples/circuit.py +++ b/docs/examples/circuit.py @@ -7,23 +7,21 @@ - circuit_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Circuit, CircuitType, + Entity, Provider, Tag, Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "circuit-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -36,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = circuit_minimal() - # entity = circuit_extended() - # entity = circuit_explicit() + circuit = circuit_minimal() + # circuit = circuit_extended() + # circuit = circuit_explicit() - response = client.ingest(entities=[Entity(circuit=entity)]) + response = client.ingest(entities=[Entity(circuit=circuit)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -51,8 +49,8 @@ def circuit_minimal() -> Circuit: """Create a Circuit with only required fields using flat strings.""" return Circuit( cid="CID-001", - provider="example-provider", # flat string -> Provider - type="example-type", # flat string -> CircuitType + provider="Example Provider", # flat string -> Provider + type="Example Type", # flat string -> CircuitType metadata={"source": "example"}, ) @@ -61,12 +59,11 @@ def circuit_extended() -> Circuit: """Create a Circuit with common optional fields.""" return Circuit( cid="CID-001", - provider="example-provider", - type="example-type", + provider="Example Provider", + type="Example Type", + metadata={"source": "example"}, status="active", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -75,30 +72,22 @@ def circuit_explicit() -> Circuit: return Circuit( cid="CID-001", provider=Provider( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), type=CircuitType( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), + metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/circuit_group.py b/docs/examples/circuit_group.py index b72fa85..02520ed 100644 --- a/docs/examples/circuit_group.py +++ b/docs/examples/circuit_group.py @@ -7,21 +7,19 @@ - circuit_group_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, CircuitGroup, + Entity, Tag, Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "circuit_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = circuit_group_minimal() - # entity = circuit_group_extended() - # entity = circuit_group_explicit() + circuit_group = circuit_group_minimal() + # circuit_group = circuit_group_extended() + # circuit_group = circuit_group_explicit() - response = client.ingest(entities=[Entity(circuit_group=entity)]) + response = client.ingest(entities=[Entity(circuit_group=circuit_group)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -59,9 +57,8 @@ def circuit_group_extended() -> CircuitGroup: return CircuitGroup( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -70,15 +67,13 @@ def circuit_group_explicit() -> CircuitGroup: return CircuitGroup( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/circuit_group_assignment.py b/docs/examples/circuit_group_assignment.py index 3629c2e..31fcd2a 100644 --- a/docs/examples/circuit_group_assignment.py +++ b/docs/examples/circuit_group_assignment.py @@ -7,21 +7,19 @@ - circuit_group_assignment_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, CircuitGroup, CircuitGroupAssignment, + Entity, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "circuit_group_assignment-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = circuit_group_assignment_minimal() - # entity = circuit_group_assignment_extended() - # entity = circuit_group_assignment_explicit() + circuit_group_assignment = circuit_group_assignment_minimal() + # circuit_group_assignment = circuit_group_assignment_extended() + # circuit_group_assignment = circuit_group_assignment_explicit() - response = client.ingest(entities=[Entity(circuit_group_assignment=entity)]) + response = client.ingest( + entities=[Entity(circuit_group_assignment=circuit_group_assignment)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +48,7 @@ def main(): def circuit_group_assignment_minimal() -> CircuitGroupAssignment: """Create a CircuitGroupAssignment with only required fields using flat strings.""" return CircuitGroupAssignment( - group="example-group", # flat string -> CircuitGroup + group="Example Group", # flat string -> CircuitGroup metadata={"source": "example"}, ) @@ -56,7 +56,7 @@ def circuit_group_assignment_minimal() -> CircuitGroupAssignment: def circuit_group_assignment_extended() -> CircuitGroupAssignment: """Create a CircuitGroupAssignment with common optional fields.""" return CircuitGroupAssignment( - group="example-group", + group="Example Group", metadata={"source": "example"}, ) @@ -65,14 +65,10 @@ def circuit_group_assignment_explicit() -> CircuitGroupAssignment: """Create a CircuitGroupAssignment with fully nested objects and all common fields.""" return CircuitGroupAssignment( group=CircuitGroup( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), - tags=[Tag(name="production")], metadata={"source": "example"}, + tags=[Tag(name="production")], ) diff --git a/docs/examples/circuit_termination.py b/docs/examples/circuit_termination.py index bc459c2..ebf841b 100644 --- a/docs/examples/circuit_termination.py +++ b/docs/examples/circuit_termination.py @@ -7,23 +7,21 @@ - circuit_termination_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Circuit, CircuitTermination, CircuitType, + Entity, Provider, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "circuit_termination-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -36,11 +34,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = circuit_termination_minimal() - # entity = circuit_termination_extended() - # entity = circuit_termination_explicit() + circuit_termination = circuit_termination_minimal() + # circuit_termination = circuit_termination_extended() + # circuit_termination = circuit_termination_explicit() - response = client.ingest(entities=[Entity(circuit_termination=entity)]) + response = client.ingest( + entities=[Entity(circuit_termination=circuit_termination)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +50,7 @@ def main(): def circuit_termination_minimal() -> CircuitTermination: """Create a CircuitTermination with only required fields using flat strings.""" return CircuitTermination( - circuit="example-circuit", # flat string -> Circuit + circuit="Example Circuit", # flat string -> Circuit term_side="A", metadata={"source": "example"}, ) @@ -59,10 +59,10 @@ def circuit_termination_minimal() -> CircuitTermination: def circuit_termination_extended() -> CircuitTermination: """Create a CircuitTermination with common optional fields.""" return CircuitTermination( - circuit="example-circuit", + circuit="Example Circuit", term_side="A", - description="Example description", metadata={"source": "example"}, + description="Example description", ) @@ -72,29 +72,21 @@ def circuit_termination_explicit() -> CircuitTermination: circuit=Circuit( cid="CID-001", provider=Provider( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), type=CircuitType( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), term_side="A", + metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/circuit_type.py b/docs/examples/circuit_type.py index 05d17b6..98fea08 100644 --- a/docs/examples/circuit_type.py +++ b/docs/examples/circuit_type.py @@ -7,20 +7,18 @@ - circuit_type_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, CircuitType, + Entity, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "circuit_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = circuit_type_minimal() - # entity = circuit_type_extended() - # entity = circuit_type_explicit() + circuit_type = circuit_type_minimal() + # circuit_type = circuit_type_extended() + # circuit_type = circuit_type_explicit() - response = client.ingest(entities=[Entity(circuit_type=entity)]) + response = client.ingest(entities=[Entity(circuit_type=circuit_type)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,10 +56,9 @@ def circuit_type_extended() -> CircuitType: return CircuitType( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -70,11 +67,11 @@ def circuit_type_explicit() -> CircuitType: return CircuitType( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/cluster.py b/docs/examples/cluster.py index dbdd13c..6b37003 100644 --- a/docs/examples/cluster.py +++ b/docs/examples/cluster.py @@ -7,22 +7,20 @@ - cluster_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Cluster, ClusterType, + Entity, Tag, Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "cluster-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -35,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = cluster_minimal() - # entity = cluster_extended() - # entity = cluster_explicit() + cluster = cluster_minimal() + # cluster = cluster_extended() + # cluster = cluster_explicit() - response = client.ingest(entities=[Entity(cluster=entity)]) + response = client.ingest(entities=[Entity(cluster=cluster)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +48,7 @@ def cluster_minimal() -> Cluster: """Create a Cluster with only required fields using flat strings.""" return Cluster( name="Example Name", - type="example-type", # flat string -> ClusterType + type="Example Type", # flat string -> ClusterType metadata={"source": "example"}, ) @@ -59,11 +57,10 @@ def cluster_extended() -> Cluster: """Create a Cluster with common optional fields.""" return Cluster( name="Example Name", - type="example-type", + type="Example Type", + metadata={"source": "example"}, status="active", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -72,22 +69,16 @@ def cluster_explicit() -> Cluster: return Cluster( name="Example Name", type=ClusterType( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), + metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/cluster_group.py b/docs/examples/cluster_group.py index f06d6ac..9d48651 100644 --- a/docs/examples/cluster_group.py +++ b/docs/examples/cluster_group.py @@ -7,20 +7,18 @@ - cluster_group_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, ClusterGroup, + Entity, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "cluster_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = cluster_group_minimal() - # entity = cluster_group_extended() - # entity = cluster_group_explicit() + cluster_group = cluster_group_minimal() + # cluster_group = cluster_group_extended() + # cluster_group = cluster_group_explicit() - response = client.ingest(entities=[Entity(cluster_group=entity)]) + response = client.ingest(entities=[Entity(cluster_group=cluster_group)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def cluster_group_extended() -> ClusterGroup: return ClusterGroup( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def cluster_group_explicit() -> ClusterGroup: return ClusterGroup( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/cluster_type.py b/docs/examples/cluster_type.py index b2dd5a9..f03b059 100644 --- a/docs/examples/cluster_type.py +++ b/docs/examples/cluster_type.py @@ -7,20 +7,18 @@ - cluster_type_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, ClusterType, + Entity, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "cluster_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = cluster_type_minimal() - # entity = cluster_type_extended() - # entity = cluster_type_explicit() + cluster_type = cluster_type_minimal() + # cluster_type = cluster_type_extended() + # cluster_type = cluster_type_explicit() - response = client.ingest(entities=[Entity(cluster_type=entity)]) + response = client.ingest(entities=[Entity(cluster_type=cluster_type)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def cluster_type_extended() -> ClusterType: return ClusterType( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def cluster_type_explicit() -> ClusterType: return ClusterType( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/console_port.py b/docs/examples/console_port.py index 80690c6..2be7044 100644 --- a/docs/examples/console_port.py +++ b/docs/examples/console_port.py @@ -7,25 +7,23 @@ - console_port_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, ConsolePort, Device, DeviceRole, DeviceType, + Entity, Manufacturer, Site, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "console_port-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -38,11 +36,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = console_port_minimal() - # entity = console_port_extended() - # entity = console_port_explicit() + console_port = console_port_minimal() + # console_port = console_port_extended() + # console_port = console_port_explicit() - response = client.ingest(entities=[Entity(console_port=entity)]) + response = client.ingest(entities=[Entity(console_port=console_port)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -52,7 +50,7 @@ def main(): def console_port_minimal() -> ConsolePort: """Create a ConsolePort with only required fields using flat strings.""" return ConsolePort( - device="example-device", # flat string -> Device + device="Example Device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -61,11 +59,10 @@ def console_port_minimal() -> ConsolePort: def console_port_extended() -> ConsolePort: """Create a ConsolePort with common optional fields.""" return ConsolePort( - device="example-device", + device="Example Device", name="Example Name", - label="Example label", - description="Example description", metadata={"source": "example"}, + description="Example description", ) @@ -77,44 +74,31 @@ def console_port_explicit() -> ConsolePort: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", + metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/console_server_port.py b/docs/examples/console_server_port.py index 0e8d110..5b349d9 100644 --- a/docs/examples/console_server_port.py +++ b/docs/examples/console_server_port.py @@ -7,25 +7,23 @@ - console_server_port_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, ConsoleServerPort, Device, DeviceRole, DeviceType, + Entity, Manufacturer, Site, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "console_server_port-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -38,11 +36,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = console_server_port_minimal() - # entity = console_server_port_extended() - # entity = console_server_port_explicit() + console_server_port = console_server_port_minimal() + # console_server_port = console_server_port_extended() + # console_server_port = console_server_port_explicit() - response = client.ingest(entities=[Entity(console_server_port=entity)]) + response = client.ingest( + entities=[Entity(console_server_port=console_server_port)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -52,7 +52,7 @@ def main(): def console_server_port_minimal() -> ConsoleServerPort: """Create a ConsoleServerPort with only required fields using flat strings.""" return ConsoleServerPort( - device="example-device", # flat string -> Device + device="Example Device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -61,11 +61,10 @@ def console_server_port_minimal() -> ConsoleServerPort: def console_server_port_extended() -> ConsoleServerPort: """Create a ConsoleServerPort with common optional fields.""" return ConsoleServerPort( - device="example-device", + device="Example Device", name="Example Name", - label="Example label", - description="Example description", metadata={"source": "example"}, + description="Example description", ) @@ -77,44 +76,31 @@ def console_server_port_explicit() -> ConsoleServerPort: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", + metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/contact.py b/docs/examples/contact.py index e50786b..ec0380a 100644 --- a/docs/examples/contact.py +++ b/docs/examples/contact.py @@ -7,20 +7,18 @@ - contact_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Contact, + Entity, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "contact-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = contact_minimal() - # entity = contact_extended() - # entity = contact_explicit() + contact = contact_minimal() + # contact = contact_extended() + # contact = contact_explicit() - response = client.ingest(entities=[Entity(contact=entity)]) + response = client.ingest(entities=[Entity(contact=contact)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,9 +54,8 @@ def contact_extended() -> Contact: """Create a Contact with common optional fields.""" return Contact( name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -66,10 +63,10 @@ def contact_explicit() -> Contact: """Create a Contact with fully nested objects and all common fields.""" return Contact( name="Example Name", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/contact_assignment.py b/docs/examples/contact_assignment.py index 21b8161..b527fc7 100644 --- a/docs/examples/contact_assignment.py +++ b/docs/examples/contact_assignment.py @@ -7,21 +7,19 @@ - contact_assignment_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Contact, ContactAssignment, + Entity, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "contact_assignment-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = contact_assignment_minimal() - # entity = contact_assignment_extended() - # entity = contact_assignment_explicit() + contact_assignment = contact_assignment_minimal() + # contact_assignment = contact_assignment_extended() + # contact_assignment = contact_assignment_explicit() - response = client.ingest(entities=[Entity(contact_assignment=entity)]) + response = client.ingest( + entities=[Entity(contact_assignment=contact_assignment)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +48,7 @@ def main(): def contact_assignment_minimal() -> ContactAssignment: """Create a ContactAssignment with only required fields using flat strings.""" return ContactAssignment( - contact="example-contact", # flat string -> Contact + contact="Example Contact", # flat string -> Contact metadata={"source": "example"}, ) @@ -56,7 +56,7 @@ def contact_assignment_minimal() -> ContactAssignment: def contact_assignment_extended() -> ContactAssignment: """Create a ContactAssignment with common optional fields.""" return ContactAssignment( - contact="example-contact", + contact="Example Contact", metadata={"source": "example"}, ) @@ -64,14 +64,9 @@ def contact_assignment_extended() -> ContactAssignment: def contact_assignment_explicit() -> ContactAssignment: """Create a ContactAssignment with fully nested objects and all common fields.""" return ContactAssignment( - contact=Contact( - name="Example Name", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, - ), - tags=[Tag(name="production")], + contact=Contact(name="Example Name", metadata={"source": "example"}), metadata={"source": "example"}, + tags=[Tag(name="production")], ) diff --git a/docs/examples/contact_group.py b/docs/examples/contact_group.py index e041618..4038984 100644 --- a/docs/examples/contact_group.py +++ b/docs/examples/contact_group.py @@ -7,20 +7,18 @@ - contact_group_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, ContactGroup, + Entity, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "contact_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = contact_group_minimal() - # entity = contact_group_extended() - # entity = contact_group_explicit() + contact_group = contact_group_minimal() + # contact_group = contact_group_extended() + # contact_group = contact_group_explicit() - response = client.ingest(entities=[Entity(contact_group=entity)]) + response = client.ingest(entities=[Entity(contact_group=contact_group)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def contact_group_extended() -> ContactGroup: return ContactGroup( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def contact_group_explicit() -> ContactGroup: return ContactGroup( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/contact_role.py b/docs/examples/contact_role.py index ac5d568..2bfa99a 100644 --- a/docs/examples/contact_role.py +++ b/docs/examples/contact_role.py @@ -7,20 +7,18 @@ - contact_role_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, ContactRole, + Entity, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "contact_role-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = contact_role_minimal() - # entity = contact_role_extended() - # entity = contact_role_explicit() + contact_role = contact_role_minimal() + # contact_role = contact_role_extended() + # contact_role = contact_role_explicit() - response = client.ingest(entities=[Entity(contact_role=entity)]) + response = client.ingest(entities=[Entity(contact_role=contact_role)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def contact_role_extended() -> ContactRole: return ContactRole( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def contact_role_explicit() -> ContactRole: return ContactRole( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/custom_field.py b/docs/examples/custom_field.py index 853639e..77d61e1 100644 --- a/docs/examples/custom_field.py +++ b/docs/examples/custom_field.py @@ -7,19 +7,13 @@ - custom_field_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - CustomField, -) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "custom_field-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -32,11 +26,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = custom_field_minimal() - # entity = custom_field_extended() - # entity = custom_field_explicit() + custom_field = custom_field_minimal() + # custom_field = custom_field_extended() + # custom_field = custom_field_explicit() - response = client.ingest(entities=[Entity(custom_field=entity)]) + response = client.ingest(entities=[Entity(custom_field=custom_field)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -57,10 +51,8 @@ def custom_field_extended() -> CustomField: return CustomField( type="boolean", name="Example Name", - label="Example label", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +61,9 @@ def custom_field_explicit() -> CustomField: return CustomField( type="boolean", name="Example Name", - label="Example label", + metadata={"source": "example"}, description="Example description", comments="Example comments", - metadata={"source": "example"}, ) diff --git a/docs/examples/custom_field_choice_set.py b/docs/examples/custom_field_choice_set.py index f8b5ba9..80cf659 100644 --- a/docs/examples/custom_field_choice_set.py +++ b/docs/examples/custom_field_choice_set.py @@ -7,19 +7,13 @@ - custom_field_choice_set_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - CustomFieldChoiceSet, -) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "custom_field_choice_set-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -32,11 +26,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = custom_field_choice_set_minimal() - # entity = custom_field_choice_set_extended() - # entity = custom_field_choice_set_explicit() + custom_field_choice_set = custom_field_choice_set_minimal() + # custom_field_choice_set = custom_field_choice_set_extended() + # custom_field_choice_set = custom_field_choice_set_explicit() - response = client.ingest(entities=[Entity(custom_field_choice_set=entity)]) + response = client.ingest( + entities=[Entity(custom_field_choice_set=custom_field_choice_set)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -55,8 +51,8 @@ def custom_field_choice_set_extended() -> CustomFieldChoiceSet: """Create a CustomFieldChoiceSet with common optional fields.""" return CustomFieldChoiceSet( name="Example Name", - description="Example description", metadata={"source": "example"}, + description="Example description", ) @@ -64,8 +60,8 @@ def custom_field_choice_set_explicit() -> CustomFieldChoiceSet: """Create a CustomFieldChoiceSet with fully nested objects and all common fields.""" return CustomFieldChoiceSet( name="Example Name", - description="Example description", metadata={"source": "example"}, + description="Example description", ) diff --git a/docs/examples/custom_link.py b/docs/examples/custom_link.py index e5bfe7c..e920a42 100644 --- a/docs/examples/custom_link.py +++ b/docs/examples/custom_link.py @@ -7,19 +7,13 @@ - custom_link_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - CustomLink, -) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "custom_link-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -32,11 +26,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = custom_link_minimal() - # entity = custom_link_extended() - # entity = custom_link_explicit() + custom_link = custom_link_minimal() + # custom_link = custom_link_extended() + # custom_link = custom_link_explicit() - response = client.ingest(entities=[Entity(custom_link=entity)]) + response = client.ingest(entities=[Entity(custom_link=custom_link)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -47,8 +41,8 @@ def custom_link_minimal() -> CustomLink: """Create a CustomLink with only required fields using flat strings.""" return CustomLink( name="Example Name", - link_text="example-link-text", - link_url="example-link-url", + link_text="Example Link Text", + link_url="Example Link Url", metadata={"source": "example"}, ) @@ -57,8 +51,8 @@ def custom_link_extended() -> CustomLink: """Create a CustomLink with common optional fields.""" return CustomLink( name="Example Name", - link_text="example-link-text", - link_url="example-link-url", + link_text="Example Link Text", + link_url="Example Link Url", metadata={"source": "example"}, ) @@ -67,8 +61,8 @@ def custom_link_explicit() -> CustomLink: """Create a CustomLink with fully nested objects and all common fields.""" return CustomLink( name="Example Name", - link_text="example-link-text", - link_url="example-link-url", + link_text="Example Link Text", + link_url="Example Link Url", metadata={"source": "example"}, ) diff --git a/docs/examples/device.py b/docs/examples/device.py index e0a9e5a..08350ef 100644 --- a/docs/examples/device.py +++ b/docs/examples/device.py @@ -7,14 +7,12 @@ - device_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, Manufacturer, Platform, Site, @@ -22,11 +20,11 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "device-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -39,11 +37,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = device_minimal() - # entity = device_extended() - # entity = device_explicit() + device = device_minimal() + # device = device_extended() + # device = device_explicit() - response = client.ingest(entities=[Entity(device=entity)]) + response = client.ingest(entities=[Entity(device=device)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -53,9 +51,9 @@ def main(): def device_minimal() -> Device: """Create a Device with only required fields using flat strings.""" return Device( - device_type="example-device-type", # flat string -> DeviceType - role="example-role", # flat string -> DeviceRole - site="example-site", # flat string -> Site + device_type="Model X", # flat string -> DeviceType + role="Example Role", # flat string -> DeviceRole + site="Example Site", # flat string -> Site metadata={"source": "example"}, ) @@ -63,15 +61,13 @@ def device_minimal() -> Device: def device_extended() -> Device: """Create a Device with common optional fields.""" return Device( - device_type="example-device-type", - role="example-role", - site="example-site", + device_type="Model X", + role="Example Role", + site="Example Site", + metadata={"source": "example"}, serial="SN-001234", - asset_tag="ASSET-001", status="active", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -80,51 +76,37 @@ def device_explicit() -> Device: return Device( device_type=DeviceType( manufacturer=Manufacturer( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), + metadata={"source": "example"}, serial="SN-001234", asset_tag="ASSET-001", status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), platform=Platform( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/device_bay.py b/docs/examples/device_bay.py index 928aa9e..5fc92db 100644 --- a/docs/examples/device_bay.py +++ b/docs/examples/device_bay.py @@ -7,25 +7,23 @@ - device_bay_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceBay, DeviceRole, DeviceType, + Entity, Manufacturer, Site, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "device_bay-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -38,11 +36,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = device_bay_minimal() - # entity = device_bay_extended() - # entity = device_bay_explicit() + device_bay = device_bay_minimal() + # device_bay = device_bay_extended() + # device_bay = device_bay_explicit() - response = client.ingest(entities=[Entity(device_bay=entity)]) + response = client.ingest(entities=[Entity(device_bay=device_bay)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -52,7 +50,7 @@ def main(): def device_bay_minimal() -> DeviceBay: """Create a DeviceBay with only required fields using flat strings.""" return DeviceBay( - device="example-device", # flat string -> Device + device="Example Device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -61,11 +59,10 @@ def device_bay_minimal() -> DeviceBay: def device_bay_extended() -> DeviceBay: """Create a DeviceBay with common optional fields.""" return DeviceBay( - device="example-device", + device="Example Device", name="Example Name", - label="Example label", - description="Example description", metadata={"source": "example"}, + description="Example description", ) @@ -77,44 +74,31 @@ def device_bay_explicit() -> DeviceBay: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", + metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/device_config.py b/docs/examples/device_config.py index 0fd1ef5..7e7d301 100644 --- a/docs/examples/device_config.py +++ b/docs/examples/device_config.py @@ -7,19 +7,13 @@ - device_config_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - DeviceConfig, -) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "device_config-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -32,11 +26,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = device_config_minimal() - # entity = device_config_extended() - # entity = device_config_explicit() + device_config = device_config_minimal() + # device_config = device_config_extended() + # device_config = device_config_explicit() - response = client.ingest(entities=[Entity(device_config=entity)]) + response = client.ingest(entities=[Entity(device_config=device_config)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,9 +40,9 @@ def main(): def device_config_minimal() -> DeviceConfig: """Create a DeviceConfig with only required fields using flat strings.""" return DeviceConfig( - startup=b"example startup", - running=b"example running", - candidate=b"example candidate", + startup=b"example data", + running=b"example data", + candidate=b"example data", metadata={"source": "example"}, ) @@ -56,9 +50,9 @@ def device_config_minimal() -> DeviceConfig: def device_config_extended() -> DeviceConfig: """Create a DeviceConfig with common optional fields.""" return DeviceConfig( - startup=b"example startup", - running=b"example running", - candidate=b"example candidate", + startup=b"example data", + running=b"example data", + candidate=b"example data", metadata={"source": "example"}, ) @@ -66,9 +60,9 @@ def device_config_extended() -> DeviceConfig: def device_config_explicit() -> DeviceConfig: """Create a DeviceConfig with fully nested objects and all common fields.""" return DeviceConfig( - startup=b"example startup", - running=b"example running", - candidate=b"example candidate", + startup=b"example data", + running=b"example data", + candidate=b"example data", metadata={"source": "example"}, ) diff --git a/docs/examples/device_role.py b/docs/examples/device_role.py index dfa1950..df11336 100644 --- a/docs/examples/device_role.py +++ b/docs/examples/device_role.py @@ -7,20 +7,18 @@ - device_role_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, DeviceRole, + Entity, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "device_role-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = device_role_minimal() - # entity = device_role_extended() - # entity = device_role_explicit() + device_role = device_role_minimal() + # device_role = device_role_extended() + # device_role = device_role_explicit() - response = client.ingest(entities=[Entity(device_role=entity)]) + response = client.ingest(entities=[Entity(device_role=device_role)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,10 +56,9 @@ def device_role_extended() -> DeviceRole: return DeviceRole( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -70,11 +67,11 @@ def device_role_explicit() -> DeviceRole: return DeviceRole( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/device_type.py b/docs/examples/device_type.py index c47da2b..a98e754 100644 --- a/docs/examples/device_type.py +++ b/docs/examples/device_type.py @@ -7,21 +7,19 @@ - device_type_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, DeviceType, + Entity, Manufacturer, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "device_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = device_type_minimal() - # entity = device_type_extended() - # entity = device_type_explicit() + device_type = device_type_minimal() + # device_type = device_type_extended() + # device_type = device_type_explicit() - response = client.ingest(entities=[Entity(device_type=entity)]) + response = client.ingest(entities=[Entity(device_type=device_type)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +46,7 @@ def main(): def device_type_minimal() -> DeviceType: """Create a DeviceType with only required fields using flat strings.""" return DeviceType( - manufacturer="example-manufacturer", # flat string -> Manufacturer + manufacturer="Example Manufacturer", # flat string -> Manufacturer model="Model X", slug="example-slug", metadata={"source": "example"}, @@ -58,12 +56,11 @@ def device_type_minimal() -> DeviceType: def device_type_extended() -> DeviceType: """Create a DeviceType with common optional fields.""" return DeviceType( - manufacturer="example-manufacturer", + manufacturer="Example Manufacturer", model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -71,18 +68,14 @@ def device_type_explicit() -> DeviceType: """Create a DeviceType with fully nested objects and all common fields.""" return DeviceType( manufacturer=Manufacturer( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), model="Model X", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/fhrp_group.py b/docs/examples/fhrp_group.py index 93d64ce..6367166 100644 --- a/docs/examples/fhrp_group.py +++ b/docs/examples/fhrp_group.py @@ -7,8 +7,6 @@ - fhrp_group_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "fhrp_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = fhrp_group_minimal() - # entity = fhrp_group_extended() - # entity = fhrp_group_explicit() + fhrp_group = fhrp_group_minimal() + # fhrp_group = fhrp_group_extended() + # fhrp_group = fhrp_group_explicit() - response = client.ingest(entities=[Entity(fhrp_group=entity)]) + response = client.ingest(entities=[Entity(fhrp_group=fhrp_group)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def fhrp_group_extended() -> FHRPGroup: return FHRPGroup( protocol="carp", group_id=1, - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def fhrp_group_explicit() -> FHRPGroup: return FHRPGroup( protocol="carp", group_id=1, + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/fhrp_group_assignment.py b/docs/examples/fhrp_group_assignment.py index 259dcbe..9ea731b 100644 --- a/docs/examples/fhrp_group_assignment.py +++ b/docs/examples/fhrp_group_assignment.py @@ -7,8 +7,6 @@ - fhrp_group_assignment_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ FHRPGroupAssignment, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "fhrp_group_assignment-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = fhrp_group_assignment_minimal() - # entity = fhrp_group_assignment_extended() - # entity = fhrp_group_assignment_explicit() + fhrp_group_assignment = fhrp_group_assignment_minimal() + # fhrp_group_assignment = fhrp_group_assignment_extended() + # fhrp_group_assignment = fhrp_group_assignment_explicit() - response = client.ingest(entities=[Entity(fhrp_group_assignment=entity)]) + response = client.ingest( + entities=[Entity(fhrp_group_assignment=fhrp_group_assignment)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -47,7 +47,7 @@ def main(): def fhrp_group_assignment_minimal() -> FHRPGroupAssignment: """Create a FHRPGroupAssignment with only required fields using flat strings.""" return FHRPGroupAssignment( - group="example-group", # flat string -> FHRPGroup + group="Example Group", # flat string -> FHRPGroup priority=1, metadata={"source": "example"}, ) @@ -56,7 +56,7 @@ def fhrp_group_assignment_minimal() -> FHRPGroupAssignment: def fhrp_group_assignment_extended() -> FHRPGroupAssignment: """Create a FHRPGroupAssignment with common optional fields.""" return FHRPGroupAssignment( - group="example-group", + group="Example Group", priority=1, metadata={"source": "example"}, ) @@ -66,11 +66,7 @@ def fhrp_group_assignment_explicit() -> FHRPGroupAssignment: """Create a FHRPGroupAssignment with fully nested objects and all common fields.""" return FHRPGroupAssignment( group=FHRPGroup( - protocol="carp", - group_id=1, - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + protocol="Example Protocol", group_id=1, metadata={"source": "example"} ), priority=1, metadata={"source": "example"}, diff --git a/docs/examples/front_port.py b/docs/examples/front_port.py index 066342f..46260ae 100644 --- a/docs/examples/front_port.py +++ b/docs/examples/front_port.py @@ -7,14 +7,12 @@ - front_port_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, FrontPort, Manufacturer, RearPort, @@ -22,11 +20,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "front_port-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -39,11 +37,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = front_port_minimal() - # entity = front_port_extended() - # entity = front_port_explicit() + front_port = front_port_minimal() + # front_port = front_port_extended() + # front_port = front_port_explicit() - response = client.ingest(entities=[Entity(front_port=entity)]) + response = client.ingest(entities=[Entity(front_port=front_port)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -53,10 +51,10 @@ def main(): def front_port_minimal() -> FrontPort: """Create a FrontPort with only required fields using flat strings.""" return FrontPort( - device="example-device", # flat string -> Device + device="Example Device", # flat string -> Device name="Example Name", type="110-punch", - rear_port="example-rear-port", # flat string -> RearPort + rear_port="Example Rear Port", # flat string -> RearPort metadata={"source": "example"}, ) @@ -64,14 +62,13 @@ def front_port_minimal() -> FrontPort: def front_port_extended() -> FrontPort: """Create a FrontPort with common optional fields.""" return FrontPort( - device="example-device", + device="Example Device", name="Example Name", type="110-punch", - rear_port="example-rear-port", - label="Example label", + rear_port="Example Rear Port", + metadata={"source": "example"}, color="0000ff", description="Example description", - metadata={"source": "example"}, ) @@ -83,37 +80,25 @@ def front_port_explicit() -> FrontPort: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", @@ -124,51 +109,36 @@ def front_port_explicit() -> FrontPort: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", - type="110-punch", + type="Example Type", color="0000ff", - description="Example description", metadata={"source": "example"}, ), - label="Example label", + metadata={"source": "example"}, color="0000ff", description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/ike_policy.py b/docs/examples/ike_policy.py index b2f6666..dcb89bc 100644 --- a/docs/examples/ike_policy.py +++ b/docs/examples/ike_policy.py @@ -7,8 +7,6 @@ - ike_policy_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,15 +14,15 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "ike_policy-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an IKEPolicy entity.""" + """Main execution - demonstrates ingesting a IKEPolicy entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = ike_policy_minimal() - # entity = ike_policy_extended() - # entity = ike_policy_explicit() + ike_policy = ike_policy_minimal() + # ike_policy = ike_policy_extended() + # ike_policy = ike_policy_explicit() - response = client.ingest(entities=[Entity(ike_policy=entity)]) + response = client.ingest(entities=[Entity(ike_policy=ike_policy)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -45,7 +43,7 @@ def main(): def ike_policy_minimal() -> IKEPolicy: - """Create an IKEPolicy with only required fields using flat strings.""" + """Create a IKEPolicy with only required fields using flat strings.""" return IKEPolicy( name="Example Name", version=1, @@ -54,25 +52,24 @@ def ike_policy_minimal() -> IKEPolicy: def ike_policy_extended() -> IKEPolicy: - """Create an IKEPolicy with common optional fields.""" + """Create a IKEPolicy with common optional fields.""" return IKEPolicy( name="Example Name", version=1, - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) def ike_policy_explicit() -> IKEPolicy: - """Create an IKEPolicy with fully nested objects and all common fields.""" + """Create a IKEPolicy with fully nested objects and all common fields.""" return IKEPolicy( name="Example Name", version=1, + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/ike_proposal.py b/docs/examples/ike_proposal.py index 454b3e9..24c1764 100644 --- a/docs/examples/ike_proposal.py +++ b/docs/examples/ike_proposal.py @@ -7,8 +7,6 @@ - ike_proposal_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,15 +14,15 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "ike_proposal-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an IKEProposal entity.""" + """Main execution - demonstrates ingesting a IKEProposal entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = ike_proposal_minimal() - # entity = ike_proposal_extended() - # entity = ike_proposal_explicit() + ike_proposal = ike_proposal_minimal() + # ike_proposal = ike_proposal_extended() + # ike_proposal = ike_proposal_explicit() - response = client.ingest(entities=[Entity(ike_proposal=entity)]) + response = client.ingest(entities=[Entity(ike_proposal=ike_proposal)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -45,7 +43,7 @@ def main(): def ike_proposal_minimal() -> IKEProposal: - """Create an IKEProposal with only required fields using flat strings.""" + """Create a IKEProposal with only required fields using flat strings.""" return IKEProposal( name="Example Name", authentication_method="certificates", @@ -56,29 +54,28 @@ def ike_proposal_minimal() -> IKEProposal: def ike_proposal_extended() -> IKEProposal: - """Create an IKEProposal with common optional fields.""" + """Create a IKEProposal with common optional fields.""" return IKEProposal( name="Example Name", authentication_method="certificates", encryption_algorithm="3des-cbc", group=1, - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) def ike_proposal_explicit() -> IKEProposal: - """Create an IKEProposal with fully nested objects and all common fields.""" + """Create a IKEProposal with fully nested objects and all common fields.""" return IKEProposal( name="Example Name", authentication_method="certificates", encryption_algorithm="3des-cbc", group=1, + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/interface_example.py b/docs/examples/interface_example.py index 022eb37..39256ba 100644 --- a/docs/examples/interface_example.py +++ b/docs/examples/interface_example.py @@ -2,34 +2,32 @@ Interface entity examples for the Diode Python SDK. This module demonstrates three patterns for ingesting Interface entities: -- interface_minimal: Required fields only -- interface_extended: Common optional fields -- interface_explicit: Fully nested objects with all fields +- interface_example_minimal: Required fields only +- interface_example_extended: Common optional fields +- interface_example_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, Interface, Manufacturer, Site, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "interface-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an Interface entity.""" + """Main execution - demonstrates ingesting a Interface entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -38,86 +36,72 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = interface_minimal() - # entity = interface_extended() - # entity = interface_explicit() + interface = interface_example_minimal() + # interface = interface_example_extended() + # interface = interface_example_explicit() - response = client.ingest(entities=[Entity(interface=entity)]) + response = client.ingest(entities=[Entity(interface=interface)]) if response.errors: print(f"Errors: {response.errors}") else: print("Interface ingested successfully") -def interface_minimal() -> Interface: - """Create an Interface with only required fields using flat strings.""" +def interface_example_minimal() -> Interface: + """Create a Interface with only required fields using flat strings.""" return Interface( - device="example-device", # flat string -> Device + device="Example Device", # flat string -> Device name="Example Name", type="1000base-bx10-d", metadata={"source": "example"}, ) -def interface_extended() -> Interface: - """Create an Interface with common optional fields.""" +def interface_example_extended() -> Interface: + """Create a Interface with common optional fields.""" return Interface( - device="example-device", + device="Example Device", name="Example Name", type="1000base-bx10-d", - label="Example label", - description="Example description", metadata={"source": "example"}, + description="Example description", ) -def interface_explicit() -> Interface: - """Create an Interface with fully nested objects and all common fields.""" +def interface_example_explicit() -> Interface: + """Create a Interface with fully nested objects and all common fields.""" return Interface( device=Device( device_type=DeviceType( manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", type="1000base-bx10-d", - label="Example label", + metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/inventory_item.py b/docs/examples/inventory_item.py index 96a4ad3..9f6137a 100644 --- a/docs/examples/inventory_item.py +++ b/docs/examples/inventory_item.py @@ -7,29 +7,27 @@ - inventory_item_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, InventoryItem, Manufacturer, Site, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "inventory_item-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an InventoryItem entity.""" + """Main execution - demonstrates ingesting a InventoryItem entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -38,11 +36,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = inventory_item_minimal() - # entity = inventory_item_extended() - # entity = inventory_item_explicit() + inventory_item = inventory_item_minimal() + # inventory_item = inventory_item_extended() + # inventory_item = inventory_item_explicit() - response = client.ingest(entities=[Entity(inventory_item=entity)]) + response = client.ingest(entities=[Entity(inventory_item=inventory_item)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,77 +48,62 @@ def main(): def inventory_item_minimal() -> InventoryItem: - """Create an InventoryItem with only required fields using flat strings.""" + """Create a InventoryItem with only required fields using flat strings.""" return InventoryItem( - device="example-device", # flat string -> Device + device="Example Device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) def inventory_item_extended() -> InventoryItem: - """Create an InventoryItem with common optional fields.""" + """Create a InventoryItem with common optional fields.""" return InventoryItem( - device="example-device", + device="Example Device", name="Example Name", - label="Example label", + metadata={"source": "example"}, status="active", serial="SN-001234", - asset_tag="ASSET-001", description="Example description", - metadata={"source": "example"}, ) def inventory_item_explicit() -> InventoryItem: - """Create an InventoryItem with fully nested objects and all common fields.""" + """Create a InventoryItem with fully nested objects and all common fields.""" return InventoryItem( device=Device( device_type=DeviceType( manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", + metadata={"source": "example"}, status="active", serial="SN-001234", asset_tag="ASSET-001", description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/inventory_item_role.py b/docs/examples/inventory_item_role.py index 16383cc..51442b2 100644 --- a/docs/examples/inventory_item_role.py +++ b/docs/examples/inventory_item_role.py @@ -7,8 +7,6 @@ - inventory_item_role_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,15 +14,15 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "inventory_item_role-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an InventoryItemRole entity.""" + """Main execution - demonstrates ingesting a InventoryItemRole entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -33,11 +31,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = inventory_item_role_minimal() - # entity = inventory_item_role_extended() - # entity = inventory_item_role_explicit() + inventory_item_role = inventory_item_role_minimal() + # inventory_item_role = inventory_item_role_extended() + # inventory_item_role = inventory_item_role_explicit() - response = client.ingest(entities=[Entity(inventory_item_role=entity)]) + response = client.ingest( + entities=[Entity(inventory_item_role=inventory_item_role)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -45,7 +45,7 @@ def main(): def inventory_item_role_minimal() -> InventoryItemRole: - """Create an InventoryItemRole with only required fields using flat strings.""" + """Create a InventoryItemRole with only required fields using flat strings.""" return InventoryItemRole( name="Example Name", slug="example-slug", @@ -54,27 +54,26 @@ def inventory_item_role_minimal() -> InventoryItemRole: def inventory_item_role_extended() -> InventoryItemRole: - """Create an InventoryItemRole with common optional fields.""" + """Create a InventoryItemRole with common optional fields.""" return InventoryItemRole( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) def inventory_item_role_explicit() -> InventoryItemRole: - """Create an InventoryItemRole with fully nested objects and all common fields.""" + """Create a InventoryItemRole with fully nested objects and all common fields.""" return InventoryItemRole( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/ip_address.py b/docs/examples/ip_address.py index 2022924..d085f8a 100644 --- a/docs/examples/ip_address.py +++ b/docs/examples/ip_address.py @@ -7,8 +7,6 @@ - ip_address_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,15 +15,15 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "ip_address-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an IPAddress entity.""" + """Main execution - demonstrates ingesting a IPAddress entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = ip_address_minimal() - # entity = ip_address_extended() - # entity = ip_address_explicit() + ip_address = ip_address_minimal() + # ip_address = ip_address_extended() + # ip_address = ip_address_explicit() - response = client.ingest(entities=[Entity(ip_address=entity)]) + response = client.ingest(entities=[Entity(ip_address=ip_address)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,7 +44,7 @@ def main(): def ip_address_minimal() -> IPAddress: - """Create an IPAddress with only required fields using flat strings.""" + """Create a IPAddress with only required fields using flat strings.""" return IPAddress( address="192.0.2.1/32", metadata={"source": "example"}, @@ -54,30 +52,27 @@ def ip_address_minimal() -> IPAddress: def ip_address_extended() -> IPAddress: - """Create an IPAddress with common optional fields.""" + """Create a IPAddress with common optional fields.""" return IPAddress( address="192.0.2.1/32", + metadata={"source": "example"}, status="active", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) def ip_address_explicit() -> IPAddress: - """Create an IPAddress with fully nested objects and all common fields.""" + """Create a IPAddress with fully nested objects and all common fields.""" return IPAddress( address="192.0.2.1/32", + metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/ip_range.py b/docs/examples/ip_range.py index 0918d4a..8abbf40 100644 --- a/docs/examples/ip_range.py +++ b/docs/examples/ip_range.py @@ -7,8 +7,6 @@ - ip_range_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,15 +15,15 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "ip_range-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an IPRange entity.""" + """Main execution - demonstrates ingesting a IPRange entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = ip_range_minimal() - # entity = ip_range_extended() - # entity = ip_range_explicit() + ip_range = ip_range_minimal() + # ip_range = ip_range_extended() + # ip_range = ip_range_explicit() - response = client.ingest(entities=[Entity(ip_range=entity)]) + response = client.ingest(entities=[Entity(ip_range=ip_range)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -46,41 +44,38 @@ def main(): def ip_range_minimal() -> IPRange: - """Create an IPRange with only required fields using flat strings.""" + """Create a IPRange with only required fields using flat strings.""" return IPRange( - start_address="example-start-address", - end_address="example-end-address", + start_address="Example Start Address", + end_address="Example End Address", metadata={"source": "example"}, ) def ip_range_extended() -> IPRange: - """Create an IPRange with common optional fields.""" + """Create a IPRange with common optional fields.""" return IPRange( - start_address="example-start-address", - end_address="example-end-address", + start_address="Example Start Address", + end_address="Example End Address", + metadata={"source": "example"}, status="active", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) def ip_range_explicit() -> IPRange: - """Create an IPRange with fully nested objects and all common fields.""" + """Create a IPRange with fully nested objects and all common fields.""" return IPRange( - start_address="example-start-address", - end_address="example-end-address", + start_address="Example Start Address", + end_address="Example End Address", + metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/ip_sec_policy.py b/docs/examples/ip_sec_policy.py index 4adfaa2..9240318 100644 --- a/docs/examples/ip_sec_policy.py +++ b/docs/examples/ip_sec_policy.py @@ -7,8 +7,6 @@ - ip_sec_policy_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,15 +14,15 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "ip_sec_policy-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an IPSecPolicy entity.""" + """Main execution - demonstrates ingesting a IPSecPolicy entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = ip_sec_policy_minimal() - # entity = ip_sec_policy_extended() - # entity = ip_sec_policy_explicit() + ip_sec_policy = ip_sec_policy_minimal() + # ip_sec_policy = ip_sec_policy_extended() + # ip_sec_policy = ip_sec_policy_explicit() - response = client.ingest(entities=[Entity(ip_sec_policy=entity)]) + response = client.ingest(entities=[Entity(ip_sec_policy=ip_sec_policy)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -45,7 +43,7 @@ def main(): def ip_sec_policy_minimal() -> IPSecPolicy: - """Create an IPSecPolicy with only required fields using flat strings.""" + """Create a IPSecPolicy with only required fields using flat strings.""" return IPSecPolicy( name="Example Name", metadata={"source": "example"}, @@ -53,23 +51,22 @@ def ip_sec_policy_minimal() -> IPSecPolicy: def ip_sec_policy_extended() -> IPSecPolicy: - """Create an IPSecPolicy with common optional fields.""" + """Create a IPSecPolicy with common optional fields.""" return IPSecPolicy( name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) def ip_sec_policy_explicit() -> IPSecPolicy: - """Create an IPSecPolicy with fully nested objects and all common fields.""" + """Create a IPSecPolicy with fully nested objects and all common fields.""" return IPSecPolicy( name="Example Name", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/ip_sec_profile.py b/docs/examples/ip_sec_profile.py index eadd14e..0db78b4 100644 --- a/docs/examples/ip_sec_profile.py +++ b/docs/examples/ip_sec_profile.py @@ -7,8 +7,6 @@ - ip_sec_profile_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -18,15 +16,15 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "ip_sec_profile-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an IPSecProfile entity.""" + """Main execution - demonstrates ingesting a IPSecProfile entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -35,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = ip_sec_profile_minimal() - # entity = ip_sec_profile_extended() - # entity = ip_sec_profile_explicit() + ip_sec_profile = ip_sec_profile_minimal() + # ip_sec_profile = ip_sec_profile_extended() + # ip_sec_profile = ip_sec_profile_explicit() - response = client.ingest(entities=[Entity(ip_sec_profile=entity)]) + response = client.ingest(entities=[Entity(ip_sec_profile=ip_sec_profile)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -47,51 +45,41 @@ def main(): def ip_sec_profile_minimal() -> IPSecProfile: - """Create an IPSecProfile with only required fields using flat strings.""" + """Create a IPSecProfile with only required fields using flat strings.""" return IPSecProfile( name="Example Name", mode="ah", - ike_policy="example-ike-policy", # flat string -> IKEPolicy - ipsec_policy="example-ipsec-policy", # flat string -> IPSecPolicy + ike_policy="Example Ike Policy", # flat string -> IKEPolicy + ipsec_policy="Example Ipsec Policy", # flat string -> IPSecPolicy metadata={"source": "example"}, ) def ip_sec_profile_extended() -> IPSecProfile: - """Create an IPSecProfile with common optional fields.""" + """Create a IPSecProfile with common optional fields.""" return IPSecProfile( name="Example Name", mode="ah", - ike_policy="example-ike-policy", - ipsec_policy="example-ipsec-policy", - description="Example description", - comments="Example comments", + ike_policy="Example Ike Policy", + ipsec_policy="Example Ipsec Policy", metadata={"source": "example"}, + description="Example description", ) def ip_sec_profile_explicit() -> IPSecProfile: - """Create an IPSecProfile with fully nested objects and all common fields.""" + """Create a IPSecProfile with fully nested objects and all common fields.""" return IPSecProfile( name="Example Name", mode="ah", ike_policy=IKEPolicy( - name="Example Name", - description="Example description", - version=1, - comments="Example comments", - metadata={"source": "example"}, - ), - ipsec_policy=IPSecPolicy( - name="Example Name", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", version=1, metadata={"source": "example"} ), + ipsec_policy=IPSecPolicy(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/ip_sec_proposal.py b/docs/examples/ip_sec_proposal.py index 8e43452..5e722f6 100644 --- a/docs/examples/ip_sec_proposal.py +++ b/docs/examples/ip_sec_proposal.py @@ -7,8 +7,6 @@ - ip_sec_proposal_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,15 +14,15 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "ip_sec_proposal-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an IPSecProposal entity.""" + """Main execution - demonstrates ingesting a IPSecProposal entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = ip_sec_proposal_minimal() - # entity = ip_sec_proposal_extended() - # entity = ip_sec_proposal_explicit() + ip_sec_proposal = ip_sec_proposal_minimal() + # ip_sec_proposal = ip_sec_proposal_extended() + # ip_sec_proposal = ip_sec_proposal_explicit() - response = client.ingest(entities=[Entity(ip_sec_proposal=entity)]) + response = client.ingest(entities=[Entity(ip_sec_proposal=ip_sec_proposal)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -45,7 +43,7 @@ def main(): def ip_sec_proposal_minimal() -> IPSecProposal: - """Create an IPSecProposal with only required fields using flat strings.""" + """Create a IPSecProposal with only required fields using flat strings.""" return IPSecProposal( name="Example Name", metadata={"source": "example"}, @@ -53,23 +51,22 @@ def ip_sec_proposal_minimal() -> IPSecProposal: def ip_sec_proposal_extended() -> IPSecProposal: - """Create an IPSecProposal with common optional fields.""" + """Create a IPSecProposal with common optional fields.""" return IPSecProposal( name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) def ip_sec_proposal_explicit() -> IPSecProposal: - """Create an IPSecProposal with fully nested objects and all common fields.""" + """Create a IPSecProposal with fully nested objects and all common fields.""" return IPSecProposal( name="Example Name", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/journal_entry.py b/docs/examples/journal_entry.py index fc1f0e1..770ff5b 100644 --- a/docs/examples/journal_entry.py +++ b/docs/examples/journal_entry.py @@ -7,8 +7,6 @@ - journal_entry_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "journal_entry-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = journal_entry_minimal() - # entity = journal_entry_extended() - # entity = journal_entry_explicit() + journal_entry = journal_entry_minimal() + # journal_entry = journal_entry_extended() + # journal_entry = journal_entry_explicit() - response = client.ingest(entities=[Entity(journal_entry=entity)]) + response = client.ingest(entities=[Entity(journal_entry=journal_entry)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -64,8 +62,8 @@ def journal_entry_explicit() -> JournalEntry: """Create a JournalEntry with fully nested objects and all common fields.""" return JournalEntry( comments="Example comments", - tags=[Tag(name="production")], metadata={"source": "example"}, + tags=[Tag(name="production")], ) diff --git a/docs/examples/l2vpn.py b/docs/examples/l2vpn.py index 9d4a6fd..a33c460 100644 --- a/docs/examples/l2vpn.py +++ b/docs/examples/l2vpn.py @@ -7,8 +7,6 @@ - l2vpn_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "l2vpn-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = l2vpn_minimal() - # entity = l2vpn_extended() - # entity = l2vpn_explicit() + l2vpn = l2vpn_minimal() + # l2vpn = l2vpn_extended() + # l2vpn = l2vpn_explicit() - response = client.ingest(entities=[Entity(l2vpn=entity)]) + response = client.ingest(entities=[Entity(l2vpn=l2vpn)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -59,10 +57,9 @@ def l2vpn_extended() -> L2VPN: return L2VPN( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", - comments="Example comments", status="active", - metadata={"source": "example"}, ) @@ -71,16 +68,14 @@ def l2vpn_explicit() -> L2VPN: return L2VPN( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", status="active", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/l2vpn_termination.py b/docs/examples/l2vpn_termination.py index f6c58ab..2eb22e6 100644 --- a/docs/examples/l2vpn_termination.py +++ b/docs/examples/l2vpn_termination.py @@ -7,8 +7,6 @@ - l2vpn_termination_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "l2vpn_termination-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = l2vpn_termination_minimal() - # entity = l2vpn_termination_extended() - # entity = l2vpn_termination_explicit() + l2vpn_termination = l2vpn_termination_minimal() + # l2vpn_termination = l2vpn_termination_extended() + # l2vpn_termination = l2vpn_termination_explicit() - response = client.ingest(entities=[Entity(l2vpn_termination=entity)]) + response = client.ingest(entities=[Entity(l2vpn_termination=l2vpn_termination)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +46,7 @@ def main(): def l2vpn_termination_minimal() -> L2VPNTermination: """Create a L2VPNTermination with only required fields using flat strings.""" return L2VPNTermination( - l2vpn="example-l2vpn", # flat string -> L2VPN + l2vpn="Example L2Vpn", # flat string -> L2VPN metadata={"source": "example"}, ) @@ -56,7 +54,7 @@ def l2vpn_termination_minimal() -> L2VPNTermination: def l2vpn_termination_extended() -> L2VPNTermination: """Create a L2VPNTermination with common optional fields.""" return L2VPNTermination( - l2vpn="example-l2vpn", + l2vpn="Example L2Vpn", metadata={"source": "example"}, ) @@ -67,13 +65,11 @@ def l2vpn_termination_explicit() -> L2VPNTermination: l2vpn=L2VPN( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", status="active", metadata={"source": "example"}, ), - tags=[Tag(name="production")], metadata={"source": "example"}, + tags=[Tag(name="production")], ) diff --git a/docs/examples/location.py b/docs/examples/location.py index e93d5f1..9ec90e2 100644 --- a/docs/examples/location.py +++ b/docs/examples/location.py @@ -7,8 +7,6 @@ - location_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -18,11 +16,11 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "location-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -35,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = location_minimal() - # entity = location_extended() - # entity = location_explicit() + location = location_minimal() + # location = location_extended() + # location = location_explicit() - response = client.ingest(entities=[Entity(location=entity)]) + response = client.ingest(entities=[Entity(location=location)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -51,7 +49,7 @@ def location_minimal() -> Location: return Location( name="Example Name", slug="example-slug", - site="example-site", # flat string -> Site + site="Example Site", # flat string -> Site metadata={"source": "example"}, ) @@ -61,11 +59,10 @@ def location_extended() -> Location: return Location( name="Example Name", slug="example-slug", - site="example-site", + site="Example Site", + metadata={"source": "example"}, status="active", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -78,20 +75,16 @@ def location_explicit() -> Location: name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), + metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/mac_address.py b/docs/examples/mac_address.py index 51ce71d..992fcc9 100644 --- a/docs/examples/mac_address.py +++ b/docs/examples/mac_address.py @@ -7,8 +7,6 @@ - mac_address_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "mac_address-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = mac_address_minimal() - # entity = mac_address_extended() - # entity = mac_address_explicit() + mac_address = mac_address_minimal() + # mac_address = mac_address_extended() + # mac_address = mac_address_explicit() - response = client.ingest(entities=[Entity(mac_address=entity)]) + response = client.ingest(entities=[Entity(mac_address=mac_address)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -47,7 +45,7 @@ def main(): def mac_address_minimal() -> MACAddress: """Create a MACAddress with only required fields using flat strings.""" return MACAddress( - mac_address="00:1A:2B:3C:4D:5E", + mac_address="00:11:22:33:44:55", metadata={"source": "example"}, ) @@ -55,21 +53,20 @@ def mac_address_minimal() -> MACAddress: def mac_address_extended() -> MACAddress: """Create a MACAddress with common optional fields.""" return MACAddress( - mac_address="00:1A:2B:3C:4D:5E", - description="Example description", - comments="Example comments", + mac_address="00:11:22:33:44:55", metadata={"source": "example"}, + description="Example description", ) def mac_address_explicit() -> MACAddress: """Create a MACAddress with fully nested objects and all common fields.""" return MACAddress( - mac_address="00:1A:2B:3C:4D:5E", + mac_address="00:11:22:33:44:55", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/manufacturer.py b/docs/examples/manufacturer.py index 261a45c..3195d15 100644 --- a/docs/examples/manufacturer.py +++ b/docs/examples/manufacturer.py @@ -7,8 +7,6 @@ - manufacturer_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "manufacturer-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = manufacturer_minimal() - # entity = manufacturer_extended() - # entity = manufacturer_explicit() + manufacturer = manufacturer_minimal() + # manufacturer = manufacturer_extended() + # manufacturer = manufacturer_explicit() - response = client.ingest(entities=[Entity(manufacturer=entity)]) + response = client.ingest(entities=[Entity(manufacturer=manufacturer)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def manufacturer_extended() -> Manufacturer: return Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def manufacturer_explicit() -> Manufacturer: return Manufacturer( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/module.py b/docs/examples/module.py index ce0e030..51095e3 100644 --- a/docs/examples/module.py +++ b/docs/examples/module.py @@ -7,14 +7,12 @@ - module_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, Manufacturer, Module, ModuleBay, @@ -23,11 +21,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "module-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -40,11 +38,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = module_minimal() - # entity = module_extended() - # entity = module_explicit() + module = module_minimal() + # module = module_extended() + # module = module_explicit() - response = client.ingest(entities=[Entity(module=entity)]) + response = client.ingest(entities=[Entity(module=module)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -54,9 +52,9 @@ def main(): def module_minimal() -> Module: """Create a Module with only required fields using flat strings.""" return Module( - device="example-device", # flat string -> Device - module_bay="example-module-bay", # flat string -> ModuleBay - module_type="example-module-type", # flat string -> ModuleType + device="Example Device", # flat string -> Device + module_bay="Example Module Bay", # flat string -> ModuleBay + module_type="Example Module Type", # flat string -> ModuleType metadata={"source": "example"}, ) @@ -64,15 +62,13 @@ def module_minimal() -> Module: def module_extended() -> Module: """Create a Module with common optional fields.""" return Module( - device="example-device", - module_bay="example-module-bay", - module_type="example-module-type", + device="Example Device", + module_bay="Example Module Bay", + module_type="Example Module Type", + metadata={"source": "example"}, status="active", serial="SN-001234", - asset_tag="ASSET-001", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -84,37 +80,25 @@ def module_explicit() -> Module: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), module_bay=ModuleBay( @@ -123,64 +107,44 @@ def module_explicit() -> Module: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", - description="Example description", metadata={"source": "example"}, ), module_type=ModuleType( manufacturer=Manufacturer( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), model="Model X", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), + metadata={"source": "example"}, status="active", serial="SN-001234", asset_tag="ASSET-001", description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/module_bay.py b/docs/examples/module_bay.py index f141f22..bcbcfba 100644 --- a/docs/examples/module_bay.py +++ b/docs/examples/module_bay.py @@ -7,25 +7,23 @@ - module_bay_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, Manufacturer, ModuleBay, Site, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "module_bay-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -38,11 +36,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = module_bay_minimal() - # entity = module_bay_extended() - # entity = module_bay_explicit() + module_bay = module_bay_minimal() + # module_bay = module_bay_extended() + # module_bay = module_bay_explicit() - response = client.ingest(entities=[Entity(module_bay=entity)]) + response = client.ingest(entities=[Entity(module_bay=module_bay)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -52,7 +50,7 @@ def main(): def module_bay_minimal() -> ModuleBay: """Create a ModuleBay with only required fields using flat strings.""" return ModuleBay( - device="example-device", # flat string -> Device + device="Example Device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -61,11 +59,10 @@ def module_bay_minimal() -> ModuleBay: def module_bay_extended() -> ModuleBay: """Create a ModuleBay with common optional fields.""" return ModuleBay( - device="example-device", + device="Example Device", name="Example Name", - label="Example label", - description="Example description", metadata={"source": "example"}, + description="Example description", ) @@ -77,44 +74,31 @@ def module_bay_explicit() -> ModuleBay: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", + metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/module_type.py b/docs/examples/module_type.py index 2cd48e3..41f71ef 100644 --- a/docs/examples/module_type.py +++ b/docs/examples/module_type.py @@ -7,8 +7,6 @@ - module_type_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "module_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = module_type_minimal() - # entity = module_type_extended() - # entity = module_type_explicit() + module_type = module_type_minimal() + # module_type = module_type_extended() + # module_type = module_type_explicit() - response = client.ingest(entities=[Entity(module_type=entity)]) + response = client.ingest(entities=[Entity(module_type=module_type)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +46,7 @@ def main(): def module_type_minimal() -> ModuleType: """Create a ModuleType with only required fields using flat strings.""" return ModuleType( - manufacturer="example-manufacturer", # flat string -> Manufacturer + manufacturer="Example Manufacturer", # flat string -> Manufacturer model="Model X", metadata={"source": "example"}, ) @@ -57,11 +55,10 @@ def module_type_minimal() -> ModuleType: def module_type_extended() -> ModuleType: """Create a ModuleType with common optional fields.""" return ModuleType( - manufacturer="example-manufacturer", + manufacturer="Example Manufacturer", model="Model X", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,17 +66,13 @@ def module_type_explicit() -> ModuleType: """Create a ModuleType with fully nested objects and all common fields.""" return ModuleType( manufacturer=Manufacturer( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), model="Model X", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/module_type_profile.py b/docs/examples/module_type_profile.py index 80c01a6..37e2fe1 100644 --- a/docs/examples/module_type_profile.py +++ b/docs/examples/module_type_profile.py @@ -7,8 +7,6 @@ - module_type_profile_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "module_type_profile-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = module_type_profile_minimal() - # entity = module_type_profile_extended() - # entity = module_type_profile_explicit() + module_type_profile = module_type_profile_minimal() + # module_type_profile = module_type_profile_extended() + # module_type_profile = module_type_profile_explicit() - response = client.ingest(entities=[Entity(module_type_profile=entity)]) + response = client.ingest( + entities=[Entity(module_type_profile=module_type_profile)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,9 +56,8 @@ def module_type_profile_extended() -> ModuleTypeProfile: """Create a ModuleTypeProfile with common optional fields.""" return ModuleTypeProfile( name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -66,10 +65,10 @@ def module_type_profile_explicit() -> ModuleTypeProfile: """Create a ModuleTypeProfile with fully nested objects and all common fields.""" return ModuleTypeProfile( name="Example Name", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/owner.py b/docs/examples/owner.py index 6725668..42a9753 100644 --- a/docs/examples/owner.py +++ b/docs/examples/owner.py @@ -7,8 +7,6 @@ - owner_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,15 +14,15 @@ OwnerGroup, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "owner-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an Owner entity.""" + """Main execution - demonstrates ingesting a Owner entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = owner_minimal() - # entity = owner_extended() - # entity = owner_explicit() + owner = owner_minimal() + # owner = owner_extended() + # owner = owner_explicit() - response = client.ingest(entities=[Entity(owner=entity)]) + response = client.ingest(entities=[Entity(owner=owner)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -45,35 +43,31 @@ def main(): def owner_minimal() -> Owner: - """Create an Owner with only required fields using flat strings.""" + """Create a Owner with only required fields using flat strings.""" return Owner( name="Example Name", - group="example-group", # flat string -> OwnerGroup + group="Example Group", # flat string -> OwnerGroup metadata={"source": "example"}, ) def owner_extended() -> Owner: - """Create an Owner with common optional fields.""" + """Create a Owner with common optional fields.""" return Owner( name="Example Name", - group="example-group", - description="Example description", + group="Example Group", metadata={"source": "example"}, + description="Example description", ) def owner_explicit() -> Owner: - """Create an Owner with fully nested objects and all common fields.""" + """Create a Owner with fully nested objects and all common fields.""" return Owner( name="Example Name", - group=OwnerGroup( - name="Example Name", - description="Example description", - metadata={"source": "example"}, - ), - description="Example description", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), metadata={"source": "example"}, + description="Example description", ) diff --git a/docs/examples/owner_group.py b/docs/examples/owner_group.py index a7c6f7f..4484758 100644 --- a/docs/examples/owner_group.py +++ b/docs/examples/owner_group.py @@ -7,23 +7,17 @@ - owner_group_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - OwnerGroup, -) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "owner_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): - """Main execution - demonstrates ingesting an OwnerGroup entity.""" + """Main execution - demonstrates ingesting a OwnerGroup entity.""" with DiodeClient( target=TARGET, app_name=APP_NAME, @@ -32,11 +26,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = owner_group_minimal() - # entity = owner_group_extended() - # entity = owner_group_explicit() + owner_group = owner_group_minimal() + # owner_group = owner_group_extended() + # owner_group = owner_group_explicit() - response = client.ingest(entities=[Entity(owner_group=entity)]) + response = client.ingest(entities=[Entity(owner_group=owner_group)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -44,7 +38,7 @@ def main(): def owner_group_minimal() -> OwnerGroup: - """Create an OwnerGroup with only required fields using flat strings.""" + """Create a OwnerGroup with only required fields using flat strings.""" return OwnerGroup( name="Example Name", metadata={"source": "example"}, @@ -52,20 +46,20 @@ def owner_group_minimal() -> OwnerGroup: def owner_group_extended() -> OwnerGroup: - """Create an OwnerGroup with common optional fields.""" + """Create a OwnerGroup with common optional fields.""" return OwnerGroup( name="Example Name", - description="Example description", metadata={"source": "example"}, + description="Example description", ) def owner_group_explicit() -> OwnerGroup: - """Create an OwnerGroup with fully nested objects and all common fields.""" + """Create a OwnerGroup with fully nested objects and all common fields.""" return OwnerGroup( name="Example Name", - description="Example description", metadata={"source": "example"}, + description="Example description", ) diff --git a/docs/examples/platform.py b/docs/examples/platform.py index 533cb28..7615f01 100644 --- a/docs/examples/platform.py +++ b/docs/examples/platform.py @@ -7,8 +7,6 @@ - platform_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "platform-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = platform_minimal() - # entity = platform_extended() - # entity = platform_explicit() + platform = platform_minimal() + # platform = platform_extended() + # platform = platform_explicit() - response = client.ingest(entities=[Entity(platform=entity)]) + response = client.ingest(entities=[Entity(platform=platform)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def platform_extended() -> Platform: return Platform( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def platform_explicit() -> Platform: return Platform( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/power_feed.py b/docs/examples/power_feed.py index 8238669..586624a 100644 --- a/docs/examples/power_feed.py +++ b/docs/examples/power_feed.py @@ -7,8 +7,6 @@ - power_feed_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -19,11 +17,11 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "power_feed-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -36,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = power_feed_minimal() - # entity = power_feed_extended() - # entity = power_feed_explicit() + power_feed = power_feed_minimal() + # power_feed = power_feed_extended() + # power_feed = power_feed_explicit() - response = client.ingest(entities=[Entity(power_feed=entity)]) + response = client.ingest(entities=[Entity(power_feed=power_feed)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +48,7 @@ def main(): def power_feed_minimal() -> PowerFeed: """Create a PowerFeed with only required fields using flat strings.""" return PowerFeed( - power_panel="example-power-panel", # flat string -> PowerPanel + power_panel="Example Power Panel", # flat string -> PowerPanel name="Example Name", metadata={"source": "example"}, ) @@ -59,12 +57,11 @@ def power_feed_minimal() -> PowerFeed: def power_feed_extended() -> PowerFeed: """Create a PowerFeed with common optional fields.""" return PowerFeed( - power_panel="example-power-panel", + power_panel="Example Power Panel", name="Example Name", + metadata={"source": "example"}, status="active", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -76,26 +73,20 @@ def power_feed_explicit() -> PowerFeed: name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", + metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/power_outlet.py b/docs/examples/power_outlet.py index 1e21bd1..125fd21 100644 --- a/docs/examples/power_outlet.py +++ b/docs/examples/power_outlet.py @@ -7,25 +7,23 @@ - power_outlet_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, Manufacturer, PowerOutlet, Site, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "power_outlet-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -38,11 +36,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = power_outlet_minimal() - # entity = power_outlet_extended() - # entity = power_outlet_explicit() + power_outlet = power_outlet_minimal() + # power_outlet = power_outlet_extended() + # power_outlet = power_outlet_explicit() - response = client.ingest(entities=[Entity(power_outlet=entity)]) + response = client.ingest(entities=[Entity(power_outlet=power_outlet)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -52,7 +50,7 @@ def main(): def power_outlet_minimal() -> PowerOutlet: """Create a PowerOutlet with only required fields using flat strings.""" return PowerOutlet( - device="example-device", # flat string -> Device + device="Example Device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -61,13 +59,12 @@ def power_outlet_minimal() -> PowerOutlet: def power_outlet_extended() -> PowerOutlet: """Create a PowerOutlet with common optional fields.""" return PowerOutlet( - device="example-device", + device="Example Device", name="Example Name", - label="Example label", + metadata={"source": "example"}, color="0000ff", description="Example description", status="disabled", - metadata={"source": "example"}, ) @@ -79,46 +76,33 @@ def power_outlet_explicit() -> PowerOutlet: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", + metadata={"source": "example"}, color="0000ff", description="Example description", status="disabled", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/power_panel.py b/docs/examples/power_panel.py index 01bb5d0..c83a8ae 100644 --- a/docs/examples/power_panel.py +++ b/docs/examples/power_panel.py @@ -7,8 +7,6 @@ - power_panel_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "power_panel-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = power_panel_minimal() - # entity = power_panel_extended() - # entity = power_panel_explicit() + power_panel = power_panel_minimal() + # power_panel = power_panel_extended() + # power_panel = power_panel_explicit() - response = client.ingest(entities=[Entity(power_panel=entity)]) + response = client.ingest(entities=[Entity(power_panel=power_panel)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +46,7 @@ def main(): def power_panel_minimal() -> PowerPanel: """Create a PowerPanel with only required fields using flat strings.""" return PowerPanel( - site="example-site", # flat string -> Site + site="Example Site", # flat string -> Site name="Example Name", metadata={"source": "example"}, ) @@ -57,11 +55,10 @@ def power_panel_minimal() -> PowerPanel: def power_panel_extended() -> PowerPanel: """Create a PowerPanel with common optional fields.""" return PowerPanel( - site="example-site", + site="Example Site", name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -72,15 +69,13 @@ def power_panel_explicit() -> PowerPanel: name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/power_port.py b/docs/examples/power_port.py index 6f4834c..6dcf618 100644 --- a/docs/examples/power_port.py +++ b/docs/examples/power_port.py @@ -7,25 +7,23 @@ - power_port_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, Manufacturer, PowerPort, Site, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "power_port-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -38,11 +36,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = power_port_minimal() - # entity = power_port_extended() - # entity = power_port_explicit() + power_port = power_port_minimal() + # power_port = power_port_extended() + # power_port = power_port_explicit() - response = client.ingest(entities=[Entity(power_port=entity)]) + response = client.ingest(entities=[Entity(power_port=power_port)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -52,7 +50,7 @@ def main(): def power_port_minimal() -> PowerPort: """Create a PowerPort with only required fields using flat strings.""" return PowerPort( - device="example-device", # flat string -> Device + device="Example Device", # flat string -> Device name="Example Name", metadata={"source": "example"}, ) @@ -61,11 +59,10 @@ def power_port_minimal() -> PowerPort: def power_port_extended() -> PowerPort: """Create a PowerPort with common optional fields.""" return PowerPort( - device="example-device", + device="Example Device", name="Example Name", - label="Example label", - description="Example description", metadata={"source": "example"}, + description="Example description", ) @@ -77,44 +74,31 @@ def power_port_explicit() -> PowerPort: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", + metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/prefix.py b/docs/examples/prefix.py index 6ce16c4..b3bd3ac 100644 --- a/docs/examples/prefix.py +++ b/docs/examples/prefix.py @@ -7,8 +7,6 @@ - prefix_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "prefix-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = prefix_minimal() - # entity = prefix_extended() - # entity = prefix_explicit() + prefix = prefix_minimal() + # prefix = prefix_extended() + # prefix = prefix_explicit() - response = client.ingest(entities=[Entity(prefix=entity)]) + response = client.ingest(entities=[Entity(prefix=prefix)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -57,10 +55,9 @@ def prefix_extended() -> Prefix: """Create a Prefix with common optional fields.""" return Prefix( prefix="192.0.2.0/24", + metadata={"source": "example"}, status="active", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -68,16 +65,14 @@ def prefix_explicit() -> Prefix: """Create a Prefix with fully nested objects and all common fields.""" return Prefix( prefix="192.0.2.0/24", + metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/provider.py b/docs/examples/provider.py index 553fc03..22ece7c 100644 --- a/docs/examples/provider.py +++ b/docs/examples/provider.py @@ -7,8 +7,6 @@ - provider_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "provider-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = provider_minimal() - # entity = provider_extended() - # entity = provider_explicit() + provider = provider_minimal() + # provider = provider_extended() + # provider = provider_explicit() - response = client.ingest(entities=[Entity(provider=entity)]) + response = client.ingest(entities=[Entity(provider=provider)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def provider_extended() -> Provider: return Provider( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def provider_explicit() -> Provider: return Provider( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/provider_account.py b/docs/examples/provider_account.py index cf45516..021c13e 100644 --- a/docs/examples/provider_account.py +++ b/docs/examples/provider_account.py @@ -7,8 +7,6 @@ - provider_account_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "provider_account-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = provider_account_minimal() - # entity = provider_account_extended() - # entity = provider_account_explicit() + provider_account = provider_account_minimal() + # provider_account = provider_account_extended() + # provider_account = provider_account_explicit() - response = client.ingest(entities=[Entity(provider_account=entity)]) + response = client.ingest(entities=[Entity(provider_account=provider_account)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,8 +46,8 @@ def main(): def provider_account_minimal() -> ProviderAccount: """Create a ProviderAccount with only required fields using flat strings.""" return ProviderAccount( - provider="example-provider", # flat string -> Provider - account="example-account", + provider="Example Provider", # flat string -> Provider + account="Example Account", metadata={"source": "example"}, ) @@ -57,11 +55,10 @@ def provider_account_minimal() -> ProviderAccount: def provider_account_extended() -> ProviderAccount: """Create a ProviderAccount with common optional fields.""" return ProviderAccount( - provider="example-provider", - account="example-account", - description="Example description", - comments="Example comments", + provider="Example Provider", + account="Example Account", metadata={"source": "example"}, + description="Example description", ) @@ -69,17 +66,13 @@ def provider_account_explicit() -> ProviderAccount: """Create a ProviderAccount with fully nested objects and all common fields.""" return ProviderAccount( provider=Provider( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), - account="example-account", + account="Example Account", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/provider_network.py b/docs/examples/provider_network.py index f502938..0a411d2 100644 --- a/docs/examples/provider_network.py +++ b/docs/examples/provider_network.py @@ -7,8 +7,6 @@ - provider_network_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "provider_network-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = provider_network_minimal() - # entity = provider_network_extended() - # entity = provider_network_explicit() + provider_network = provider_network_minimal() + # provider_network = provider_network_extended() + # provider_network = provider_network_explicit() - response = client.ingest(entities=[Entity(provider_network=entity)]) + response = client.ingest(entities=[Entity(provider_network=provider_network)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +46,7 @@ def main(): def provider_network_minimal() -> ProviderNetwork: """Create a ProviderNetwork with only required fields using flat strings.""" return ProviderNetwork( - provider="example-provider", # flat string -> Provider + provider="Example Provider", # flat string -> Provider name="Example Name", metadata={"source": "example"}, ) @@ -57,11 +55,10 @@ def provider_network_minimal() -> ProviderNetwork: def provider_network_extended() -> ProviderNetwork: """Create a ProviderNetwork with common optional fields.""" return ProviderNetwork( - provider="example-provider", + provider="Example Provider", name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,17 +66,13 @@ def provider_network_explicit() -> ProviderNetwork: """Create a ProviderNetwork with fully nested objects and all common fields.""" return ProviderNetwork( provider=Provider( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), name="Example Name", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/rack.py b/docs/examples/rack.py index 99cfbdd..dbaf88f 100644 --- a/docs/examples/rack.py +++ b/docs/examples/rack.py @@ -7,8 +7,6 @@ - rack_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -18,11 +16,11 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "rack-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -35,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = rack_minimal() - # entity = rack_extended() - # entity = rack_explicit() + rack = rack_minimal() + # rack = rack_extended() + # rack = rack_explicit() - response = client.ingest(entities=[Entity(rack=entity)]) + response = client.ingest(entities=[Entity(rack=rack)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +48,7 @@ def rack_minimal() -> Rack: """Create a Rack with only required fields using flat strings.""" return Rack( name="Example Name", - site="example-site", # flat string -> Site + site="Example Site", # flat string -> Site metadata={"source": "example"}, ) @@ -59,13 +57,11 @@ def rack_extended() -> Rack: """Create a Rack with common optional fields.""" return Rack( name="Example Name", - site="example-site", + site="Example Site", + metadata={"source": "example"}, status="active", serial="SN-001234", - asset_tag="ASSET-001", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -77,22 +73,18 @@ def rack_explicit() -> Rack: name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), + metadata={"source": "example"}, status="active", serial="SN-001234", asset_tag="ASSET-001", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/rack_reservation.py b/docs/examples/rack_reservation.py index 5d86cc0..fa01a72 100644 --- a/docs/examples/rack_reservation.py +++ b/docs/examples/rack_reservation.py @@ -7,8 +7,6 @@ - rack_reservation_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -19,11 +17,11 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "rack_reservation-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -36,11 +34,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = rack_reservation_minimal() - # entity = rack_reservation_extended() - # entity = rack_reservation_explicit() + rack_reservation = rack_reservation_minimal() + # rack_reservation = rack_reservation_extended() + # rack_reservation = rack_reservation_explicit() - response = client.ingest(entities=[Entity(rack_reservation=entity)]) + response = client.ingest(entities=[Entity(rack_reservation=rack_reservation)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -50,7 +48,7 @@ def main(): def rack_reservation_minimal() -> RackReservation: """Create a RackReservation with only required fields using flat strings.""" return RackReservation( - rack="example-rack", # flat string -> Rack + rack="Example Rack", # flat string -> Rack description="Example description", metadata={"source": "example"}, ) @@ -59,11 +57,10 @@ def rack_reservation_minimal() -> RackReservation: def rack_reservation_extended() -> RackReservation: """Create a RackReservation with common optional fields.""" return RackReservation( - rack="example-rack", + rack="Example Rack", description="Example description", - comments="Example comments", - status="active", metadata={"source": "example"}, + status="active", ) @@ -76,27 +73,19 @@ def rack_reservation_explicit() -> RackReservation: name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - serial="SN-001234", - asset_tag="ASSET-001", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), description="Example description", + metadata={"source": "example"}, comments="Example comments", status="active", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/rack_role.py b/docs/examples/rack_role.py index 68723c2..de333da 100644 --- a/docs/examples/rack_role.py +++ b/docs/examples/rack_role.py @@ -7,8 +7,6 @@ - rack_role_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "rack_role-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = rack_role_minimal() - # entity = rack_role_extended() - # entity = rack_role_explicit() + rack_role = rack_role_minimal() + # rack_role = rack_role_extended() + # rack_role = rack_role_explicit() - response = client.ingest(entities=[Entity(rack_role=entity)]) + response = client.ingest(entities=[Entity(rack_role=rack_role)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,10 +56,9 @@ def rack_role_extended() -> RackRole: return RackRole( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -70,11 +67,11 @@ def rack_role_explicit() -> RackRole: return RackRole( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/rack_type.py b/docs/examples/rack_type.py index 03cdab6..a45fc87 100644 --- a/docs/examples/rack_type.py +++ b/docs/examples/rack_type.py @@ -7,8 +7,6 @@ - rack_type_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "rack_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = rack_type_minimal() - # entity = rack_type_extended() - # entity = rack_type_explicit() + rack_type = rack_type_minimal() + # rack_type = rack_type_extended() + # rack_type = rack_type_explicit() - response = client.ingest(entities=[Entity(rack_type=entity)]) + response = client.ingest(entities=[Entity(rack_type=rack_type)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +46,7 @@ def main(): def rack_type_minimal() -> RackType: """Create a RackType with only required fields using flat strings.""" return RackType( - manufacturer="example-manufacturer", # flat string -> Manufacturer + manufacturer="Example Manufacturer", # flat string -> Manufacturer model="Model X", slug="example-slug", metadata={"source": "example"}, @@ -58,12 +56,11 @@ def rack_type_minimal() -> RackType: def rack_type_extended() -> RackType: """Create a RackType with common optional fields.""" return RackType( - manufacturer="example-manufacturer", + manufacturer="Example Manufacturer", model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -71,18 +68,14 @@ def rack_type_explicit() -> RackType: """Create a RackType with fully nested objects and all common fields.""" return RackType( manufacturer=Manufacturer( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), model="Model X", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/rear_port.py b/docs/examples/rear_port.py index 198dc26..3060611 100644 --- a/docs/examples/rear_port.py +++ b/docs/examples/rear_port.py @@ -7,25 +7,23 @@ - rear_port_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, Manufacturer, RearPort, Site, Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "rear_port-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -38,11 +36,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = rear_port_minimal() - # entity = rear_port_extended() - # entity = rear_port_explicit() + rear_port = rear_port_minimal() + # rear_port = rear_port_extended() + # rear_port = rear_port_explicit() - response = client.ingest(entities=[Entity(rear_port=entity)]) + response = client.ingest(entities=[Entity(rear_port=rear_port)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -52,7 +50,7 @@ def main(): def rear_port_minimal() -> RearPort: """Create a RearPort with only required fields using flat strings.""" return RearPort( - device="example-device", # flat string -> Device + device="Example Device", # flat string -> Device name="Example Name", type="110-punch", metadata={"source": "example"}, @@ -62,13 +60,12 @@ def rear_port_minimal() -> RearPort: def rear_port_extended() -> RearPort: """Create a RearPort with common optional fields.""" return RearPort( - device="example-device", + device="Example Device", name="Example Name", type="110-punch", - label="Example label", + metadata={"source": "example"}, color="0000ff", description="Example description", - metadata={"source": "example"}, ) @@ -80,46 +77,33 @@ def rear_port_explicit() -> RearPort: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", type="110-punch", - label="Example label", + metadata={"source": "example"}, color="0000ff", description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/region.py b/docs/examples/region.py index 53c2499..d38de88 100644 --- a/docs/examples/region.py +++ b/docs/examples/region.py @@ -7,8 +7,6 @@ - region_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "region-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = region_minimal() - # entity = region_extended() - # entity = region_explicit() + region = region_minimal() + # region = region_extended() + # region = region_explicit() - response = client.ingest(entities=[Entity(region=entity)]) + response = client.ingest(entities=[Entity(region=region)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def region_extended() -> Region: return Region( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def region_explicit() -> Region: return Region( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/rir.py b/docs/examples/rir.py index 07a6fb5..0a8e44f 100644 --- a/docs/examples/rir.py +++ b/docs/examples/rir.py @@ -7,8 +7,6 @@ - rir_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "rir-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = rir_minimal() - # entity = rir_extended() - # entity = rir_explicit() + rir = rir_minimal() + # rir = rir_extended() + # rir = rir_explicit() - response = client.ingest(entities=[Entity(rir=entity)]) + response = client.ingest(entities=[Entity(rir=rir)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def rir_extended() -> RIR: return RIR( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def rir_explicit() -> RIR: return RIR( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/role.py b/docs/examples/role.py index c8942d3..2a5ee6e 100644 --- a/docs/examples/role.py +++ b/docs/examples/role.py @@ -7,8 +7,6 @@ - role_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "role-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = role_minimal() - # entity = role_extended() - # entity = role_explicit() + role = role_minimal() + # role = role_extended() + # role = role_explicit() - response = client.ingest(entities=[Entity(role=entity)]) + response = client.ingest(entities=[Entity(role=role)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def role_extended() -> Role: return Role( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def role_explicit() -> Role: return Role( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/route_target.py b/docs/examples/route_target.py index 3dc22b0..3a75ffb 100644 --- a/docs/examples/route_target.py +++ b/docs/examples/route_target.py @@ -7,8 +7,6 @@ - route_target_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "route_target-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = route_target_minimal() - # entity = route_target_extended() - # entity = route_target_explicit() + route_target = route_target_minimal() + # route_target = route_target_extended() + # route_target = route_target_explicit() - response = client.ingest(entities=[Entity(route_target=entity)]) + response = client.ingest(entities=[Entity(route_target=route_target)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -57,9 +55,8 @@ def route_target_extended() -> RouteTarget: """Create a RouteTarget with common optional fields.""" return RouteTarget( name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -67,15 +64,13 @@ def route_target_explicit() -> RouteTarget: """Create a RouteTarget with fully nested objects and all common fields.""" return RouteTarget( name="Example Name", + metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/service.py b/docs/examples/service.py index 196b057..e29bfe9 100644 --- a/docs/examples/service.py +++ b/docs/examples/service.py @@ -7,8 +7,6 @@ - service_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "service-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = service_minimal() - # entity = service_extended() - # entity = service_explicit() + service = service_minimal() + # service = service_extended() + # service = service_explicit() - response = client.ingest(entities=[Entity(service=entity)]) + response = client.ingest(entities=[Entity(service=service)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,9 +54,8 @@ def service_extended() -> Service: """Create a Service with common optional fields.""" return Service( name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -66,10 +63,10 @@ def service_explicit() -> Service: """Create a Service with fully nested objects and all common fields.""" return Service( name="Example Name", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/site.py b/docs/examples/site.py index 987595c..c4cd529 100644 --- a/docs/examples/site.py +++ b/docs/examples/site.py @@ -7,8 +7,6 @@ - site_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "site-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = site_minimal() - # entity = site_extended() - # entity = site_explicit() + site = site_minimal() + # site = site_extended() + # site = site_explicit() - response = client.ingest(entities=[Entity(site=entity)]) + response = client.ingest(entities=[Entity(site=site)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -59,10 +57,9 @@ def site_extended() -> Site: return Site( name="Example Name", slug="example-slug", + metadata={"source": "example"}, status="active", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -71,16 +68,14 @@ def site_explicit() -> Site: return Site( name="Example Name", slug="example-slug", + metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/site_group.py b/docs/examples/site_group.py index fef9b27..00eba4e 100644 --- a/docs/examples/site_group.py +++ b/docs/examples/site_group.py @@ -7,8 +7,6 @@ - site_group_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tag, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "site_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = site_group_minimal() - # entity = site_group_extended() - # entity = site_group_explicit() + site_group = site_group_minimal() + # site_group = site_group_extended() + # site_group = site_group_explicit() - response = client.ingest(entities=[Entity(site_group=entity)]) + response = client.ingest(entities=[Entity(site_group=site_group)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def site_group_extended() -> SiteGroup: return SiteGroup( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def site_group_explicit() -> SiteGroup: return SiteGroup( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/tag.py b/docs/examples/tag.py index ca9ccf4..573a575 100644 --- a/docs/examples/tag.py +++ b/docs/examples/tag.py @@ -7,19 +7,13 @@ - tag_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - Tag, -) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "tag-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -32,11 +26,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = tag_minimal() - # entity = tag_extended() - # entity = tag_explicit() + tag = tag_minimal() + # tag = tag_extended() + # tag = tag_explicit() - response = client.ingest(entities=[Entity(tag=entity)]) + response = client.ingest(entities=[Entity(tag=tag)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -57,9 +51,9 @@ def tag_extended() -> Tag: return Tag( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", - metadata={"source": "example"}, ) @@ -68,9 +62,9 @@ def tag_explicit() -> Tag: return Tag( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", - metadata={"source": "example"}, ) diff --git a/docs/examples/tenant.py b/docs/examples/tenant.py index d50f8bb..5164cd3 100644 --- a/docs/examples/tenant.py +++ b/docs/examples/tenant.py @@ -7,8 +7,6 @@ - tenant_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ Tenant, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "tenant-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = tenant_minimal() - # entity = tenant_extended() - # entity = tenant_explicit() + tenant = tenant_minimal() + # tenant = tenant_extended() + # tenant = tenant_explicit() - response = client.ingest(entities=[Entity(tenant=entity)]) + response = client.ingest(entities=[Entity(tenant=tenant)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def tenant_extended() -> Tenant: return Tenant( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def tenant_explicit() -> Tenant: return Tenant( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/tenant_group.py b/docs/examples/tenant_group.py index dc472ce..d00eb1f 100644 --- a/docs/examples/tenant_group.py +++ b/docs/examples/tenant_group.py @@ -7,8 +7,6 @@ - tenant_group_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ TenantGroup, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "tenant_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = tenant_group_minimal() - # entity = tenant_group_extended() - # entity = tenant_group_explicit() + tenant_group = tenant_group_minimal() + # tenant_group = tenant_group_extended() + # tenant_group = tenant_group_explicit() - response = client.ingest(entities=[Entity(tenant_group=entity)]) + response = client.ingest(entities=[Entity(tenant_group=tenant_group)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def tenant_group_extended() -> TenantGroup: return TenantGroup( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def tenant_group_explicit() -> TenantGroup: return TenantGroup( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/tunnel.py b/docs/examples/tunnel.py index ed24b73..31cb4c2 100644 --- a/docs/examples/tunnel.py +++ b/docs/examples/tunnel.py @@ -7,8 +7,6 @@ - tunnel_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ Tunnel, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "tunnel-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = tunnel_minimal() - # entity = tunnel_extended() - # entity = tunnel_explicit() + tunnel = tunnel_minimal() + # tunnel = tunnel_extended() + # tunnel = tunnel_explicit() - response = client.ingest(entities=[Entity(tunnel=entity)]) + response = client.ingest(entities=[Entity(tunnel=tunnel)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -61,9 +59,8 @@ def tunnel_extended() -> Tunnel: name="Example Name", status="active", encapsulation="gre", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -73,15 +70,13 @@ def tunnel_explicit() -> Tunnel: name="Example Name", status="active", encapsulation="gre", + metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/tunnel_group.py b/docs/examples/tunnel_group.py index 4cbe32d..a1018c6 100644 --- a/docs/examples/tunnel_group.py +++ b/docs/examples/tunnel_group.py @@ -7,8 +7,6 @@ - tunnel_group_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ TunnelGroup, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "tunnel_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = tunnel_group_minimal() - # entity = tunnel_group_extended() - # entity = tunnel_group_explicit() + tunnel_group = tunnel_group_minimal() + # tunnel_group = tunnel_group_extended() + # tunnel_group = tunnel_group_explicit() - response = client.ingest(entities=[Entity(tunnel_group=entity)]) + response = client.ingest(entities=[Entity(tunnel_group=tunnel_group)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +56,8 @@ def tunnel_group_extended() -> TunnelGroup: return TunnelGroup( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +66,10 @@ def tunnel_group_explicit() -> TunnelGroup: return TunnelGroup( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/tunnel_termination.py b/docs/examples/tunnel_termination.py index f7da237..07c64e3 100644 --- a/docs/examples/tunnel_termination.py +++ b/docs/examples/tunnel_termination.py @@ -7,8 +7,6 @@ - tunnel_termination_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ TunnelTermination, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "tunnel_termination-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = tunnel_termination_minimal() - # entity = tunnel_termination_extended() - # entity = tunnel_termination_explicit() + tunnel_termination = tunnel_termination_minimal() + # tunnel_termination = tunnel_termination_extended() + # tunnel_termination = tunnel_termination_explicit() - response = client.ingest(entities=[Entity(tunnel_termination=entity)]) + response = client.ingest( + entities=[Entity(tunnel_termination=tunnel_termination)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +48,7 @@ def main(): def tunnel_termination_minimal() -> TunnelTermination: """Create a TunnelTermination with only required fields using flat strings.""" return TunnelTermination( - tunnel="example-tunnel", # flat string -> Tunnel + tunnel="Example Tunnel", # flat string -> Tunnel role="hub", metadata={"source": "example"}, ) @@ -57,7 +57,7 @@ def tunnel_termination_minimal() -> TunnelTermination: def tunnel_termination_extended() -> TunnelTermination: """Create a TunnelTermination with common optional fields.""" return TunnelTermination( - tunnel="example-tunnel", + tunnel="Example Tunnel", role="hub", metadata={"source": "example"}, ) @@ -69,14 +69,12 @@ def tunnel_termination_explicit() -> TunnelTermination: tunnel=Tunnel( name="Example Name", status="active", - encapsulation="gre", - description="Example description", - comments="Example comments", + encapsulation="Example Encapsulation", metadata={"source": "example"}, ), role="hub", - tags=[Tag(name="production")], metadata={"source": "example"}, + tags=[Tag(name="production")], ) diff --git a/docs/examples/virtual_chassis.py b/docs/examples/virtual_chassis.py index d3ffee1..e3c09de 100644 --- a/docs/examples/virtual_chassis.py +++ b/docs/examples/virtual_chassis.py @@ -7,8 +7,6 @@ - virtual_chassis_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ VirtualChassis, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "virtual_chassis-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = virtual_chassis_minimal() - # entity = virtual_chassis_extended() - # entity = virtual_chassis_explicit() + virtual_chassis = virtual_chassis_minimal() + # virtual_chassis = virtual_chassis_extended() + # virtual_chassis = virtual_chassis_explicit() - response = client.ingest(entities=[Entity(virtual_chassis=entity)]) + response = client.ingest(entities=[Entity(virtual_chassis=virtual_chassis)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -56,9 +54,8 @@ def virtual_chassis_extended() -> VirtualChassis: """Create a VirtualChassis with common optional fields.""" return VirtualChassis( name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -66,10 +63,10 @@ def virtual_chassis_explicit() -> VirtualChassis: """Create a VirtualChassis with fully nested objects and all common fields.""" return VirtualChassis( name="Example Name", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_circuit.py b/docs/examples/virtual_circuit.py index 0bffbf9..b7fa678 100644 --- a/docs/examples/virtual_circuit.py +++ b/docs/examples/virtual_circuit.py @@ -7,8 +7,6 @@ - virtual_circuit_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -20,11 +18,11 @@ VirtualCircuitType, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "virtual_circuit-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -37,11 +35,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = virtual_circuit_minimal() - # entity = virtual_circuit_extended() - # entity = virtual_circuit_explicit() + virtual_circuit = virtual_circuit_minimal() + # virtual_circuit = virtual_circuit_extended() + # virtual_circuit = virtual_circuit_explicit() - response = client.ingest(entities=[Entity(virtual_circuit=entity)]) + response = client.ingest(entities=[Entity(virtual_circuit=virtual_circuit)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -52,8 +50,8 @@ def virtual_circuit_minimal() -> VirtualCircuit: """Create a VirtualCircuit with only required fields using flat strings.""" return VirtualCircuit( cid="CID-001", - provider_network="example-provider-network", # flat string -> ProviderNetwork - type="example-type", # flat string -> VirtualCircuitType + provider_network="Example Provider Network", # flat string -> ProviderNetwork + type="Example Type", # flat string -> VirtualCircuitType metadata={"source": "example"}, ) @@ -62,12 +60,11 @@ def virtual_circuit_extended() -> VirtualCircuit: """Create a VirtualCircuit with common optional fields.""" return VirtualCircuit( cid="CID-001", - provider_network="example-provider-network", - type="example-type", + provider_network="Example Provider Network", + type="Example Type", + metadata={"source": "example"}, status="active", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -77,35 +74,25 @@ def virtual_circuit_explicit() -> VirtualCircuit: cid="CID-001", provider_network=ProviderNetwork( provider=Provider( - name="Example Name", - slug="example-slug", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), type=VirtualCircuitType( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), + metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_circuit_termination.py b/docs/examples/virtual_circuit_termination.py index 7539b16..e4ac270 100644 --- a/docs/examples/virtual_circuit_termination.py +++ b/docs/examples/virtual_circuit_termination.py @@ -7,14 +7,12 @@ - virtual_circuit_termination_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, Interface, Manufacturer, Provider, @@ -26,11 +24,11 @@ VirtualCircuitType, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "virtual_circuit_termination-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -43,11 +41,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = virtual_circuit_termination_minimal() - # entity = virtual_circuit_termination_extended() - # entity = virtual_circuit_termination_explicit() + virtual_circuit_termination = virtual_circuit_termination_minimal() + # virtual_circuit_termination = virtual_circuit_termination_extended() + # virtual_circuit_termination = virtual_circuit_termination_explicit() - response = client.ingest(entities=[Entity(virtual_circuit_termination=entity)]) + response = client.ingest( + entities=[Entity(virtual_circuit_termination=virtual_circuit_termination)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -57,8 +57,8 @@ def main(): def virtual_circuit_termination_minimal() -> VirtualCircuitTermination: """Create a VirtualCircuitTermination with only required fields using flat strings.""" return VirtualCircuitTermination( - virtual_circuit="example-virtual-circuit", # flat string -> VirtualCircuit - interface="example-interface", # flat string -> Interface + virtual_circuit="Example Virtual Circuit", # flat string -> VirtualCircuit + interface="Example Interface", # flat string -> Interface metadata={"source": "example"}, ) @@ -66,10 +66,10 @@ def virtual_circuit_termination_minimal() -> VirtualCircuitTermination: def virtual_circuit_termination_extended() -> VirtualCircuitTermination: """Create a VirtualCircuitTermination with common optional fields.""" return VirtualCircuitTermination( - virtual_circuit="example-virtual-circuit", - interface="example-interface", - description="Example description", + virtual_circuit="Example Virtual Circuit", + interface="Example Interface", metadata={"source": "example"}, + description="Example description", ) @@ -82,26 +82,18 @@ def virtual_circuit_termination_explicit() -> VirtualCircuitTermination: provider=Provider( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), type=VirtualCircuitType( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), interface=Interface( @@ -110,48 +102,34 @@ def virtual_circuit_termination_explicit() -> VirtualCircuitTermination: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", - type="1000base-bx10-d", - description="Example description", + type="Example Type", metadata={"source": "example"}, ), + metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_circuit_type.py b/docs/examples/virtual_circuit_type.py index ee50eee..e5495b2 100644 --- a/docs/examples/virtual_circuit_type.py +++ b/docs/examples/virtual_circuit_type.py @@ -7,8 +7,6 @@ - virtual_circuit_type_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ VirtualCircuitType, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "virtual_circuit_type-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = virtual_circuit_type_minimal() - # entity = virtual_circuit_type_extended() - # entity = virtual_circuit_type_explicit() + virtual_circuit_type = virtual_circuit_type_minimal() + # virtual_circuit_type = virtual_circuit_type_extended() + # virtual_circuit_type = virtual_circuit_type_explicit() - response = client.ingest(entities=[Entity(virtual_circuit_type=entity)]) + response = client.ingest( + entities=[Entity(virtual_circuit_type=virtual_circuit_type)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,10 +58,9 @@ def virtual_circuit_type_extended() -> VirtualCircuitType: return VirtualCircuitType( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -70,11 +69,11 @@ def virtual_circuit_type_explicit() -> VirtualCircuitType: return VirtualCircuitType( name="Example Name", slug="example-slug", + metadata={"source": "example"}, color="0000ff", description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_device_context.py b/docs/examples/virtual_device_context.py index 2bd75f1..3b82671 100644 --- a/docs/examples/virtual_device_context.py +++ b/docs/examples/virtual_device_context.py @@ -7,14 +7,12 @@ - virtual_device_context_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, Manufacturer, Site, Tag, @@ -22,11 +20,11 @@ VirtualDeviceContext, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "virtual_device_context-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -39,11 +37,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = virtual_device_context_minimal() - # entity = virtual_device_context_extended() - # entity = virtual_device_context_explicit() + virtual_device_context = virtual_device_context_minimal() + # virtual_device_context = virtual_device_context_extended() + # virtual_device_context = virtual_device_context_explicit() - response = client.ingest(entities=[Entity(virtual_device_context=entity)]) + response = client.ingest( + entities=[Entity(virtual_device_context=virtual_device_context)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -54,7 +54,7 @@ def virtual_device_context_minimal() -> VirtualDeviceContext: """Create a VirtualDeviceContext with only required fields using flat strings.""" return VirtualDeviceContext( name="Example Name", - device="example-device", # flat string -> Device + device="Example Device", # flat string -> Device status="active", metadata={"source": "example"}, ) @@ -64,11 +64,10 @@ def virtual_device_context_extended() -> VirtualDeviceContext: """Create a VirtualDeviceContext with common optional fields.""" return VirtualDeviceContext( name="Example Name", - device="example-device", + device="Example Device", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -81,49 +80,35 @@ def virtual_device_context_explicit() -> VirtualDeviceContext: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", + metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_disk.py b/docs/examples/virtual_disk.py index 75a041a..525bc61 100644 --- a/docs/examples/virtual_disk.py +++ b/docs/examples/virtual_disk.py @@ -7,8 +7,6 @@ - virtual_disk_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ VirtualMachine, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "virtual_disk-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = virtual_disk_minimal() - # entity = virtual_disk_extended() - # entity = virtual_disk_explicit() + virtual_disk = virtual_disk_minimal() + # virtual_disk = virtual_disk_extended() + # virtual_disk = virtual_disk_explicit() - response = client.ingest(entities=[Entity(virtual_disk=entity)]) + response = client.ingest(entities=[Entity(virtual_disk=virtual_disk)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +46,7 @@ def main(): def virtual_disk_minimal() -> VirtualDisk: """Create a VirtualDisk with only required fields using flat strings.""" return VirtualDisk( - virtual_machine="example-virtual-machine", # flat string -> VirtualMachine + virtual_machine="Example Virtual Machine", # flat string -> VirtualMachine name="Example Name", size=1, metadata={"source": "example"}, @@ -58,11 +56,11 @@ def virtual_disk_minimal() -> VirtualDisk: def virtual_disk_extended() -> VirtualDisk: """Create a VirtualDisk with common optional fields.""" return VirtualDisk( - virtual_machine="example-virtual-machine", + virtual_machine="Example Virtual Machine", name="Example Name", size=1, - description="Example description", metadata={"source": "example"}, + description="Example description", ) @@ -70,18 +68,13 @@ def virtual_disk_explicit() -> VirtualDisk: """Create a VirtualDisk with fully nested objects and all common fields.""" return VirtualDisk( virtual_machine=VirtualMachine( - name="Example Name", - status="active", - serial="SN-001234", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", status="active", metadata={"source": "example"} ), name="Example Name", size=1, + metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/virtual_machine.py b/docs/examples/virtual_machine.py index a1f0fa7..e542549 100644 --- a/docs/examples/virtual_machine.py +++ b/docs/examples/virtual_machine.py @@ -7,8 +7,6 @@ - virtual_machine_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -18,11 +16,11 @@ VirtualMachine, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "virtual_machine-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -35,11 +33,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = virtual_machine_minimal() - # entity = virtual_machine_extended() - # entity = virtual_machine_explicit() + virtual_machine = virtual_machine_minimal() + # virtual_machine = virtual_machine_extended() + # virtual_machine = virtual_machine_explicit() - response = client.ingest(entities=[Entity(virtual_machine=entity)]) + response = client.ingest(entities=[Entity(virtual_machine=virtual_machine)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,11 +56,10 @@ def virtual_machine_extended() -> VirtualMachine: """Create a VirtualMachine with common optional fields.""" return VirtualMachine( name="Example Name", + metadata={"source": "example"}, status="active", serial="SN-001234", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -70,22 +67,18 @@ def virtual_machine_explicit() -> VirtualMachine: """Create a VirtualMachine with fully nested objects and all common fields.""" return VirtualMachine( name="Example Name", + metadata={"source": "example"}, status="active", serial="SN-001234", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), platform=Platform( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/vlan.py b/docs/examples/vlan.py index b61e2d2..dca0942 100644 --- a/docs/examples/vlan.py +++ b/docs/examples/vlan.py @@ -7,8 +7,6 @@ - vlan_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ VLAN, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "vlan-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = vlan_minimal() - # entity = vlan_extended() - # entity = vlan_explicit() + vlan = vlan_minimal() + # vlan = vlan_extended() + # vlan = vlan_explicit() - response = client.ingest(entities=[Entity(vlan=entity)]) + response = client.ingest(entities=[Entity(vlan=vlan)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +46,7 @@ def main(): def vlan_minimal() -> VLAN: """Create a VLAN with only required fields using flat strings.""" return VLAN( - vid=100, + vid=1, name="Example Name", metadata={"source": "example"}, ) @@ -57,30 +55,27 @@ def vlan_minimal() -> VLAN: def vlan_extended() -> VLAN: """Create a VLAN with common optional fields.""" return VLAN( - vid=100, + vid=1, name="Example Name", + metadata={"source": "example"}, status="active", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) def vlan_explicit() -> VLAN: """Create a VLAN with fully nested objects and all common fields.""" return VLAN( - vid=100, + vid=1, name="Example Name", + metadata={"source": "example"}, status="active", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/vlan_group.py b/docs/examples/vlan_group.py index c0ed76f..29b681a 100644 --- a/docs/examples/vlan_group.py +++ b/docs/examples/vlan_group.py @@ -7,8 +7,6 @@ - vlan_group_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ VLANGroup, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "vlan_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = vlan_group_minimal() - # entity = vlan_group_extended() - # entity = vlan_group_explicit() + vlan_group = vlan_group_minimal() + # vlan_group = vlan_group_extended() + # vlan_group = vlan_group_explicit() - response = client.ingest(entities=[Entity(vlan_group=entity)]) + response = client.ingest(entities=[Entity(vlan_group=vlan_group)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -59,9 +57,8 @@ def vlan_group_extended() -> VLANGroup: return VLANGroup( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -70,15 +67,13 @@ def vlan_group_explicit() -> VLANGroup: return VLANGroup( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/vlan_translation_policy.py b/docs/examples/vlan_translation_policy.py index d316244..805c88e 100644 --- a/docs/examples/vlan_translation_policy.py +++ b/docs/examples/vlan_translation_policy.py @@ -7,19 +7,13 @@ - vlan_translation_policy_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient -from netboxlabs.diode.sdk.ingester import ( - Entity, - VLANTranslationPolicy, -) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "vlan_translation_policy-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -32,11 +26,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = vlan_translation_policy_minimal() - # entity = vlan_translation_policy_extended() - # entity = vlan_translation_policy_explicit() + vlan_translation_policy = vlan_translation_policy_minimal() + # vlan_translation_policy = vlan_translation_policy_extended() + # vlan_translation_policy = vlan_translation_policy_explicit() - response = client.ingest(entities=[Entity(vlan_translation_policy=entity)]) + response = client.ingest( + entities=[Entity(vlan_translation_policy=vlan_translation_policy)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -55,9 +51,8 @@ def vlan_translation_policy_extended() -> VLANTranslationPolicy: """Create a VLANTranslationPolicy with common optional fields.""" return VLANTranslationPolicy( name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -65,9 +60,9 @@ def vlan_translation_policy_explicit() -> VLANTranslationPolicy: """Create a VLANTranslationPolicy with fully nested objects and all common fields.""" return VLANTranslationPolicy( name="Example Name", + metadata={"source": "example"}, description="Example description", comments="Example comments", - metadata={"source": "example"}, ) diff --git a/docs/examples/vlan_translation_rule.py b/docs/examples/vlan_translation_rule.py index ab5446a..c4a2a8e 100644 --- a/docs/examples/vlan_translation_rule.py +++ b/docs/examples/vlan_translation_rule.py @@ -7,8 +7,6 @@ - vlan_translation_rule_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ VLANTranslationRule, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "vlan_translation_rule-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = vlan_translation_rule_minimal() - # entity = vlan_translation_rule_extended() - # entity = vlan_translation_rule_explicit() + vlan_translation_rule = vlan_translation_rule_minimal() + # vlan_translation_rule = vlan_translation_rule_extended() + # vlan_translation_rule = vlan_translation_rule_explicit() - response = client.ingest(entities=[Entity(vlan_translation_rule=entity)]) + response = client.ingest( + entities=[Entity(vlan_translation_rule=vlan_translation_rule)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -47,7 +47,7 @@ def main(): def vlan_translation_rule_minimal() -> VLANTranslationRule: """Create a VLANTranslationRule with only required fields using flat strings.""" return VLANTranslationRule( - policy="example-policy", # flat string -> VLANTranslationPolicy + policy="Example Policy", # flat string -> VLANTranslationPolicy local_vid=1, remote_vid=1, metadata={"source": "example"}, @@ -57,11 +57,11 @@ def vlan_translation_rule_minimal() -> VLANTranslationRule: def vlan_translation_rule_extended() -> VLANTranslationRule: """Create a VLANTranslationRule with common optional fields.""" return VLANTranslationRule( - policy="example-policy", + policy="Example Policy", local_vid=1, remote_vid=1, - description="Example description", metadata={"source": "example"}, + description="Example description", ) @@ -69,15 +69,12 @@ def vlan_translation_rule_explicit() -> VLANTranslationRule: """Create a VLANTranslationRule with fully nested objects and all common fields.""" return VLANTranslationRule( policy=VLANTranslationPolicy( - name="Example Name", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", metadata={"source": "example"} ), local_vid=1, remote_vid=1, - description="Example description", metadata={"source": "example"}, + description="Example description", ) diff --git a/docs/examples/vm_interface.py b/docs/examples/vm_interface.py index 26fb6e3..ab4952a 100644 --- a/docs/examples/vm_interface.py +++ b/docs/examples/vm_interface.py @@ -7,8 +7,6 @@ - vm_interface_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ VirtualMachine, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "vm_interface-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = vm_interface_minimal() - # entity = vm_interface_extended() - # entity = vm_interface_explicit() + vm_interface = vm_interface_minimal() + # vm_interface = vm_interface_extended() + # vm_interface = vm_interface_explicit() - response = client.ingest(entities=[Entity(vm_interface=entity)]) + response = client.ingest(entities=[Entity(vm_interface=vm_interface)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +46,7 @@ def main(): def vm_interface_minimal() -> VMInterface: """Create a VMInterface with only required fields using flat strings.""" return VMInterface( - virtual_machine="example-virtual-machine", # flat string -> VirtualMachine + virtual_machine="Example Virtual Machine", # flat string -> VirtualMachine name="Example Name", metadata={"source": "example"}, ) @@ -57,10 +55,10 @@ def vm_interface_minimal() -> VMInterface: def vm_interface_extended() -> VMInterface: """Create a VMInterface with common optional fields.""" return VMInterface( - virtual_machine="example-virtual-machine", + virtual_machine="Example Virtual Machine", name="Example Name", - description="Example description", metadata={"source": "example"}, + description="Example description", ) @@ -68,17 +66,12 @@ def vm_interface_explicit() -> VMInterface: """Create a VMInterface with fully nested objects and all common fields.""" return VMInterface( virtual_machine=VirtualMachine( - name="Example Name", - status="active", - serial="SN-001234", - description="Example description", - comments="Example comments", - metadata={"source": "example"}, + name="Example Name", status="active", metadata={"source": "example"} ), name="Example Name", + metadata={"source": "example"}, description="Example description", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/vrf.py b/docs/examples/vrf.py index 4560c22..08ed95b 100644 --- a/docs/examples/vrf.py +++ b/docs/examples/vrf.py @@ -7,8 +7,6 @@ - vrf_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ VRF, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "vrf-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = vrf_minimal() - # entity = vrf_extended() - # entity = vrf_explicit() + vrf = vrf_minimal() + # vrf = vrf_extended() + # vrf = vrf_explicit() - response = client.ingest(entities=[Entity(vrf=entity)]) + response = client.ingest(entities=[Entity(vrf=vrf)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -57,9 +55,8 @@ def vrf_extended() -> VRF: """Create a VRF with common optional fields.""" return VRF( name="Example Name", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -67,15 +64,13 @@ def vrf_explicit() -> VRF: """Create a VRF with fully nested objects and all common fields.""" return VRF( name="Example Name", + metadata={"source": "example"}, description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/wireless_lan.py b/docs/examples/wireless_lan.py index 29bb8ca..be7bfba 100644 --- a/docs/examples/wireless_lan.py +++ b/docs/examples/wireless_lan.py @@ -7,8 +7,6 @@ - wireless_lan_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -17,11 +15,11 @@ WirelessLAN, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "wireless_lan-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -34,11 +32,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = wireless_lan_minimal() - # entity = wireless_lan_extended() - # entity = wireless_lan_explicit() + wireless_lan = wireless_lan_minimal() + # wireless_lan = wireless_lan_extended() + # wireless_lan = wireless_lan_explicit() - response = client.ingest(entities=[Entity(wireless_lan=entity)]) + response = client.ingest(entities=[Entity(wireless_lan=wireless_lan)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -48,7 +46,7 @@ def main(): def wireless_lan_minimal() -> WirelessLAN: """Create a WirelessLAN with only required fields using flat strings.""" return WirelessLAN( - ssid="Example-SSID", + ssid="ExampleSSID", metadata={"source": "example"}, ) @@ -56,28 +54,25 @@ def wireless_lan_minimal() -> WirelessLAN: def wireless_lan_extended() -> WirelessLAN: """Create a WirelessLAN with common optional fields.""" return WirelessLAN( - ssid="Example-SSID", + ssid="ExampleSSID", + metadata={"source": "example"}, description="Example description", status="active", - comments="Example comments", - metadata={"source": "example"}, ) def wireless_lan_explicit() -> WirelessLAN: """Create a WirelessLAN with fully nested objects and all common fields.""" return WirelessLAN( - ssid="Example-SSID", + ssid="ExampleSSID", + metadata={"source": "example"}, description="Example description", status="active", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/wireless_lan_group.py b/docs/examples/wireless_lan_group.py index 6603e24..f92b290 100644 --- a/docs/examples/wireless_lan_group.py +++ b/docs/examples/wireless_lan_group.py @@ -7,8 +7,6 @@ - wireless_lan_group_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, @@ -16,11 +14,11 @@ WirelessLANGroup, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "wireless_lan_group-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -33,11 +31,13 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = wireless_lan_group_minimal() - # entity = wireless_lan_group_extended() - # entity = wireless_lan_group_explicit() + wireless_lan_group = wireless_lan_group_minimal() + # wireless_lan_group = wireless_lan_group_extended() + # wireless_lan_group = wireless_lan_group_explicit() - response = client.ingest(entities=[Entity(wireless_lan_group=entity)]) + response = client.ingest( + entities=[Entity(wireless_lan_group=wireless_lan_group)] + ) if response.errors: print(f"Errors: {response.errors}") else: @@ -58,9 +58,8 @@ def wireless_lan_group_extended() -> WirelessLANGroup: return WirelessLANGroup( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, + description="Example description", ) @@ -69,10 +68,10 @@ def wireless_lan_group_explicit() -> WirelessLANGroup: return WirelessLANGroup( name="Example Name", slug="example-slug", + metadata={"source": "example"}, description="Example description", comments="Example comments", tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/docs/examples/wireless_link.py b/docs/examples/wireless_link.py index ee2a82d..e9ff4d3 100644 --- a/docs/examples/wireless_link.py +++ b/docs/examples/wireless_link.py @@ -7,14 +7,12 @@ - wireless_link_explicit: Fully nested objects with all fields """ -import os - from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( - Entity, Device, DeviceRole, DeviceType, + Entity, Interface, Manufacturer, Site, @@ -23,11 +21,11 @@ WirelessLink, ) -TARGET = os.getenv("DIODE_TARGET", "grpc://localhost:8080/diode") +TARGET = "grpc://localhost:8080/diode" APP_NAME = "wireless_link-example" APP_VERSION = "1.0.0" -CLIENT_ID = os.getenv("DIODE_CLIENT_ID", "diode") -CLIENT_SECRET = os.getenv("DIODE_CLIENT_SECRET", "changeme") +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" def main(): @@ -40,11 +38,11 @@ def main(): client_secret=CLIENT_SECRET, ) as client: # Choose one of the three patterns: - entity = wireless_link_minimal() - # entity = wireless_link_extended() - # entity = wireless_link_explicit() + wireless_link = wireless_link_minimal() + # wireless_link = wireless_link_extended() + # wireless_link = wireless_link_explicit() - response = client.ingest(entities=[Entity(wireless_link=entity)]) + response = client.ingest(entities=[Entity(wireless_link=wireless_link)]) if response.errors: print(f"Errors: {response.errors}") else: @@ -54,8 +52,8 @@ def main(): def wireless_link_minimal() -> WirelessLink: """Create a WirelessLink with only required fields using flat strings.""" return WirelessLink( - interface_a="example-interface-a", # flat string -> Interface - interface_b="example-interface-b", # flat string -> Interface + interface_a="Example Interface A", # flat string -> Interface + interface_b="Example Interface B", # flat string -> Interface metadata={"source": "example"}, ) @@ -63,12 +61,11 @@ def wireless_link_minimal() -> WirelessLink: def wireless_link_extended() -> WirelessLink: """Create a WirelessLink with common optional fields.""" return WirelessLink( - interface_a="example-interface-a", - interface_b="example-interface-b", + interface_a="Example Interface A", + interface_b="Example Interface B", + metadata={"source": "example"}, status="connected", description="Example description", - comments="Example comments", - metadata={"source": "example"}, ) @@ -81,43 +78,29 @@ def wireless_link_explicit() -> WirelessLink: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", - type="1000base-bx10-d", - description="Example description", + type="Example Type", metadata={"source": "example"}, ), interface_b=Interface( @@ -126,55 +109,39 @@ def wireless_link_explicit() -> WirelessLink: manufacturer=Manufacturer( name="Example Name", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), model="Model X", slug="example-slug", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), role=DeviceRole( name="Example Name", slug="example-slug", color="0000ff", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), - serial="SN-001234", - asset_tag="ASSET-001", site=Site( name="Example Name", slug="example-slug", status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), status="active", - description="Example description", - comments="Example comments", metadata={"source": "example"}, ), name="Example Name", - label="Example label", - type="1000base-bx10-d", - description="Example description", + type="Example Type", metadata={"source": "example"}, ), + metadata={"source": "example"}, status="connected", description="Example description", comments="Example comments", tenant=Tenant( - name="Example Name", - slug="example-slug", - metadata={"source": "example"}, + name="Example Name", slug="example-slug", metadata={"source": "example"} ), tags=[Tag(name="production")], - metadata={"source": "example"}, ) diff --git a/netboxlabs/diode/sdk/ingester.py b/netboxlabs/diode/sdk/ingester.py index b9eee0f..a123c22 100644 --- a/netboxlabs/diode/sdk/ingester.py +++ b/netboxlabs/diode/sdk/ingester.py @@ -2,7 +2,8 @@ # # Generated code. DO NOT EDIT. -# Timestamp: 2026-02-11 02:15:58Z +# Source: NetBox v4.5.0 +# Timestamp: 2026-02-13 21:40:41Z # # ruff: noqa: C901 From c1ce78282c4d2b1839d192f2dffc2e6f905f68be Mon Sep 17 00:00:00 2001 From: Paul Stuart Date: Fri, 13 Feb 2026 15:14:06 -0800 Subject: [PATCH 7/8] missed from import --- docs/examples/cable_termination.py | 73 ++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 docs/examples/cable_termination.py diff --git a/docs/examples/cable_termination.py b/docs/examples/cable_termination.py new file mode 100644 index 0000000..2427b38 --- /dev/null +++ b/docs/examples/cable_termination.py @@ -0,0 +1,73 @@ +""" +CableTermination entity examples for the Diode Python SDK. + +This module demonstrates three patterns for ingesting CableTermination entities: +- cable_termination_minimal: Required fields only +- cable_termination_extended: Common optional fields +- cable_termination_explicit: Fully nested objects with all fields +""" + +from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Cable, + CableTermination, + Entity, +) + +TARGET = "grpc://localhost:8080/diode" +APP_NAME = "cable_termination-example" +APP_VERSION = "1.0.0" +CLIENT_ID = "diode" +CLIENT_SECRET = "changeme" + + +def main(): + """Main execution - demonstrates ingesting a CableTermination entity.""" + with DiodeClient( + target=TARGET, + app_name=APP_NAME, + app_version=APP_VERSION, + client_id=CLIENT_ID, + client_secret=CLIENT_SECRET, + ) as client: + # Choose one of the three patterns: + cable_termination = cable_termination_minimal() + # cable_termination = cable_termination_extended() + # cable_termination = cable_termination_explicit() + + response = client.ingest(entities=[Entity(cable_termination=cable_termination)]) + if response.errors: + print(f"Errors: {response.errors}") + else: + print("CableTermination ingested successfully") + + +def cable_termination_minimal() -> CableTermination: + """Create a CableTermination with only required fields using flat strings.""" + return CableTermination( + cable="Example Cable", # flat string -> Cable + cable_end="A", + metadata={"source": "example"}, + ) + + +def cable_termination_extended() -> CableTermination: + """Create a CableTermination with common optional fields.""" + return CableTermination( + cable="Example Cable", + cable_end="A", + metadata={"source": "example"}, + ) + + +def cable_termination_explicit() -> CableTermination: + """Create a CableTermination with fully nested objects and all common fields.""" + return CableTermination( + cable=Cable(status="active", color="0000ff", metadata={"source": "example"}), + cable_end="A", + metadata={"source": "example"}, + ) + + +if __name__ == "__main__": + main() From 15da09892c5c2004d3385880c87c3c3d9e1cf8a5 Mon Sep 17 00:00:00 2001 From: Paul Stuart Date: Tue, 17 Feb 2026 15:47:20 -0800 Subject: [PATCH 8/8] more complete examples --- docs/README.md | 2 +- docs/examples/aggregate.py | 17 +- docs/examples/asn.py | 22 +- docs/examples/asn_range.py | 17 +- docs/examples/cable.py | 31 ++- docs/examples/cable_path.py | 14 +- docs/examples/cable_termination.py | 8 +- docs/examples/circuit.py | 31 ++- docs/examples/circuit_group.py | 17 +- docs/examples/circuit_group_assignment.py | 10 +- docs/examples/circuit_termination.py | 18 +- docs/examples/circuit_type.py | 20 +- docs/examples/cluster.py | 21 +- docs/examples/cluster_group.py | 16 +- docs/examples/cluster_type.py | 16 +- docs/examples/console_port.py | 95 +++++++- docs/examples/console_server_port.py | 95 +++++++- docs/examples/contact.py | 30 ++- docs/examples/contact_assignment.py | 15 +- docs/examples/contact_group.py | 19 +- docs/examples/contact_role.py | 16 +- docs/examples/custom_field.py | 56 ++++- docs/examples/custom_field_choice_set.py | 23 +- docs/examples/custom_link.py | 29 ++- docs/examples/device.py | 100 +++++++- docs/examples/device_bay.py | 43 +++- docs/examples/device_config.py | 11 +- docs/examples/device_role.py | 28 ++- docs/examples/device_type.py | 36 ++- docs/examples/fhrp_group.py | 22 +- docs/examples/fhrp_group_assignment.py | 8 +- docs/examples/front_port.py | 99 +++++++- docs/examples/ike_policy.py | 20 +- docs/examples/ike_proposal.py | 20 +- docs/examples/interface_example.py | 229 ++++++++++++++++++- docs/examples/inventory_item.py | 67 +++++- docs/examples/inventory_item_role.py | 20 +- docs/examples/ip_address.py | 26 ++- docs/examples/ip_range.py | 28 ++- docs/examples/ip_sec_policy.py | 18 +- docs/examples/ip_sec_profile.py | 16 +- docs/examples/ip_sec_proposal.py | 24 +- docs/examples/journal_entry.py | 10 +- docs/examples/l2vpn.py | 25 +- docs/examples/l2vpn_termination.py | 8 +- docs/examples/location.py | 31 ++- docs/examples/mac_address.py | 16 +- docs/examples/manufacturer.py | 16 +- docs/examples/module.py | 19 +- docs/examples/module_bay.py | 159 ++++++++++++- docs/examples/module_type.py | 28 ++- docs/examples/module_type_profile.py | 18 +- docs/examples/owner.py | 8 +- docs/examples/owner_group.py | 8 +- docs/examples/platform.py | 24 +- docs/examples/power_feed.py | 44 +++- docs/examples/power_outlet.py | 134 ++++++++++- docs/examples/power_panel.py | 30 ++- docs/examples/power_port.py | 97 +++++++- docs/examples/prefix.py | 32 ++- docs/examples/provider.py | 16 +- docs/examples/provider_account.py | 18 +- docs/examples/provider_network.py | 18 +- docs/examples/rack.py | 82 ++++++- docs/examples/rack_reservation.py | 19 +- docs/examples/rack_role.py | 20 +- docs/examples/rack_type.py | 42 +++- docs/examples/rear_port.py | 97 +++++++- docs/examples/region.py | 19 +- docs/examples/rir.py | 18 +- docs/examples/role.py | 18 +- docs/examples/route_target.py | 17 +- docs/examples/service.py | 54 ++++- docs/examples/site.py | 38 ++- docs/examples/site_group.py | 19 +- docs/examples/tag.py | 14 +- docs/examples/tenant.py | 20 +- docs/examples/tenant_group.py | 19 +- docs/examples/tunnel.py | 37 ++- docs/examples/tunnel_group.py | 16 +- docs/examples/tunnel_termination.py | 12 +- docs/examples/virtual_chassis.py | 49 +++- docs/examples/virtual_circuit.py | 25 +- docs/examples/virtual_circuit_termination.py | 10 +- docs/examples/virtual_circuit_type.py | 20 +- docs/examples/virtual_device_context.py | 26 ++- docs/examples/virtual_disk.py | 15 +- docs/examples/virtual_machine.py | 90 +++++++- docs/examples/vlan.py | 39 +++- docs/examples/vlan_group.py | 17 +- docs/examples/vlan_translation_policy.py | 20 +- docs/examples/vlan_translation_rule.py | 8 +- docs/examples/vm_interface.py | 52 ++++- docs/examples/vrf.py | 21 +- docs/examples/wireless_lan.py | 35 ++- docs/examples/wireless_lan_group.py | 19 +- docs/examples/wireless_link.py | 29 ++- netboxlabs/diode/sdk/ingester.py | 2 +- 98 files changed, 3020 insertions(+), 230 deletions(-) diff --git a/docs/README.md b/docs/README.md index f5ba992..99c7e42 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,7 +1,7 @@ # Diode Python SDK - Entity Examples Source: NetBox v4.5.0 -Generated: 2026-02-13 21:40:42Z +Generated: 2026-02-17 23:39:38Z ## Prerequisites diff --git a/docs/examples/aggregate.py b/docs/examples/aggregate.py index c2ae030..0b79abd 100644 --- a/docs/examples/aggregate.py +++ b/docs/examples/aggregate.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Aggregate, Entity, + Owner, + OwnerGroup, RIR, Tag, Tenant, @@ -58,8 +60,10 @@ def aggregate_extended() -> Aggregate: return Aggregate( prefix="192.0.2.0/24", rir="Example RIR", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + tenant="Example Tenant", + comments="Example comments", ) @@ -70,12 +74,21 @@ def aggregate_explicit() -> Aggregate: rir=RIR( name="Example Name", slug="example-slug", metadata={"source": "example"} ), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/asn.py b/docs/examples/asn.py index 698cce7..fa0eb5b 100644 --- a/docs/examples/asn.py +++ b/docs/examples/asn.py @@ -11,6 +11,9 @@ from netboxlabs.diode.sdk.ingester import ( ASN, Entity, + Owner, + OwnerGroup, + RIR, Tag, Tenant, ) @@ -55,8 +58,11 @@ def asn_extended() -> ASN: """Create a ASN with common optional fields.""" return ASN( asn=64512, - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + rir="Example RIR", + tenant="Example Tenant", + comments="Example comments", ) @@ -64,12 +70,24 @@ def asn_explicit() -> ASN: """Create a ASN with fully nested objects and all common fields.""" return ASN( asn=64512, - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + rir=RIR( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/asn_range.py b/docs/examples/asn_range.py index 492504e..bc84b30 100644 --- a/docs/examples/asn_range.py +++ b/docs/examples/asn_range.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( ASNRange, Entity, + Owner, + OwnerGroup, RIR, Tag, Tenant, @@ -64,8 +66,10 @@ def asn_range_extended() -> ASNRange: rir="Example RIR", start=1, end=1, - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + tenant="Example Tenant", + comments="Example comments", ) @@ -79,12 +83,21 @@ def asn_range_explicit() -> ASNRange: ), start=1, end=1, - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/cable.py b/docs/examples/cable.py index c3bc9c3..a11ecd5 100644 --- a/docs/examples/cable.py +++ b/docs/examples/cable.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Cable, Entity, + Owner, + OwnerGroup, Tag, Tenant, ) @@ -53,24 +55,45 @@ def cable_minimal() -> Cable: def cable_extended() -> Cable: """Create a Cable with common optional fields.""" return Cable( - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="connected", - color="0000ff", description="Example description", + color="0000ff", + type="aoc", + tenant="Example Tenant", + label="Example Label", + length=1.0, + length_unit="cm", + comments="Example comments", + profile="breakout-1c4p-4c1p", ) def cable_explicit() -> Cable: """Create a Cable with fully nested objects and all common fields.""" return Cable( - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="connected", - color="0000ff", description="Example description", + color="0000ff", comments="Example comments", + type="aoc", + label="Example Label", + length=1.0, + length_unit="cm", + profile="breakout-1c4p-4c1p", tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/cable_path.py b/docs/examples/cable_path.py index 4bdd078..30fa92b 100644 --- a/docs/examples/cable_path.py +++ b/docs/examples/cable_path.py @@ -47,14 +47,24 @@ def cable_path_minimal() -> CablePath: def cable_path_extended() -> CablePath: """Create a CablePath with common optional fields.""" return CablePath( - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, + is_active=True, + is_complete=True, + is_split=True, ) def cable_path_explicit() -> CablePath: """Create a CablePath with fully nested objects and all common fields.""" return CablePath( - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, + is_active=True, + is_complete=True, + is_split=True, ) diff --git a/docs/examples/cable_termination.py b/docs/examples/cable_termination.py index 2427b38..d0b44a0 100644 --- a/docs/examples/cable_termination.py +++ b/docs/examples/cable_termination.py @@ -56,7 +56,7 @@ def cable_termination_extended() -> CableTermination: return CableTermination( cable="Example Cable", cable_end="A", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, ) @@ -65,7 +65,11 @@ def cable_termination_explicit() -> CableTermination: return CableTermination( cable=Cable(status="active", color="0000ff", metadata={"source": "example"}), cable_end="A", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, ) diff --git a/docs/examples/circuit.py b/docs/examples/circuit.py index 7364e6c..1ce975f 100644 --- a/docs/examples/circuit.py +++ b/docs/examples/circuit.py @@ -12,7 +12,10 @@ Circuit, CircuitType, Entity, + Owner, + OwnerGroup, Provider, + ProviderAccount, Tag, Tenant, ) @@ -61,9 +64,14 @@ def circuit_extended() -> Circuit: cid="CID-001", provider="Example Provider", type="Example Type", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", description="Example description", + tenant="Example Tenant", + commit_rate=1, + distance=1.0, + distance_unit="ft", + comments="Example comments", ) @@ -80,13 +88,32 @@ def circuit_explicit() -> Circuit: color="0000ff", metadata={"source": "example"}, ), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", description="Example description", comments="Example comments", + commit_rate=1, + distance=1.0, + distance_unit="ft", + provider_account=ProviderAccount( + provider=Provider( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + account="Example Account", + metadata={"source": "example"}, + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/circuit_group.py b/docs/examples/circuit_group.py index 02520ed..cd68c8e 100644 --- a/docs/examples/circuit_group.py +++ b/docs/examples/circuit_group.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( CircuitGroup, Entity, + Owner, + OwnerGroup, Tag, Tenant, ) @@ -57,8 +59,10 @@ def circuit_group_extended() -> CircuitGroup: return CircuitGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + tenant="Example Tenant", + comments="Example comments", ) @@ -67,12 +71,21 @@ def circuit_group_explicit() -> CircuitGroup: return CircuitGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/circuit_group_assignment.py b/docs/examples/circuit_group_assignment.py index 31fcd2a..3272774 100644 --- a/docs/examples/circuit_group_assignment.py +++ b/docs/examples/circuit_group_assignment.py @@ -57,7 +57,8 @@ def circuit_group_assignment_extended() -> CircuitGroupAssignment: """Create a CircuitGroupAssignment with common optional fields.""" return CircuitGroupAssignment( group="Example Group", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, + priority="inactive", ) @@ -67,7 +68,12 @@ def circuit_group_assignment_explicit() -> CircuitGroupAssignment: group=CircuitGroup( name="Example Name", slug="example-slug", metadata={"source": "example"} ), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, + priority="inactive", tags=[Tag(name="production")], ) diff --git a/docs/examples/circuit_termination.py b/docs/examples/circuit_termination.py index ebf841b..7d655d6 100644 --- a/docs/examples/circuit_termination.py +++ b/docs/examples/circuit_termination.py @@ -61,8 +61,13 @@ def circuit_termination_extended() -> CircuitTermination: return CircuitTermination( circuit="Example Circuit", term_side="A", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + port_speed=1, + upstream_speed=1, + xconnect_id="Example Xconnect Id", + pp_info="Example Pp Info", + mark_connected=True, ) @@ -84,8 +89,17 @@ def circuit_termination_explicit() -> CircuitTermination: metadata={"source": "example"}, ), term_side="A", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + port_speed=1, + upstream_speed=1, + xconnect_id="Example Xconnect Id", + pp_info="Example Pp Info", + mark_connected=True, tags=[Tag(name="production")], ) diff --git a/docs/examples/circuit_type.py b/docs/examples/circuit_type.py index 98fea08..b824b81 100644 --- a/docs/examples/circuit_type.py +++ b/docs/examples/circuit_type.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( CircuitType, Entity, + Owner, + OwnerGroup, Tag, ) @@ -56,9 +58,10 @@ def circuit_type_extended() -> CircuitType: return CircuitType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + color="0000ff", + comments="Example comments", ) @@ -67,10 +70,19 @@ def circuit_type_explicit() -> CircuitType: return CircuitType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + color="0000ff", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/cluster.py b/docs/examples/cluster.py index 6b37003..777c294 100644 --- a/docs/examples/cluster.py +++ b/docs/examples/cluster.py @@ -10,8 +10,11 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Cluster, + ClusterGroup, ClusterType, Entity, + Owner, + OwnerGroup, Tag, Tenant, ) @@ -58,9 +61,11 @@ def cluster_extended() -> Cluster: return Cluster( name="Example Name", type="Example Type", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", description="Example description", + tenant="Example Tenant", + comments="Example comments", ) @@ -71,13 +76,25 @@ def cluster_explicit() -> Cluster: type=ClusterType( name="Example Name", slug="example-slug", metadata={"source": "example"} ), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", description="Example description", comments="Example comments", + group=ClusterGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/cluster_group.py b/docs/examples/cluster_group.py index 9d48651..26b651a 100644 --- a/docs/examples/cluster_group.py +++ b/docs/examples/cluster_group.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( ClusterGroup, Entity, + Owner, + OwnerGroup, Tag, ) @@ -56,8 +58,9 @@ def cluster_group_extended() -> ClusterGroup: return ClusterGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -66,9 +69,18 @@ def cluster_group_explicit() -> ClusterGroup: return ClusterGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/cluster_type.py b/docs/examples/cluster_type.py index f03b059..cc2271d 100644 --- a/docs/examples/cluster_type.py +++ b/docs/examples/cluster_type.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( ClusterType, Entity, + Owner, + OwnerGroup, Tag, ) @@ -56,8 +58,9 @@ def cluster_type_extended() -> ClusterType: return ClusterType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -66,9 +69,18 @@ def cluster_type_explicit() -> ClusterType: return ClusterType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/console_port.py b/docs/examples/console_port.py index 2be7044..a0d0b68 100644 --- a/docs/examples/console_port.py +++ b/docs/examples/console_port.py @@ -15,6 +15,11 @@ DeviceType, Entity, Manufacturer, + Module, + ModuleBay, + ModuleType, + Owner, + OwnerGroup, Site, Tag, ) @@ -61,8 +66,12 @@ def console_port_extended() -> ConsolePort: return ConsolePort( device="Example Device", name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + label="Example Label", + type="db-25", + speed=1, + mark_connected=True, ) @@ -96,8 +105,90 @@ def console_port_explicit() -> ConsolePort: metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + label="Example Label", + type="db-25", + speed=1, + mark_connected=True, + module=Module( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + module_bay=ModuleBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + module_type=ModuleType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/console_server_port.py b/docs/examples/console_server_port.py index 5b349d9..dda1700 100644 --- a/docs/examples/console_server_port.py +++ b/docs/examples/console_server_port.py @@ -15,6 +15,11 @@ DeviceType, Entity, Manufacturer, + Module, + ModuleBay, + ModuleType, + Owner, + OwnerGroup, Site, Tag, ) @@ -63,8 +68,12 @@ def console_server_port_extended() -> ConsoleServerPort: return ConsoleServerPort( device="Example Device", name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + label="Example Label", + type="db-25", + speed=1, + mark_connected=True, ) @@ -98,8 +107,90 @@ def console_server_port_explicit() -> ConsoleServerPort: metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + label="Example Label", + type="db-25", + speed=1, + mark_connected=True, + module=Module( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + module_bay=ModuleBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + module_type=ModuleType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/contact.py b/docs/examples/contact.py index ec0380a..20afd5a 100644 --- a/docs/examples/contact.py +++ b/docs/examples/contact.py @@ -10,7 +10,10 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Contact, + ContactGroup, Entity, + Owner, + OwnerGroup, Tag, ) @@ -54,8 +57,14 @@ def contact_extended() -> Contact: """Create a Contact with common optional fields.""" return Contact( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + title="Example Title", + phone="Example Phone", + email="Example Email", + address="192.0.2.1/32", + link="Example Link", + comments="Example comments", ) @@ -63,9 +72,26 @@ def contact_explicit() -> Contact: """Create a Contact with fully nested objects and all common fields.""" return Contact( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + title="Example Title", + phone="Example Phone", + email="Example Email", + address="192.0.2.1/32", + link="Example Link", + group=ContactGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/contact_assignment.py b/docs/examples/contact_assignment.py index b527fc7..b85c277 100644 --- a/docs/examples/contact_assignment.py +++ b/docs/examples/contact_assignment.py @@ -11,6 +11,7 @@ from netboxlabs.diode.sdk.ingester import ( Contact, ContactAssignment, + ContactRole, Entity, Tag, ) @@ -57,7 +58,9 @@ def contact_assignment_extended() -> ContactAssignment: """Create a ContactAssignment with common optional fields.""" return ContactAssignment( contact="Example Contact", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, + role="Example Role", + priority="inactive", ) @@ -65,7 +68,15 @@ def contact_assignment_explicit() -> ContactAssignment: """Create a ContactAssignment with fully nested objects and all common fields.""" return ContactAssignment( contact=Contact(name="Example Name", metadata={"source": "example"}), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, + priority="inactive", + role=ContactRole( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/contact_group.py b/docs/examples/contact_group.py index 4038984..393127e 100644 --- a/docs/examples/contact_group.py +++ b/docs/examples/contact_group.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( ContactGroup, Entity, + Owner, + OwnerGroup, Tag, ) @@ -56,8 +58,9 @@ def contact_group_extended() -> ContactGroup: return ContactGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -66,9 +69,21 @@ def contact_group_explicit() -> ContactGroup: return ContactGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + parent=ContactGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/contact_role.py b/docs/examples/contact_role.py index 2bfa99a..41a8bce 100644 --- a/docs/examples/contact_role.py +++ b/docs/examples/contact_role.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( ContactRole, Entity, + Owner, + OwnerGroup, Tag, ) @@ -56,8 +58,9 @@ def contact_role_extended() -> ContactRole: return ContactRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -66,9 +69,18 @@ def contact_role_explicit() -> ContactRole: return ContactRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/custom_field.py b/docs/examples/custom_field.py index 77d61e1..31a19cd 100644 --- a/docs/examples/custom_field.py +++ b/docs/examples/custom_field.py @@ -8,6 +8,13 @@ """ from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + CustomField, + CustomFieldChoiceSet, + Entity, + Owner, + OwnerGroup, +) TARGET = "grpc://localhost:8080/diode" APP_NAME = "custom_field-example" @@ -51,8 +58,25 @@ def custom_field_extended() -> CustomField: return CustomField( type="boolean", name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + related_object_type="circuits.circuit", + label="Example Label", + group_name="Example Group Name", + required=True, + unique=True, + search_weight=1, + filter_logic="disabled", + ui_visible="always", + ui_editable="hidden", + is_cloneable=True, + default="Example Default", + related_object_filter="Example Related Object Filter", + weight=1, + validation_minimum=1.0, + validation_maximum=1.0, + validation_regex="Example Validation Regex", + comments="Example comments", ) @@ -61,9 +85,37 @@ def custom_field_explicit() -> CustomField: return CustomField( type="boolean", name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + related_object_type="circuits.circuit", + label="Example Label", + group_name="Example Group Name", + required=True, + unique=True, + search_weight=1, + filter_logic="disabled", + ui_visible="always", + ui_editable="hidden", + is_cloneable=True, + default="Example Default", + related_object_filter="Example Related Object Filter", + weight=1, + validation_minimum=1.0, + validation_maximum=1.0, + validation_regex="Example Validation Regex", + choice_set=CustomFieldChoiceSet( + name="Example Name", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), ) diff --git a/docs/examples/custom_field_choice_set.py b/docs/examples/custom_field_choice_set.py index 80cf659..5686986 100644 --- a/docs/examples/custom_field_choice_set.py +++ b/docs/examples/custom_field_choice_set.py @@ -8,6 +8,12 @@ """ from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + CustomFieldChoiceSet, + Entity, + Owner, + OwnerGroup, +) TARGET = "grpc://localhost:8080/diode" APP_NAME = "custom_field_choice_set-example" @@ -51,8 +57,10 @@ def custom_field_choice_set_extended() -> CustomFieldChoiceSet: """Create a CustomFieldChoiceSet with common optional fields.""" return CustomFieldChoiceSet( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + base_choices="IATA", + order_alphabetically=True, ) @@ -60,8 +68,19 @@ def custom_field_choice_set_explicit() -> CustomFieldChoiceSet: """Create a CustomFieldChoiceSet with fully nested objects and all common fields.""" return CustomFieldChoiceSet( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + base_choices="IATA", + order_alphabetically=True, + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), ) diff --git a/docs/examples/custom_link.py b/docs/examples/custom_link.py index e920a42..964e947 100644 --- a/docs/examples/custom_link.py +++ b/docs/examples/custom_link.py @@ -8,6 +8,12 @@ """ from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + CustomLink, + Entity, + Owner, + OwnerGroup, +) TARGET = "grpc://localhost:8080/diode" APP_NAME = "custom_link-example" @@ -53,7 +59,12 @@ def custom_link_extended() -> CustomLink: name="Example Name", link_text="Example Link Text", link_url="Example Link Url", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, + enabled=True, + weight=1, + group_name="Example Group Name", + button_class="black", + new_window=True, ) @@ -63,7 +74,21 @@ def custom_link_explicit() -> CustomLink: name="Example Name", link_text="Example Link Text", link_url="Example Link Url", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, + enabled=True, + weight=1, + group_name="Example Group Name", + button_class="black", + new_window=True, + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), ) diff --git a/docs/examples/device.py b/docs/examples/device.py index 08350ef..93934bb 100644 --- a/docs/examples/device.py +++ b/docs/examples/device.py @@ -9,15 +9,24 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Cluster, + ClusterType, Device, + DeviceConfig, DeviceRole, DeviceType, Entity, + IPAddress, + Location, Manufacturer, + Owner, + OwnerGroup, Platform, + Rack, Site, Tag, Tenant, + VirtualChassis, ) TARGET = "grpc://localhost:8080/diode" @@ -64,10 +73,25 @@ def device_extended() -> Device: device_type="Model X", role="Example Role", site="Example Site", - metadata={"source": "example"}, - serial="SN-001234", + metadata={"source": "example", "custom_key": "custom_value"}, status="active", + serial="SN-001234", description="Example description", + name="Example Name", + tenant="Example Tenant", + platform="Example Platform", + asset_tag="ASSET-001", + location="Example Location", + rack="Example Rack", + position=1.0, + face="front", + latitude=1.0, + longitude=1.0, + airflow="bottom-to-top", + cluster="Example Cluster", + vc_position=1, + vc_priority=1, + comments="Example comments", ) @@ -94,18 +118,84 @@ def device_explicit() -> Device: status="active", metadata={"source": "example"}, ), - metadata={"source": "example"}, - serial="SN-001234", - asset_tag="ASSET-001", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", + serial="SN-001234", description="Example description", comments="Example comments", + asset_tag="ASSET-001", + name="Example Name", + position=1.0, + face="front", + latitude=1.0, + longitude=1.0, + airflow="bottom-to-top", + vc_position=1, + vc_priority=1, tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), platform=Platform( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + location=Location( + name="Example Name", + slug="example-slug", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + rack=Rack( + name="Example Name", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + primary_ip4=IPAddress( + address="192.0.2.1/32", status="active", metadata={"source": "example"} + ), + primary_ip6=IPAddress( + address="192.0.2.1/32", status="active", metadata={"source": "example"} + ), + oob_ip=IPAddress( + address="192.0.2.1/32", status="active", metadata={"source": "example"} + ), + cluster=Cluster( + name="Example Name", + type=ClusterType( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + status="active", + metadata={"source": "example"}, + ), + virtual_chassis=VirtualChassis( + name="Example Name", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), + config=DeviceConfig( + startup=b"example data", + running=b"example data", + candidate=b"example data", + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/device_bay.py b/docs/examples/device_bay.py index 5fc92db..84a9260 100644 --- a/docs/examples/device_bay.py +++ b/docs/examples/device_bay.py @@ -15,6 +15,8 @@ DeviceType, Entity, Manufacturer, + Owner, + OwnerGroup, Site, Tag, ) @@ -61,8 +63,9 @@ def device_bay_extended() -> DeviceBay: return DeviceBay( device="Example Device", name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + label="Example Label", ) @@ -96,8 +99,44 @@ def device_bay_explicit() -> DeviceBay: metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + label="Example Label", + installed_device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/device_config.py b/docs/examples/device_config.py index 7e7d301..3a995a4 100644 --- a/docs/examples/device_config.py +++ b/docs/examples/device_config.py @@ -41,8 +41,6 @@ def device_config_minimal() -> DeviceConfig: """Create a DeviceConfig with only required fields using flat strings.""" return DeviceConfig( startup=b"example data", - running=b"example data", - candidate=b"example data", metadata={"source": "example"}, ) @@ -52,8 +50,7 @@ def device_config_extended() -> DeviceConfig: return DeviceConfig( startup=b"example data", running=b"example data", - candidate=b"example data", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, ) @@ -63,7 +60,11 @@ def device_config_explicit() -> DeviceConfig: startup=b"example data", running=b"example data", candidate=b"example data", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, ) diff --git a/docs/examples/device_role.py b/docs/examples/device_role.py index df11336..a265ad0 100644 --- a/docs/examples/device_role.py +++ b/docs/examples/device_role.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( DeviceRole, Entity, + Owner, + OwnerGroup, Tag, ) @@ -56,9 +58,11 @@ def device_role_extended() -> DeviceRole: return DeviceRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + color="0000ff", + vm_role=True, + comments="Example comments", ) @@ -67,10 +71,26 @@ def device_role_explicit() -> DeviceRole: return DeviceRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + color="0000ff", comments="Example comments", + vm_role=True, + parent=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/device_type.py b/docs/examples/device_type.py index a98e754..3d2352d 100644 --- a/docs/examples/device_type.py +++ b/docs/examples/device_type.py @@ -12,6 +12,9 @@ DeviceType, Entity, Manufacturer, + Owner, + OwnerGroup, + Platform, Tag, ) @@ -59,8 +62,17 @@ def device_type_extended() -> DeviceType: manufacturer="Example Manufacturer", model="Model X", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + part_number="Example Part Number", + u_height=1.0, + exclude_from_utilization=True, + is_full_depth=True, + subdevice_role="child", + airflow="bottom-to-top", + weight=1.0, + weight_unit="g", + comments="Example comments", ) @@ -72,9 +84,29 @@ def device_type_explicit() -> DeviceType: ), model="Model X", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + part_number="Example Part Number", + u_height=1.0, + exclude_from_utilization=True, + is_full_depth=True, + subdevice_role="child", + airflow="bottom-to-top", + weight=1.0, + weight_unit="g", + default_platform=Platform( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/fhrp_group.py b/docs/examples/fhrp_group.py index 6367166..4414aa8 100644 --- a/docs/examples/fhrp_group.py +++ b/docs/examples/fhrp_group.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, FHRPGroup, + Owner, + OwnerGroup, Tag, ) @@ -56,8 +58,12 @@ def fhrp_group_extended() -> FHRPGroup: return FHRPGroup( protocol="carp", group_id=1, - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + name="Example Name", + auth_type="md5", + auth_key="Example Auth Key", + comments="Example comments", ) @@ -66,9 +72,21 @@ def fhrp_group_explicit() -> FHRPGroup: return FHRPGroup( protocol="carp", group_id=1, - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + name="Example Name", + auth_type="md5", + auth_key="Example Auth Key", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/fhrp_group_assignment.py b/docs/examples/fhrp_group_assignment.py index 9ea731b..4c60662 100644 --- a/docs/examples/fhrp_group_assignment.py +++ b/docs/examples/fhrp_group_assignment.py @@ -58,7 +58,7 @@ def fhrp_group_assignment_extended() -> FHRPGroupAssignment: return FHRPGroupAssignment( group="Example Group", priority=1, - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, ) @@ -69,7 +69,11 @@ def fhrp_group_assignment_explicit() -> FHRPGroupAssignment: protocol="Example Protocol", group_id=1, metadata={"source": "example"} ), priority=1, - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, ) diff --git a/docs/examples/front_port.py b/docs/examples/front_port.py index 46260ae..37fe25d 100644 --- a/docs/examples/front_port.py +++ b/docs/examples/front_port.py @@ -15,6 +15,11 @@ Entity, FrontPort, Manufacturer, + Module, + ModuleBay, + ModuleType, + Owner, + OwnerGroup, RearPort, Site, Tag, @@ -66,9 +71,13 @@ def front_port_extended() -> FrontPort: name="Example Name", type="110-punch", rear_port="Example Rear Port", - metadata={"source": "example"}, - color="0000ff", + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + color="0000ff", + label="Example Label", + rear_port_position=1, + mark_connected=True, + positions=1, ) @@ -135,9 +144,91 @@ def front_port_explicit() -> FrontPort: color="0000ff", metadata={"source": "example"}, ), - metadata={"source": "example"}, - color="0000ff", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + color="0000ff", + label="Example Label", + rear_port_position=1, + mark_connected=True, + positions=1, + module=Module( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + module_bay=ModuleBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + module_type=ModuleType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/ike_policy.py b/docs/examples/ike_policy.py index dcb89bc..1302a90 100644 --- a/docs/examples/ike_policy.py +++ b/docs/examples/ike_policy.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, IKEPolicy, + Owner, + OwnerGroup, Tag, ) @@ -56,8 +58,11 @@ def ike_policy_extended() -> IKEPolicy: return IKEPolicy( name="Example Name", version=1, - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + mode="aggressive", + preshared_key="Example Preshared Key", + comments="Example comments", ) @@ -66,9 +71,20 @@ def ike_policy_explicit() -> IKEPolicy: return IKEPolicy( name="Example Name", version=1, - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + mode="aggressive", + preshared_key="Example Preshared Key", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/ike_proposal.py b/docs/examples/ike_proposal.py index 24c1764..5b22b52 100644 --- a/docs/examples/ike_proposal.py +++ b/docs/examples/ike_proposal.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, IKEProposal, + Owner, + OwnerGroup, Tag, ) @@ -60,8 +62,11 @@ def ike_proposal_extended() -> IKEProposal: authentication_method="certificates", encryption_algorithm="3des-cbc", group=1, - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + authentication_algorithm="hmac-md5", + sa_lifetime=1, + comments="Example comments", ) @@ -72,9 +77,20 @@ def ike_proposal_explicit() -> IKEProposal: authentication_method="certificates", encryption_algorithm="3des-cbc", group=1, - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + authentication_algorithm="hmac-md5", + sa_lifetime=1, + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/interface_example.py b/docs/examples/interface_example.py index 39256ba..98e9f06 100644 --- a/docs/examples/interface_example.py +++ b/docs/examples/interface_example.py @@ -14,9 +14,18 @@ DeviceType, Entity, Interface, + MACAddress, Manufacturer, + Module, + ModuleBay, + ModuleType, + Owner, + OwnerGroup, Site, Tag, + VLAN, + VLANTranslationPolicy, + VRF, ) TARGET = "grpc://localhost:8080/diode" @@ -63,8 +72,24 @@ def interface_example_extended() -> Interface: device="Example Device", name="Example Name", type="1000base-bx10-d", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + label="Example Label", + enabled=True, + mtu=1, + speed=1, + duplex="auto", + wwn="Example Wwn", + mgmt_only=True, + mode="access", + rf_role="ap", + rf_channel="2.4g-1-2412-22", + poe_mode="pd", + poe_type="passive-24v-2pair", + rf_channel_frequency=1.0, + rf_channel_width=1.0, + tx_power=1, + mark_connected=True, ) @@ -99,8 +124,208 @@ def interface_example_explicit() -> Interface: ), name="Example Name", type="1000base-bx10-d", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + label="Example Label", + enabled=True, + mtu=1, + speed=1, + duplex="auto", + wwn="Example Wwn", + mgmt_only=True, + mode="access", + rf_role="ap", + rf_channel="2.4g-1-2412-22", + poe_mode="pd", + poe_type="passive-24v-2pair", + rf_channel_frequency=1.0, + rf_channel_width=1.0, + tx_power=1, + mark_connected=True, + module=Module( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + module_bay=ModuleBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + module_type=ModuleType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + parent=Interface( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + type="Example Type", + metadata={"source": "example"}, + ), + bridge=Interface( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + type="Example Type", + metadata={"source": "example"}, + ), + lag=Interface( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + type="Example Type", + metadata={"source": "example"}, + ), + primary_mac_address=MACAddress( + mac_address="00:11:22:33:44:55", metadata={"source": "example"} + ), + untagged_vlan=VLAN( + vid=1, name="Example Name", status="active", metadata={"source": "example"} + ), + qinq_svlan=VLAN( + vid=1, name="Example Name", status="active", metadata={"source": "example"} + ), + vlan_translation_policy=VLANTranslationPolicy( + name="Example Name", metadata={"source": "example"} + ), + vrf=VRF(name="Example Name", metadata={"source": "example"}), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/inventory_item.py b/docs/examples/inventory_item.py index 9f6137a..56ce544 100644 --- a/docs/examples/inventory_item.py +++ b/docs/examples/inventory_item.py @@ -14,7 +14,10 @@ DeviceType, Entity, InventoryItem, + InventoryItemRole, Manufacturer, + Owner, + OwnerGroup, Site, Tag, ) @@ -61,10 +64,16 @@ def inventory_item_extended() -> InventoryItem: return InventoryItem( device="Example Device", name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", serial="SN-001234", description="Example description", + label="Example Label", + role="Example Role", + manufacturer="Example Manufacturer", + part_id="Example Part Id", + asset_tag="ASSET-001", + discovered=True, ) @@ -98,11 +107,63 @@ def inventory_item_explicit() -> InventoryItem: metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", serial="SN-001234", - asset_tag="ASSET-001", description="Example description", + asset_tag="ASSET-001", + label="Example Label", + part_id="Example Part Id", + discovered=True, + parent=InventoryItem( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + status="active", + metadata={"source": "example"}, + ), + role=InventoryItemRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + manufacturer=Manufacturer( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/inventory_item_role.py b/docs/examples/inventory_item_role.py index 51442b2..f62d423 100644 --- a/docs/examples/inventory_item_role.py +++ b/docs/examples/inventory_item_role.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, InventoryItemRole, + Owner, + OwnerGroup, Tag, ) @@ -58,9 +60,10 @@ def inventory_item_role_extended() -> InventoryItemRole: return InventoryItemRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + color="0000ff", + comments="Example comments", ) @@ -69,10 +72,19 @@ def inventory_item_role_explicit() -> InventoryItemRole: return InventoryItemRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + color="0000ff", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/ip_address.py b/docs/examples/ip_address.py index d085f8a..7b61aba 100644 --- a/docs/examples/ip_address.py +++ b/docs/examples/ip_address.py @@ -11,8 +11,11 @@ from netboxlabs.diode.sdk.ingester import ( Entity, IPAddress, + Owner, + OwnerGroup, Tag, Tenant, + VRF, ) TARGET = "grpc://localhost:8080/diode" @@ -55,9 +58,13 @@ def ip_address_extended() -> IPAddress: """Create a IPAddress with common optional fields.""" return IPAddress( address="192.0.2.1/32", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", description="Example description", + tenant="Example Tenant", + role="anycast", + dns_name="Example Dns Name", + comments="Example comments", ) @@ -65,13 +72,28 @@ def ip_address_explicit() -> IPAddress: """Create a IPAddress with fully nested objects and all common fields.""" return IPAddress( address="192.0.2.1/32", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", description="Example description", comments="Example comments", + role="anycast", + dns_name="Example Dns Name", + vrf=VRF(name="Example Name", metadata={"source": "example"}), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + nat_inside=IPAddress( + address="192.0.2.1/32", status="active", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/ip_range.py b/docs/examples/ip_range.py index 8abbf40..616a0da 100644 --- a/docs/examples/ip_range.py +++ b/docs/examples/ip_range.py @@ -11,8 +11,12 @@ from netboxlabs.diode.sdk.ingester import ( Entity, IPRange, + Owner, + OwnerGroup, + Role, Tag, Tenant, + VRF, ) TARGET = "grpc://localhost:8080/diode" @@ -57,9 +61,14 @@ def ip_range_extended() -> IPRange: return IPRange( start_address="Example Start Address", end_address="Example End Address", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", description="Example description", + tenant="Example Tenant", + role="Example Role", + comments="Example comments", + mark_utilized=True, + mark_populated=True, ) @@ -68,13 +77,28 @@ def ip_range_explicit() -> IPRange: return IPRange( start_address="Example Start Address", end_address="Example End Address", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", description="Example description", comments="Example comments", + mark_utilized=True, + mark_populated=True, + vrf=VRF(name="Example Name", metadata={"source": "example"}), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + role=Role( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/ip_sec_policy.py b/docs/examples/ip_sec_policy.py index 9240318..efed61b 100644 --- a/docs/examples/ip_sec_policy.py +++ b/docs/examples/ip_sec_policy.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, IPSecPolicy, + Owner, + OwnerGroup, Tag, ) @@ -54,8 +56,10 @@ def ip_sec_policy_extended() -> IPSecPolicy: """Create a IPSecPolicy with common optional fields.""" return IPSecPolicy( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + pfs_group=1, + comments="Example comments", ) @@ -63,9 +67,19 @@ def ip_sec_policy_explicit() -> IPSecPolicy: """Create a IPSecPolicy with fully nested objects and all common fields.""" return IPSecPolicy( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + pfs_group=1, + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/ip_sec_profile.py b/docs/examples/ip_sec_profile.py index 0db78b4..9a2230c 100644 --- a/docs/examples/ip_sec_profile.py +++ b/docs/examples/ip_sec_profile.py @@ -13,6 +13,8 @@ IKEPolicy, IPSecPolicy, IPSecProfile, + Owner, + OwnerGroup, Tag, ) @@ -62,8 +64,9 @@ def ip_sec_profile_extended() -> IPSecProfile: mode="ah", ike_policy="Example Ike Policy", ipsec_policy="Example Ipsec Policy", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -76,9 +79,18 @@ def ip_sec_profile_explicit() -> IPSecProfile: name="Example Name", version=1, metadata={"source": "example"} ), ipsec_policy=IPSecPolicy(name="Example Name", metadata={"source": "example"}), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/ip_sec_proposal.py b/docs/examples/ip_sec_proposal.py index 5e722f6..0e77389 100644 --- a/docs/examples/ip_sec_proposal.py +++ b/docs/examples/ip_sec_proposal.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, IPSecProposal, + Owner, + OwnerGroup, Tag, ) @@ -54,8 +56,13 @@ def ip_sec_proposal_extended() -> IPSecProposal: """Create a IPSecProposal with common optional fields.""" return IPSecProposal( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + encryption_algorithm="3des-cbc", + authentication_algorithm="hmac-md5", + sa_lifetime_seconds=1, + sa_lifetime_data=1, + comments="Example comments", ) @@ -63,9 +70,22 @@ def ip_sec_proposal_explicit() -> IPSecProposal: """Create a IPSecProposal with fully nested objects and all common fields.""" return IPSecProposal( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + encryption_algorithm="3des-cbc", + authentication_algorithm="hmac-md5", + sa_lifetime_seconds=1, + sa_lifetime_data=1, + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/journal_entry.py b/docs/examples/journal_entry.py index 770ff5b..31c7519 100644 --- a/docs/examples/journal_entry.py +++ b/docs/examples/journal_entry.py @@ -54,7 +54,8 @@ def journal_entry_extended() -> JournalEntry: """Create a JournalEntry with common optional fields.""" return JournalEntry( comments="Example comments", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, + kind="danger", ) @@ -62,7 +63,12 @@ def journal_entry_explicit() -> JournalEntry: """Create a JournalEntry with fully nested objects and all common fields.""" return JournalEntry( comments="Example comments", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, + kind="danger", tags=[Tag(name="production")], ) diff --git a/docs/examples/l2vpn.py b/docs/examples/l2vpn.py index a33c460..e415971 100644 --- a/docs/examples/l2vpn.py +++ b/docs/examples/l2vpn.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, L2VPN, + Owner, + OwnerGroup, Tag, Tenant, ) @@ -57,9 +59,13 @@ def l2vpn_extended() -> L2VPN: return L2VPN( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - description="Example description", + metadata={"source": "example", "custom_key": "custom_value"}, status="active", + description="Example description", + identifier=1, + type="ep-lan", + comments="Example comments", + tenant="Example Tenant", ) @@ -68,13 +74,24 @@ def l2vpn_explicit() -> L2VPN: return L2VPN( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, + status="active", description="Example description", comments="Example comments", - status="active", + identifier=1, + type="ep-lan", tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/l2vpn_termination.py b/docs/examples/l2vpn_termination.py index 2eb22e6..9f6d5dd 100644 --- a/docs/examples/l2vpn_termination.py +++ b/docs/examples/l2vpn_termination.py @@ -55,7 +55,7 @@ def l2vpn_termination_extended() -> L2VPNTermination: """Create a L2VPNTermination with common optional fields.""" return L2VPNTermination( l2vpn="Example L2Vpn", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, ) @@ -68,7 +68,11 @@ def l2vpn_termination_explicit() -> L2VPNTermination: status="active", metadata={"source": "example"}, ), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, tags=[Tag(name="production")], ) diff --git a/docs/examples/location.py b/docs/examples/location.py index 9ec90e2..fce2585 100644 --- a/docs/examples/location.py +++ b/docs/examples/location.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, Location, + Owner, + OwnerGroup, Site, Tag, Tenant, @@ -60,9 +62,12 @@ def location_extended() -> Location: name="Example Name", slug="example-slug", site="Example Site", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", description="Example description", + tenant="Example Tenant", + facility="Example Facility", + comments="Example comments", ) @@ -77,13 +82,35 @@ def location_explicit() -> Location: status="active", metadata={"source": "example"}, ), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", description="Example description", comments="Example comments", + facility="Example Facility", + parent=Location( + name="Example Name", + slug="example-slug", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/mac_address.py b/docs/examples/mac_address.py index 992fcc9..ea08a07 100644 --- a/docs/examples/mac_address.py +++ b/docs/examples/mac_address.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, MACAddress, + Owner, + OwnerGroup, Tag, ) @@ -54,8 +56,9 @@ def mac_address_extended() -> MACAddress: """Create a MACAddress with common optional fields.""" return MACAddress( mac_address="00:11:22:33:44:55", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -63,9 +66,18 @@ def mac_address_explicit() -> MACAddress: """Create a MACAddress with fully nested objects and all common fields.""" return MACAddress( mac_address="00:11:22:33:44:55", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/manufacturer.py b/docs/examples/manufacturer.py index 3195d15..084f34c 100644 --- a/docs/examples/manufacturer.py +++ b/docs/examples/manufacturer.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, Manufacturer, + Owner, + OwnerGroup, Tag, ) @@ -56,8 +58,9 @@ def manufacturer_extended() -> Manufacturer: return Manufacturer( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -66,9 +69,18 @@ def manufacturer_explicit() -> Manufacturer: return Manufacturer( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/module.py b/docs/examples/module.py index 51095e3..991b13e 100644 --- a/docs/examples/module.py +++ b/docs/examples/module.py @@ -17,6 +17,8 @@ Module, ModuleBay, ModuleType, + Owner, + OwnerGroup, Site, Tag, ) @@ -65,10 +67,12 @@ def module_extended() -> Module: device="Example Device", module_bay="Example Module Bay", module_type="Example Module Type", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", serial="SN-001234", description="Example description", + asset_tag="ASSET-001", + comments="Example comments", ) @@ -138,12 +142,21 @@ def module_explicit() -> Module: model="Model X", metadata={"source": "example"}, ), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", serial="SN-001234", - asset_tag="ASSET-001", description="Example description", comments="Example comments", + asset_tag="ASSET-001", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/module_bay.py b/docs/examples/module_bay.py index bcbcfba..a16b3de 100644 --- a/docs/examples/module_bay.py +++ b/docs/examples/module_bay.py @@ -14,7 +14,11 @@ DeviceType, Entity, Manufacturer, + Module, ModuleBay, + ModuleType, + Owner, + OwnerGroup, Site, Tag, ) @@ -61,8 +65,10 @@ def module_bay_extended() -> ModuleBay: return ModuleBay( device="Example Device", name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + label="Example Label", + position="Example Position", ) @@ -96,8 +102,157 @@ def module_bay_explicit() -> ModuleBay: metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + label="Example Label", + position="Example Position", + module=Module( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + module_bay=ModuleBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + module_type=ModuleType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + installed_module=Module( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + module_bay=ModuleBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + module_type=ModuleType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/module_type.py b/docs/examples/module_type.py index 41f71ef..285b312 100644 --- a/docs/examples/module_type.py +++ b/docs/examples/module_type.py @@ -12,6 +12,9 @@ Entity, Manufacturer, ModuleType, + ModuleTypeProfile, + Owner, + OwnerGroup, Tag, ) @@ -57,8 +60,14 @@ def module_type_extended() -> ModuleType: return ModuleType( manufacturer="Example Manufacturer", model="Model X", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + part_number="Example Part Number", + airflow="front-to-rear", + weight=1.0, + weight_unit="g", + comments="Example comments", + attributes="Example Attributes", ) @@ -69,9 +78,24 @@ def module_type_explicit() -> ModuleType: name="Example Name", slug="example-slug", metadata={"source": "example"} ), model="Model X", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + part_number="Example Part Number", + airflow="front-to-rear", + weight=1.0, + weight_unit="g", + attributes="Example Attributes", + profile=ModuleTypeProfile(name="Example Name", metadata={"source": "example"}), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/module_type_profile.py b/docs/examples/module_type_profile.py index 37e2fe1..1569bd2 100644 --- a/docs/examples/module_type_profile.py +++ b/docs/examples/module_type_profile.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, ModuleTypeProfile, + Owner, + OwnerGroup, Tag, ) @@ -56,8 +58,10 @@ def module_type_profile_extended() -> ModuleTypeProfile: """Create a ModuleTypeProfile with common optional fields.""" return ModuleTypeProfile( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + schema="Example Schema", + comments="Example comments", ) @@ -65,9 +69,19 @@ def module_type_profile_explicit() -> ModuleTypeProfile: """Create a ModuleTypeProfile with fully nested objects and all common fields.""" return ModuleTypeProfile( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + schema="Example Schema", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/owner.py b/docs/examples/owner.py index 42a9753..ab8fadc 100644 --- a/docs/examples/owner.py +++ b/docs/examples/owner.py @@ -56,7 +56,7 @@ def owner_extended() -> Owner: return Owner( name="Example Name", group="Example Group", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", ) @@ -66,7 +66,11 @@ def owner_explicit() -> Owner: return Owner( name="Example Name", group=OwnerGroup(name="Example Name", metadata={"source": "example"}), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", ) diff --git a/docs/examples/owner_group.py b/docs/examples/owner_group.py index 4484758..35b5832 100644 --- a/docs/examples/owner_group.py +++ b/docs/examples/owner_group.py @@ -49,7 +49,7 @@ def owner_group_extended() -> OwnerGroup: """Create a OwnerGroup with common optional fields.""" return OwnerGroup( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", ) @@ -58,7 +58,11 @@ def owner_group_explicit() -> OwnerGroup: """Create a OwnerGroup with fully nested objects and all common fields.""" return OwnerGroup( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", ) diff --git a/docs/examples/platform.py b/docs/examples/platform.py index 7615f01..f3975ab 100644 --- a/docs/examples/platform.py +++ b/docs/examples/platform.py @@ -10,6 +10,9 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Manufacturer, + Owner, + OwnerGroup, Platform, Tag, ) @@ -56,8 +59,10 @@ def platform_extended() -> Platform: return Platform( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + manufacturer="Example Manufacturer", + comments="Example comments", ) @@ -66,9 +71,24 @@ def platform_explicit() -> Platform: return Platform( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + manufacturer=Manufacturer( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + parent=Platform( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/power_feed.py b/docs/examples/power_feed.py index 586624a..23f2b0e 100644 --- a/docs/examples/power_feed.py +++ b/docs/examples/power_feed.py @@ -10,8 +10,11 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, PowerFeed, PowerPanel, + Rack, Site, Tag, Tenant, @@ -59,9 +62,19 @@ def power_feed_extended() -> PowerFeed: return PowerFeed( power_panel="Example Power Panel", name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", description="Example description", + rack="Example Rack", + type="primary", + supply="ac", + phase="single-phase", + voltage=1, + amperage=1, + max_utilization=1, + mark_connected=True, + tenant="Example Tenant", + comments="Example comments", ) @@ -79,13 +92,40 @@ def power_feed_explicit() -> PowerFeed: metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", description="Example description", comments="Example comments", + type="primary", + supply="ac", + phase="single-phase", + voltage=1, + amperage=1, + max_utilization=1, + mark_connected=True, + rack=Rack( + name="Example Name", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/power_outlet.py b/docs/examples/power_outlet.py index 125fd21..a5aad5c 100644 --- a/docs/examples/power_outlet.py +++ b/docs/examples/power_outlet.py @@ -14,7 +14,13 @@ DeviceType, Entity, Manufacturer, + Module, + ModuleBay, + ModuleType, + Owner, + OwnerGroup, PowerOutlet, + PowerPort, Site, Tag, ) @@ -61,10 +67,14 @@ def power_outlet_extended() -> PowerOutlet: return PowerOutlet( device="Example Device", name="Example Name", - metadata={"source": "example"}, - color="0000ff", - description="Example description", + metadata={"source": "example", "custom_key": "custom_value"}, status="disabled", + description="Example description", + color="0000ff", + label="Example Label", + type="CS6360C", + feed_leg="A", + mark_connected=True, ) @@ -98,10 +108,122 @@ def power_outlet_explicit() -> PowerOutlet: metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, - color="0000ff", - description="Example description", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="disabled", + description="Example description", + color="0000ff", + label="Example Label", + type="CS6360C", + feed_leg="A", + mark_connected=True, + module=Module( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + module_bay=ModuleBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + module_type=ModuleType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + power_port=PowerPort( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/power_panel.py b/docs/examples/power_panel.py index c83a8ae..25316e0 100644 --- a/docs/examples/power_panel.py +++ b/docs/examples/power_panel.py @@ -10,6 +10,9 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Location, + Owner, + OwnerGroup, PowerPanel, Site, Tag, @@ -57,8 +60,10 @@ def power_panel_extended() -> PowerPanel: return PowerPanel( site="Example Site", name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + location="Example Location", + comments="Example comments", ) @@ -72,9 +77,30 @@ def power_panel_explicit() -> PowerPanel: metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + location=Location( + name="Example Name", + slug="example-slug", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/power_port.py b/docs/examples/power_port.py index 6dcf618..b19bee3 100644 --- a/docs/examples/power_port.py +++ b/docs/examples/power_port.py @@ -14,6 +14,11 @@ DeviceType, Entity, Manufacturer, + Module, + ModuleBay, + ModuleType, + Owner, + OwnerGroup, PowerPort, Site, Tag, @@ -61,8 +66,13 @@ def power_port_extended() -> PowerPort: return PowerPort( device="Example Device", name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + label="Example Label", + type="cs6361c", + maximum_draw=1, + allocated_draw=1, + mark_connected=True, ) @@ -96,8 +106,91 @@ def power_port_explicit() -> PowerPort: metadata={"source": "example"}, ), name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + label="Example Label", + type="cs6361c", + maximum_draw=1, + allocated_draw=1, + mark_connected=True, + module=Module( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + module_bay=ModuleBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + module_type=ModuleType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/prefix.py b/docs/examples/prefix.py index b3bd3ac..0898a58 100644 --- a/docs/examples/prefix.py +++ b/docs/examples/prefix.py @@ -10,9 +10,14 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Prefix, + Role, Tag, Tenant, + VLAN, + VRF, ) TARGET = "grpc://localhost:8080/diode" @@ -55,9 +60,14 @@ def prefix_extended() -> Prefix: """Create a Prefix with common optional fields.""" return Prefix( prefix="192.0.2.0/24", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", description="Example description", + tenant="Example Tenant", + role="Example Role", + is_pool=True, + mark_utilized=True, + comments="Example comments", ) @@ -65,13 +75,31 @@ def prefix_explicit() -> Prefix: """Create a Prefix with fully nested objects and all common fields.""" return Prefix( prefix="192.0.2.0/24", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", description="Example description", comments="Example comments", + is_pool=True, + mark_utilized=True, + vrf=VRF(name="Example Name", metadata={"source": "example"}), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + vlan=VLAN( + vid=1, name="Example Name", status="active", metadata={"source": "example"} + ), + role=Role( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/provider.py b/docs/examples/provider.py index 22ece7c..58e792a 100644 --- a/docs/examples/provider.py +++ b/docs/examples/provider.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Provider, Tag, ) @@ -56,8 +58,9 @@ def provider_extended() -> Provider: return Provider( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -66,9 +69,18 @@ def provider_explicit() -> Provider: return Provider( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/provider_account.py b/docs/examples/provider_account.py index 021c13e..448ba0b 100644 --- a/docs/examples/provider_account.py +++ b/docs/examples/provider_account.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Provider, ProviderAccount, Tag, @@ -57,8 +59,10 @@ def provider_account_extended() -> ProviderAccount: return ProviderAccount( provider="Example Provider", account="Example Account", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + name="Example Name", + comments="Example comments", ) @@ -69,9 +73,19 @@ def provider_account_explicit() -> ProviderAccount: name="Example Name", slug="example-slug", metadata={"source": "example"} ), account="Example Account", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + name="Example Name", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/provider_network.py b/docs/examples/provider_network.py index 0a411d2..2473218 100644 --- a/docs/examples/provider_network.py +++ b/docs/examples/provider_network.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Provider, ProviderNetwork, Tag, @@ -57,8 +59,10 @@ def provider_network_extended() -> ProviderNetwork: return ProviderNetwork( provider="Example Provider", name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + service_id="Example Service Id", + comments="Example comments", ) @@ -69,9 +73,19 @@ def provider_network_explicit() -> ProviderNetwork: name="Example Name", slug="example-slug", metadata={"source": "example"} ), name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + service_id="Example Service Id", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/rack.py b/docs/examples/rack.py index dbaf88f..3200be5 100644 --- a/docs/examples/rack.py +++ b/docs/examples/rack.py @@ -10,7 +10,13 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Location, + Manufacturer, + Owner, + OwnerGroup, Rack, + RackRole, + RackType, Site, Tag, Tenant, @@ -58,10 +64,30 @@ def rack_extended() -> Rack: return Rack( name="Example Name", site="Example Site", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", serial="SN-001234", description="Example description", + facility_id="Example Facility Id", + location="Example Location", + tenant="Example Tenant", + role="Example Role", + asset_tag="ASSET-001", + form_factor="2-post-frame", + width=1, + u_height=1, + starting_unit=1, + weight=1.0, + max_weight=1, + weight_unit="g", + desc_units=True, + outer_width=1, + outer_depth=1, + outer_unit="in", + mounting_depth=1, + airflow="front-to-rear", + comments="Example comments", + outer_height=1, ) @@ -75,15 +101,65 @@ def rack_explicit() -> Rack: status="active", metadata={"source": "example"}, ), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", serial="SN-001234", - asset_tag="ASSET-001", description="Example description", comments="Example comments", + asset_tag="ASSET-001", + facility_id="Example Facility Id", + form_factor="2-post-frame", + width=1, + u_height=1, + starting_unit=1, + weight=1.0, + max_weight=1, + weight_unit="g", + desc_units=True, + outer_width=1, + outer_depth=1, + outer_unit="in", + mounting_depth=1, + airflow="front-to-rear", + outer_height=1, + location=Location( + name="Example Name", + slug="example-slug", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + role=RackRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + rack_type=RackType( + manufacturer=Manufacturer( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/rack_reservation.py b/docs/examples/rack_reservation.py index fa01a72..5ecedc9 100644 --- a/docs/examples/rack_reservation.py +++ b/docs/examples/rack_reservation.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Rack, RackReservation, Site, @@ -59,8 +61,10 @@ def rack_reservation_extended() -> RackReservation: return RackReservation( rack="Example Rack", description="Example description", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", + tenant="Example Tenant", + comments="Example comments", ) @@ -79,12 +83,21 @@ def rack_reservation_explicit() -> RackReservation: metadata={"source": "example"}, ), description="Example description", - metadata={"source": "example"}, - comments="Example comments", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", + comments="Example comments", tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/rack_role.py b/docs/examples/rack_role.py index de333da..c926d02 100644 --- a/docs/examples/rack_role.py +++ b/docs/examples/rack_role.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, RackRole, Tag, ) @@ -56,9 +58,10 @@ def rack_role_extended() -> RackRole: return RackRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + color="0000ff", + comments="Example comments", ) @@ -67,10 +70,19 @@ def rack_role_explicit() -> RackRole: return RackRole( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + color="0000ff", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/rack_type.py b/docs/examples/rack_type.py index a45fc87..ee4f3f4 100644 --- a/docs/examples/rack_type.py +++ b/docs/examples/rack_type.py @@ -11,6 +11,8 @@ from netboxlabs.diode.sdk.ingester import ( Entity, Manufacturer, + Owner, + OwnerGroup, RackType, Tag, ) @@ -59,8 +61,22 @@ def rack_type_extended() -> RackType: manufacturer="Example Manufacturer", model="Model X", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + form_factor="2-post-frame", + width=1, + u_height=1, + starting_unit=1, + desc_units=True, + outer_width=1, + outer_depth=1, + outer_unit="in", + weight=1.0, + max_weight=1, + weight_unit="g", + mounting_depth=1, + comments="Example comments", + outer_height=1, ) @@ -72,9 +88,31 @@ def rack_type_explicit() -> RackType: ), model="Model X", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + form_factor="2-post-frame", + width=1, + u_height=1, + starting_unit=1, + desc_units=True, + outer_width=1, + outer_depth=1, + outer_unit="in", + weight=1.0, + max_weight=1, + weight_unit="g", + mounting_depth=1, + outer_height=1, + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/rear_port.py b/docs/examples/rear_port.py index 3060611..30785b9 100644 --- a/docs/examples/rear_port.py +++ b/docs/examples/rear_port.py @@ -14,6 +14,11 @@ DeviceType, Entity, Manufacturer, + Module, + ModuleBay, + ModuleType, + Owner, + OwnerGroup, RearPort, Site, Tag, @@ -63,9 +68,12 @@ def rear_port_extended() -> RearPort: device="Example Device", name="Example Name", type="110-punch", - metadata={"source": "example"}, - color="0000ff", + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + color="0000ff", + label="Example Label", + positions=1, + mark_connected=True, ) @@ -100,9 +108,90 @@ def rear_port_explicit() -> RearPort: ), name="Example Name", type="110-punch", - metadata={"source": "example"}, - color="0000ff", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + color="0000ff", + label="Example Label", + positions=1, + mark_connected=True, + module=Module( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + module_bay=ModuleBay( + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + name="Example Name", + metadata={"source": "example"}, + ), + module_type=ModuleType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/region.py b/docs/examples/region.py index d38de88..4a22cee 100644 --- a/docs/examples/region.py +++ b/docs/examples/region.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Region, Tag, ) @@ -56,8 +58,9 @@ def region_extended() -> Region: return Region( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -66,9 +69,21 @@ def region_explicit() -> Region: return Region( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + parent=Region( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/rir.py b/docs/examples/rir.py index 0a8e44f..3f4e91a 100644 --- a/docs/examples/rir.py +++ b/docs/examples/rir.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, RIR, Tag, ) @@ -56,8 +58,10 @@ def rir_extended() -> RIR: return RIR( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + is_private=True, + comments="Example comments", ) @@ -66,9 +70,19 @@ def rir_explicit() -> RIR: return RIR( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + is_private=True, + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/role.py b/docs/examples/role.py index 2a5ee6e..d53db0b 100644 --- a/docs/examples/role.py +++ b/docs/examples/role.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Role, Tag, ) @@ -56,8 +58,10 @@ def role_extended() -> Role: return Role( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + weight=1, + comments="Example comments", ) @@ -66,9 +70,19 @@ def role_explicit() -> Role: return Role( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + weight=1, + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/route_target.py b/docs/examples/route_target.py index 3a75ffb..3935be3 100644 --- a/docs/examples/route_target.py +++ b/docs/examples/route_target.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, RouteTarget, Tag, Tenant, @@ -55,8 +57,10 @@ def route_target_extended() -> RouteTarget: """Create a RouteTarget with common optional fields.""" return RouteTarget( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + tenant="Example Tenant", + comments="Example comments", ) @@ -64,12 +68,21 @@ def route_target_explicit() -> RouteTarget: """Create a RouteTarget with fully nested objects and all common fields.""" return RouteTarget( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/service.py b/docs/examples/service.py index e29bfe9..2b00f73 100644 --- a/docs/examples/service.py +++ b/docs/examples/service.py @@ -9,9 +9,17 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, Entity, + Manufacturer, + Owner, + OwnerGroup, Service, + Site, Tag, + VirtualMachine, ) TARGET = "grpc://localhost:8080/diode" @@ -54,8 +62,11 @@ def service_extended() -> Service: """Create a Service with common optional fields.""" return Service( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + device="Example Device", + protocol="sctp", + comments="Example comments", ) @@ -63,9 +74,48 @@ def service_explicit() -> Service: """Create a Service with fully nested objects and all common fields.""" return Service( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + protocol="sctp", + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + virtual_machine=VirtualMachine( + name="Example Name", status="active", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/site.py b/docs/examples/site.py index c4cd529..8a1d7f4 100644 --- a/docs/examples/site.py +++ b/docs/examples/site.py @@ -10,7 +10,11 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, + Region, Site, + SiteGroup, Tag, Tenant, ) @@ -57,9 +61,18 @@ def site_extended() -> Site: return Site( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", description="Example description", + region="Example Region", + tenant="Example Tenant", + facility="Example Facility", + time_zone="Example Time Zone", + physical_address="Example Physical Address", + shipping_address="Example Shipping Address", + latitude=1.0, + longitude=1.0, + comments="Example comments", ) @@ -68,13 +81,34 @@ def site_explicit() -> Site: return Site( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", description="Example description", comments="Example comments", + facility="Example Facility", + time_zone="Example Time Zone", + physical_address="Example Physical Address", + shipping_address="Example Shipping Address", + latitude=1.0, + longitude=1.0, + region=Region( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + group=SiteGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/site_group.py b/docs/examples/site_group.py index 00eba4e..6b61284 100644 --- a/docs/examples/site_group.py +++ b/docs/examples/site_group.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, SiteGroup, Tag, ) @@ -56,8 +58,9 @@ def site_group_extended() -> SiteGroup: return SiteGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -66,9 +69,21 @@ def site_group_explicit() -> SiteGroup: return SiteGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + parent=SiteGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/tag.py b/docs/examples/tag.py index 573a575..4b36404 100644 --- a/docs/examples/tag.py +++ b/docs/examples/tag.py @@ -51,9 +51,10 @@ def tag_extended() -> Tag: return Tag( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + color="0000ff", + weight=1, ) @@ -62,9 +63,14 @@ def tag_explicit() -> Tag: return Tag( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + color="0000ff", + weight=1, ) diff --git a/docs/examples/tenant.py b/docs/examples/tenant.py index 5164cd3..b23e6c6 100644 --- a/docs/examples/tenant.py +++ b/docs/examples/tenant.py @@ -10,8 +10,11 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Tag, Tenant, + TenantGroup, ) TARGET = "grpc://localhost:8080/diode" @@ -56,8 +59,9 @@ def tenant_extended() -> Tenant: return Tenant( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -66,9 +70,21 @@ def tenant_explicit() -> Tenant: return Tenant( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + group=TenantGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/tenant_group.py b/docs/examples/tenant_group.py index d00eb1f..07d9bd9 100644 --- a/docs/examples/tenant_group.py +++ b/docs/examples/tenant_group.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Tag, TenantGroup, ) @@ -56,8 +58,9 @@ def tenant_group_extended() -> TenantGroup: return TenantGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -66,9 +69,21 @@ def tenant_group_explicit() -> TenantGroup: return TenantGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + parent=TenantGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/tunnel.py b/docs/examples/tunnel.py index 31cb4c2..44a9512 100644 --- a/docs/examples/tunnel.py +++ b/docs/examples/tunnel.py @@ -10,9 +10,15 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + IKEPolicy, + IPSecPolicy, + IPSecProfile, + Owner, + OwnerGroup, Tag, Tenant, Tunnel, + TunnelGroup, ) TARGET = "grpc://localhost:8080/diode" @@ -59,8 +65,11 @@ def tunnel_extended() -> Tunnel: name="Example Name", status="active", encapsulation="gre", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + tenant="Example Tenant", + tunnel_id=1, + comments="Example comments", ) @@ -70,12 +79,36 @@ def tunnel_explicit() -> Tunnel: name="Example Name", status="active", encapsulation="gre", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + tunnel_id=1, + group=TunnelGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + ipsec_profile=IPSecProfile( + name="Example Name", + mode="Example Mode", + ike_policy=IKEPolicy( + name="Example Name", version=1, metadata={"source": "example"} + ), + ipsec_policy=IPSecPolicy( + name="Example Name", metadata={"source": "example"} + ), + metadata={"source": "example"}, + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/tunnel_group.py b/docs/examples/tunnel_group.py index a1018c6..a2cf2ee 100644 --- a/docs/examples/tunnel_group.py +++ b/docs/examples/tunnel_group.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Tag, TunnelGroup, ) @@ -56,8 +58,9 @@ def tunnel_group_extended() -> TunnelGroup: return TunnelGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -66,9 +69,18 @@ def tunnel_group_explicit() -> TunnelGroup: return TunnelGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/tunnel_termination.py b/docs/examples/tunnel_termination.py index 07c64e3..e34ade2 100644 --- a/docs/examples/tunnel_termination.py +++ b/docs/examples/tunnel_termination.py @@ -10,6 +10,7 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + IPAddress, Tag, Tunnel, TunnelTermination, @@ -59,7 +60,7 @@ def tunnel_termination_extended() -> TunnelTermination: return TunnelTermination( tunnel="Example Tunnel", role="hub", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, ) @@ -73,7 +74,14 @@ def tunnel_termination_explicit() -> TunnelTermination: metadata={"source": "example"}, ), role="hub", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, + outside_ip=IPAddress( + address="192.0.2.1/32", status="active", metadata={"source": "example"} + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/virtual_chassis.py b/docs/examples/virtual_chassis.py index e3c09de..32de876 100644 --- a/docs/examples/virtual_chassis.py +++ b/docs/examples/virtual_chassis.py @@ -9,7 +9,14 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Device, + DeviceRole, + DeviceType, Entity, + Manufacturer, + Owner, + OwnerGroup, + Site, Tag, VirtualChassis, ) @@ -54,8 +61,10 @@ def virtual_chassis_extended() -> VirtualChassis: """Create a VirtualChassis with common optional fields.""" return VirtualChassis( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + domain="Example Domain", + comments="Example comments", ) @@ -63,9 +72,45 @@ def virtual_chassis_explicit() -> VirtualChassis: """Create a VirtualChassis with fully nested objects and all common fields.""" return VirtualChassis( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + domain="Example Domain", + master=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/virtual_circuit.py b/docs/examples/virtual_circuit.py index b7fa678..55c2286 100644 --- a/docs/examples/virtual_circuit.py +++ b/docs/examples/virtual_circuit.py @@ -10,7 +10,10 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Provider, + ProviderAccount, ProviderNetwork, Tag, Tenant, @@ -62,9 +65,11 @@ def virtual_circuit_extended() -> VirtualCircuit: cid="CID-001", provider_network="Example Provider Network", type="Example Type", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", description="Example description", + tenant="Example Tenant", + comments="Example comments", ) @@ -85,13 +90,29 @@ def virtual_circuit_explicit() -> VirtualCircuit: color="0000ff", metadata={"source": "example"}, ), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", description="Example description", comments="Example comments", + provider_account=ProviderAccount( + provider=Provider( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + account="Example Account", + metadata={"source": "example"}, + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/virtual_circuit_termination.py b/docs/examples/virtual_circuit_termination.py index e4ac270..907794b 100644 --- a/docs/examples/virtual_circuit_termination.py +++ b/docs/examples/virtual_circuit_termination.py @@ -68,8 +68,9 @@ def virtual_circuit_termination_extended() -> VirtualCircuitTermination: return VirtualCircuitTermination( virtual_circuit="Example Virtual Circuit", interface="Example Interface", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + role="hub", ) @@ -127,8 +128,13 @@ def virtual_circuit_termination_explicit() -> VirtualCircuitTermination: type="Example Type", metadata={"source": "example"}, ), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + role="hub", tags=[Tag(name="production")], ) diff --git a/docs/examples/virtual_circuit_type.py b/docs/examples/virtual_circuit_type.py index e5495b2..3472a99 100644 --- a/docs/examples/virtual_circuit_type.py +++ b/docs/examples/virtual_circuit_type.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Tag, VirtualCircuitType, ) @@ -58,9 +60,10 @@ def virtual_circuit_type_extended() -> VirtualCircuitType: return VirtualCircuitType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + color="0000ff", + comments="Example comments", ) @@ -69,10 +72,19 @@ def virtual_circuit_type_explicit() -> VirtualCircuitType: return VirtualCircuitType( name="Example Name", slug="example-slug", - metadata={"source": "example"}, - color="0000ff", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + color="0000ff", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/virtual_device_context.py b/docs/examples/virtual_device_context.py index 3b82671..de8e4e4 100644 --- a/docs/examples/virtual_device_context.py +++ b/docs/examples/virtual_device_context.py @@ -13,7 +13,10 @@ DeviceRole, DeviceType, Entity, + IPAddress, Manufacturer, + Owner, + OwnerGroup, Site, Tag, Tenant, @@ -66,8 +69,11 @@ def virtual_device_context_extended() -> VirtualDeviceContext: name="Example Name", device="Example Device", status="active", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + identifier=1, + tenant="Example Tenant", + comments="Example comments", ) @@ -102,12 +108,28 @@ def virtual_device_context_explicit() -> VirtualDeviceContext: metadata={"source": "example"}, ), status="active", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + identifier=1, tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + primary_ip4=IPAddress( + address="192.0.2.1/32", status="active", metadata={"source": "example"} + ), + primary_ip6=IPAddress( + address="192.0.2.1/32", status="active", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/virtual_disk.py b/docs/examples/virtual_disk.py index 525bc61..a0feca2 100644 --- a/docs/examples/virtual_disk.py +++ b/docs/examples/virtual_disk.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Tag, VirtualDisk, VirtualMachine, @@ -59,7 +61,7 @@ def virtual_disk_extended() -> VirtualDisk: virtual_machine="Example Virtual Machine", name="Example Name", size=1, - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", ) @@ -72,8 +74,17 @@ def virtual_disk_explicit() -> VirtualDisk: ), name="Example Name", size=1, - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/virtual_machine.py b/docs/examples/virtual_machine.py index e542549..77b2d4e 100644 --- a/docs/examples/virtual_machine.py +++ b/docs/examples/virtual_machine.py @@ -9,8 +9,18 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( + Cluster, + ClusterType, + Device, + DeviceRole, + DeviceType, Entity, + IPAddress, + Manufacturer, + Owner, + OwnerGroup, Platform, + Site, Tag, Tenant, VirtualMachine, @@ -56,10 +66,21 @@ def virtual_machine_extended() -> VirtualMachine: """Create a VirtualMachine with common optional fields.""" return VirtualMachine( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", serial="SN-001234", description="Example description", + site="Example Site", + cluster="Example Cluster", + device="Example Device", + role="Example Role", + tenant="Example Tenant", + platform="Example Platform", + vcpus=1.0, + memory=1, + disk=1, + comments="Example comments", + start_on_boot="laststate", ) @@ -67,17 +88,82 @@ def virtual_machine_explicit() -> VirtualMachine: """Create a VirtualMachine with fully nested objects and all common fields.""" return VirtualMachine( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", serial="SN-001234", description="Example description", comments="Example comments", + vcpus=1.0, + memory=1, + disk=1, + start_on_boot="laststate", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + cluster=Cluster( + name="Example Name", + type=ClusterType( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + status="active", + metadata={"source": "example"}, + ), + device=Device( + device_type=DeviceType( + manufacturer=Manufacturer( + name="Example Name", + slug="example-slug", + metadata={"source": "example"}, + ), + model="Model X", + slug="example-slug", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + status="active", + metadata={"source": "example"}, + ), + role=DeviceRole( + name="Example Name", + slug="example-slug", + color="0000ff", + metadata={"source": "example"}, + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), platform=Platform( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + primary_ip4=IPAddress( + address="192.0.2.1/32", status="active", metadata={"source": "example"} + ), + primary_ip6=IPAddress( + address="192.0.2.1/32", status="active", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/vlan.py b/docs/examples/vlan.py index dca0942..6e05974 100644 --- a/docs/examples/vlan.py +++ b/docs/examples/vlan.py @@ -10,9 +10,14 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, + Role, + Site, Tag, Tenant, VLAN, + VLANGroup, ) TARGET = "grpc://localhost:8080/diode" @@ -57,9 +62,14 @@ def vlan_extended() -> VLAN: return VLAN( vid=1, name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="active", description="Example description", + site="Example Site", + tenant="Example Tenant", + role="Example Role", + qinq_role="cvlan", + comments="Example comments", ) @@ -68,13 +78,38 @@ def vlan_explicit() -> VLAN: return VLAN( vid=1, name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", description="Example description", comments="Example comments", + qinq_role="cvlan", + site=Site( + name="Example Name", + slug="example-slug", + status="active", + metadata={"source": "example"}, + ), + group=VLANGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + role=Role( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + qinq_svlan=VLAN( + vid=1, name="Example Name", status="active", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/vlan_group.py b/docs/examples/vlan_group.py index 29b681a..2c75c61 100644 --- a/docs/examples/vlan_group.py +++ b/docs/examples/vlan_group.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Tag, Tenant, VLANGroup, @@ -57,8 +59,10 @@ def vlan_group_extended() -> VLANGroup: return VLANGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + tenant="Example Tenant", + comments="Example comments", ) @@ -67,12 +71,21 @@ def vlan_group_explicit() -> VLANGroup: return VLANGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/vlan_translation_policy.py b/docs/examples/vlan_translation_policy.py index 805c88e..1132b85 100644 --- a/docs/examples/vlan_translation_policy.py +++ b/docs/examples/vlan_translation_policy.py @@ -8,6 +8,12 @@ """ from netboxlabs.diode.sdk import DiodeClient +from netboxlabs.diode.sdk.ingester import ( + Entity, + Owner, + OwnerGroup, + VLANTranslationPolicy, +) TARGET = "grpc://localhost:8080/diode" APP_NAME = "vlan_translation_policy-example" @@ -51,8 +57,9 @@ def vlan_translation_policy_extended() -> VLANTranslationPolicy: """Create a VLANTranslationPolicy with common optional fields.""" return VLANTranslationPolicy( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -60,9 +67,18 @@ def vlan_translation_policy_explicit() -> VLANTranslationPolicy: """Create a VLANTranslationPolicy with fully nested objects and all common fields.""" return VLANTranslationPolicy( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), ) diff --git a/docs/examples/vlan_translation_rule.py b/docs/examples/vlan_translation_rule.py index c4a2a8e..cb56ad4 100644 --- a/docs/examples/vlan_translation_rule.py +++ b/docs/examples/vlan_translation_rule.py @@ -60,7 +60,7 @@ def vlan_translation_rule_extended() -> VLANTranslationRule: policy="Example Policy", local_vid=1, remote_vid=1, - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", ) @@ -73,7 +73,11 @@ def vlan_translation_rule_explicit() -> VLANTranslationRule: ), local_vid=1, remote_vid=1, - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", ) diff --git a/docs/examples/vm_interface.py b/docs/examples/vm_interface.py index ab4952a..c24c1a8 100644 --- a/docs/examples/vm_interface.py +++ b/docs/examples/vm_interface.py @@ -10,8 +10,14 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + MACAddress, + Owner, + OwnerGroup, Tag, + VLAN, + VLANTranslationPolicy, VMInterface, + VRF, VirtualMachine, ) @@ -57,8 +63,11 @@ def vm_interface_extended() -> VMInterface: return VMInterface( virtual_machine="Example Virtual Machine", name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + enabled=True, + mtu=1, + mode="access", ) @@ -69,8 +78,47 @@ def vm_interface_explicit() -> VMInterface: name="Example Name", status="active", metadata={"source": "example"} ), name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", + enabled=True, + mtu=1, + mode="access", + parent=VMInterface( + virtual_machine=VirtualMachine( + name="Example Name", status="active", metadata={"source": "example"} + ), + name="Example Name", + metadata={"source": "example"}, + ), + bridge=VMInterface( + virtual_machine=VirtualMachine( + name="Example Name", status="active", metadata={"source": "example"} + ), + name="Example Name", + metadata={"source": "example"}, + ), + primary_mac_address=MACAddress( + mac_address="00:11:22:33:44:55", metadata={"source": "example"} + ), + untagged_vlan=VLAN( + vid=1, name="Example Name", status="active", metadata={"source": "example"} + ), + qinq_svlan=VLAN( + vid=1, name="Example Name", status="active", metadata={"source": "example"} + ), + vlan_translation_policy=VLANTranslationPolicy( + name="Example Name", metadata={"source": "example"} + ), + vrf=VRF(name="Example Name", metadata={"source": "example"}), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/vrf.py b/docs/examples/vrf.py index 08ed95b..80a3270 100644 --- a/docs/examples/vrf.py +++ b/docs/examples/vrf.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Tag, Tenant, VRF, @@ -55,8 +57,12 @@ def vrf_extended() -> VRF: """Create a VRF with common optional fields.""" return VRF( name="Example Name", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + rd="Example Rd", + tenant="Example Tenant", + enforce_unique=True, + comments="Example comments", ) @@ -64,12 +70,23 @@ def vrf_explicit() -> VRF: """Create a VRF with fully nested objects and all common fields.""" return VRF( name="Example Name", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + rd="Example Rd", + enforce_unique=True, tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/wireless_lan.py b/docs/examples/wireless_lan.py index be7bfba..0e21827 100644 --- a/docs/examples/wireless_lan.py +++ b/docs/examples/wireless_lan.py @@ -10,9 +10,13 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Tag, Tenant, + VLAN, WirelessLAN, + WirelessLANGroup, ) TARGET = "grpc://localhost:8080/diode" @@ -55,9 +59,14 @@ def wireless_lan_extended() -> WirelessLAN: """Create a WirelessLAN with common optional fields.""" return WirelessLAN( ssid="ExampleSSID", - metadata={"source": "example"}, - description="Example description", + metadata={"source": "example", "custom_key": "custom_value"}, status="active", + description="Example description", + tenant="Example Tenant", + auth_type="open", + auth_cipher="aes", + auth_psk="Example Auth Psk", + comments="Example comments", ) @@ -65,13 +74,31 @@ def wireless_lan_explicit() -> WirelessLAN: """Create a WirelessLAN with fully nested objects and all common fields.""" return WirelessLAN( ssid="ExampleSSID", - metadata={"source": "example"}, - description="Example description", + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="active", + description="Example description", comments="Example comments", + auth_type="open", + auth_cipher="aes", + auth_psk="Example Auth Psk", + group=WirelessLANGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + vlan=VLAN( + vid=1, name="Example Name", status="active", metadata={"source": "example"} + ), tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/wireless_lan_group.py b/docs/examples/wireless_lan_group.py index f92b290..104b9e6 100644 --- a/docs/examples/wireless_lan_group.py +++ b/docs/examples/wireless_lan_group.py @@ -10,6 +10,8 @@ from netboxlabs.diode.sdk import DiodeClient from netboxlabs.diode.sdk.ingester import ( Entity, + Owner, + OwnerGroup, Tag, WirelessLANGroup, ) @@ -58,8 +60,9 @@ def wireless_lan_group_extended() -> WirelessLANGroup: return WirelessLANGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, description="Example description", + comments="Example comments", ) @@ -68,9 +71,21 @@ def wireless_lan_group_explicit() -> WirelessLANGroup: return WirelessLANGroup( name="Example Name", slug="example-slug", - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, description="Example description", comments="Example comments", + parent=WirelessLANGroup( + name="Example Name", slug="example-slug", metadata={"source": "example"} + ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/docs/examples/wireless_link.py b/docs/examples/wireless_link.py index e9ff4d3..a22335e 100644 --- a/docs/examples/wireless_link.py +++ b/docs/examples/wireless_link.py @@ -15,6 +15,8 @@ Entity, Interface, Manufacturer, + Owner, + OwnerGroup, Site, Tag, Tenant, @@ -63,9 +65,17 @@ def wireless_link_extended() -> WirelessLink: return WirelessLink( interface_a="Example Interface A", interface_b="Example Interface B", - metadata={"source": "example"}, + metadata={"source": "example", "custom_key": "custom_value"}, status="connected", description="Example description", + ssid="ExampleSSID", + tenant="Example Tenant", + auth_type="open", + auth_cipher="aes", + auth_psk="Example Auth Psk", + distance=1.0, + distance_unit="ft", + comments="Example comments", ) @@ -134,13 +144,28 @@ def wireless_link_explicit() -> WirelessLink: type="Example Type", metadata={"source": "example"}, ), - metadata={"source": "example"}, + metadata={ + "source": "example", + "custom_key": "custom_value", + "collected_at": "2024-01-15T10:30:00Z", + }, status="connected", description="Example description", comments="Example comments", + ssid="ExampleSSID", + auth_type="open", + auth_cipher="aes", + auth_psk="Example Auth Psk", + distance=1.0, + distance_unit="ft", tenant=Tenant( name="Example Name", slug="example-slug", metadata={"source": "example"} ), + owner=Owner( + name="Example Name", + group=OwnerGroup(name="Example Name", metadata={"source": "example"}), + metadata={"source": "example"}, + ), tags=[Tag(name="production")], ) diff --git a/netboxlabs/diode/sdk/ingester.py b/netboxlabs/diode/sdk/ingester.py index a123c22..9a57429 100644 --- a/netboxlabs/diode/sdk/ingester.py +++ b/netboxlabs/diode/sdk/ingester.py @@ -3,7 +3,7 @@ # # Generated code. DO NOT EDIT. # Source: NetBox v4.5.0 -# Timestamp: 2026-02-13 21:40:41Z +# Timestamp: 2026-02-17 23:39:36Z # # ruff: noqa: C901