diff --git a/README.md b/README.md index e045672..cf4b941 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,12 @@ if __name__ == "__main__": * [Role](./docs/entities.md#role) * [IP Address](./docs/entities.md#ip-address) * [Prefix](./docs/entities.md#prefix) +* [Cluster Group](./docs/entities.md#cluster-group) +* [Cluster Type](./docs/entities.md#cluster-type) +* [Cluster](./docs/entities.md#cluster) +* [Virtual Machine](./docs/entities.md#virtual-machine) +* [Virtual Disk](./docs/entities.md#virtual-disk) +* [VM Interface](./docs/entities.md#vm-interface) ## Development notes diff --git a/docs/entities.md b/docs/entities.md index f632abe..49681fc 100644 --- a/docs/entities.md +++ b/docs/entities.md @@ -747,3 +747,666 @@ 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:8081", + 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:8081", + 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:8081", + 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:8081", + 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:8081", + 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:8081", + 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 diff --git a/netboxlabs/diode/sdk/diode/v1/ingester_pb2.py b/netboxlabs/diode/sdk/diode/v1/ingester_pb2.py index dd4e1d7..4897938 100644 --- a/netboxlabs/diode/sdk/diode/v1/ingester_pb2.py +++ b/netboxlabs/diode/sdk/diode/v1/ingester_pb2.py @@ -16,7 +16,7 @@ from netboxlabs.diode.sdk.validate import validate_pb2 as validate_dot_validate__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x64iode/v1/ingester.proto\x12\x08\x64iode.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\"\xe4\x05\n\x06\x44\x65vice\x12\x1b\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x18@R\x04name\x12\x30\n\x0b\x64\x65vice_fqdn\x18\x02 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01H\x00R\ndeviceFqdn\x88\x01\x01\x12\x35\n\x0b\x64\x65vice_type\x18\x03 \x01(\x0b\x32\x14.diode.v1.DeviceTypeR\ndeviceType\x12\"\n\x04role\x18\x04 \x01(\x0b\x32\x0e.diode.v1.RoleR\x04role\x12.\n\x08platform\x18\x05 \x01(\x0b\x32\x12.diode.v1.PlatformR\x08platform\x12$\n\x06serial\x18\x06 \x01(\tB\x07\xfa\x42\x04r\x02\x18\x32H\x01R\x06serial\x88\x01\x01\x12\"\n\x04site\x18\x07 \x01(\x0b\x32\x0e.diode.v1.SiteR\x04site\x12*\n\tasset_tag\x18\x08 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x02R\x08\x61ssetTag\x88\x01\x01\x12\x63\n\x06status\x18\t \x01(\tBK\xfa\x42HrFR\x07offlineR\x06\x61\x63tiveR\x07plannedR\x06stagedR\x06\x66\x61iledR\tinventoryR\x0f\x64\x65\x63ommissioningR\x06status\x12/\n\x0b\x64\x65scription\x18\n \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x03R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x08\x63omments\x18\x0b \x01(\tH\x04R\x08\x63omments\x88\x01\x01\x12!\n\x04tags\x18\x0c \x03(\x0b\x32\r.diode.v1.TagR\x04tags\x12\x34\n\x0bprimary_ip4\x18\r \x01(\x0b\x32\x13.diode.v1.IPAddressR\nprimaryIp4\x12\x34\n\x0bprimary_ip6\x18\x0e \x01(\x0b\x32\x13.diode.v1.IPAddressR\nprimaryIp6B\x0e\n\x0c_device_fqdnB\t\n\x07_serialB\x0c\n\n_asset_tagB\x0e\n\x0c_descriptionB\x0b\n\t_comments\"\xef\x11\n\tInterface\x12\x32\n\x06\x64\x65vice\x18\x01 \x01(\x0b\x32\x10.diode.v1.DeviceB\x08\xfa\x42\x05\xa2\x01\x02\x08\x01R\x06\x64\x65vice\x12\x1d\n\x04name\x18\x02 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18@R\x04name\x12$\n\x05label\x18\x03 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18@H\x00R\x05label\x88\x01\x01\x12\xfa\x0c\n\x04type\x18\x04 \x01(\tB\xe5\x0c\xfa\x42\xe1\x0cr\xde\x0cR\x07virtualR\x06\x62ridgeR\x03lagR\n100base-fxR\x0b\x31\x30\x30\x62\x61se-lfxR\n100base-txR\n100base-t1R\n1000base-tR\x0f\x31\x30\x30\x30\x62\x61se-x-gbicR\x0e\x31\x30\x30\x30\x62\x61se-x-sfpR\n2.5gbase-tR\x08\x35gbase-tR\t10gbase-tR\x0b\x31\x30gbase-cx4R\x0e\x31\x30gbase-x-sfppR\r10gbase-x-xfpR\x10\x31\x30gbase-x-xenpakR\x0c\x31\x30gbase-x-x2R\x0f\x32\x35gbase-x-sfp28R\x0f\x35\x30gbase-x-sfp56R\x0f\x34\x30gbase-x-qsfppR\x0f\x35\x30gbase-x-sfp28R\x0e\x31\x30\x30gbase-x-cfpR\x0f\x31\x30\x30gbase-x-cfp2R\x0f\x31\x30\x30gbase-x-cfp4R\x0e\x31\x30\x30gbase-x-cxpR\x0f\x31\x30\x30gbase-x-cpakR\x0f\x31\x30\x30gbase-x-dsfpR\x10\x31\x30\x30gbase-x-sfpddR\x11\x31\x30\x30gbase-x-qsfp28R\x11\x31\x30\x30gbase-x-qsfpddR\x0f\x32\x30\x30gbase-x-cfp2R\x11\x32\x30\x30gbase-x-qsfp56R\x11\x32\x30\x30gbase-x-qsfpddR\x0f\x34\x30\x30gbase-x-cfp2R\x12\x34\x30\x30gbase-x-qsfp112R\x11\x34\x30\x30gbase-x-qsfpddR\x0f\x34\x30\x30gbase-x-osfpR\x13\x34\x30\x30gbase-x-osfp-rhsR\x0f\x34\x30\x30gbase-x-cdfpR\x0f\x34\x30\x30gbase-x-cfp8R\x11\x38\x30\x30gbase-x-qsfpddR\x0f\x38\x30\x30gbase-x-osfpR\x0b\x31\x30\x30\x30\x62\x61se-kxR\n10gbase-krR\x0b\x31\x30gbase-kx4R\n25gbase-krR\x0b\x34\x30gbase-kr4R\n50gbase-krR\x0c\x31\x30\x30gbase-kp4R\x0c\x31\x30\x30gbase-kr2R\x0c\x31\x30\x30gbase-kr4R\x0bieee802.11aR\x0bieee802.11gR\x0bieee802.11nR\x0cieee802.11acR\x0cieee802.11adR\x0cieee802.11axR\x0cieee802.11ayR\x0cieee802.15.1R\x0eother-wirelessR\x03gsmR\x04\x63\x64maR\x03lteR\tsonet-oc3R\nsonet-oc12R\nsonet-oc48R\x0bsonet-oc192R\x0bsonet-oc768R\x0csonet-oc1920R\x0csonet-oc3840R\x08\x31gfc-sfpR\x08\x32gfc-sfpR\x08\x34gfc-sfpR\t8gfc-sfppR\n16gfc-sfppR\x0b\x33\x32gfc-sfp28R\x0b\x36\x34gfc-qsfppR\r128gfc-qsfp28R\x0einfiniband-sdrR\x0einfiniband-ddrR\x0einfiniband-qdrR\x10infiniband-fdr10R\x0einfiniband-fdrR\x0einfiniband-edrR\x0einfiniband-hdrR\x0einfiniband-ndrR\x0einfiniband-xdrR\x02t1R\x02\x65\x31R\x02t3R\x02\x65\x33R\x04xdslR\x06\x64ocsisR\x04gponR\x06xg-ponR\x07xgs-ponR\x07ng-pon2R\x04\x65ponR\x08\x31\x30g-eponR\x0f\x63isco-stackwiseR\x14\x63isco-stackwise-plusR\x0f\x63isco-flexstackR\x14\x63isco-flexstack-plusR\x12\x63isco-stackwise-80R\x13\x63isco-stackwise-160R\x13\x63isco-stackwise-320R\x13\x63isco-stackwise-480R\x12\x63isco-stackwise-1tR\x0bjuniper-vcpR\x13\x65xtreme-summitstackR\x17\x65xtreme-summitstack-128R\x17\x65xtreme-summitstack-256R\x17\x65xtreme-summitstack-512R\x05otherR\x04type\x12\x1d\n\x07\x65nabled\x18\x05 \x01(\x08H\x01R\x07\x65nabled\x88\x01\x01\x12\"\n\x03mtu\x18\x06 \x01(\x05\x42\x0b\xfa\x42\x08\x1a\x06\x18\x80\x80\x04(\x01H\x02R\x03mtu\x88\x01\x01\x12$\n\x0bmac_address\x18\x07 \x01(\tH\x03R\nmacAddress\x88\x01\x01\x12\"\n\x05speed\x18\x08 \x01(\x05\x42\x07\xfa\x42\x04\x1a\x02(\x00H\x04R\x05speed\x88\x01\x01\x12\x15\n\x03wwn\x18\t \x01(\tH\x05R\x03wwn\x88\x01\x01\x12 \n\tmgmt_only\x18\n \x01(\x08H\x06R\x08mgmtOnly\x88\x01\x01\x12/\n\x0b\x64\x65scription\x18\x0b \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x07R\x0b\x64\x65scription\x88\x01\x01\x12*\n\x0emark_connected\x18\x0c \x01(\x08H\x08R\rmarkConnected\x88\x01\x01\x12\x35\n\x04mode\x18\r \x01(\tB!\xfa\x42\x1er\x1cR\x06\x61\x63\x63\x65ssR\x06taggedR\ntagged-allR\x04mode\x12!\n\x04tags\x18\x0e \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x08\n\x06_labelB\n\n\x08_enabledB\x06\n\x04_mtuB\x0e\n\x0c_mac_addressB\x08\n\x06_speedB\x06\n\x04_wwnB\x0c\n\n_mgmt_onlyB\x0e\n\x0c_descriptionB\x11\n\x0f_mark_connected\"\x8c\x04\n\tIPAddress\x12!\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02p\x01R\x07\x61\x64\x64ress\x12\x33\n\tinterface\x18\x02 \x01(\x0b\x32\x13.diode.v1.InterfaceH\x00R\tinterface\x12H\n\x06status\x18\x03 \x01(\tB0\xfa\x42-r+R\x06\x61\x63tiveR\x08reservedR\ndeprecatedR\x04\x64hcpR\x05slaacR\x06status\x12T\n\x04role\x18\x04 \x01(\tB@\xfa\x42=r;R\x08loopbackR\tsecondaryR\x07\x61nycastR\x03vipR\x04vrrpR\x04hsrpR\x04glbpR\x04\x63\x61rpR\x04role\x12U\n\x08\x64ns_name\x18\x05 \x01(\tB5\xfa\x42\x32r0\x18\xff\x01\x32+^([0-9A-Za-z_-]+|\\*)(\\.[0-9A-Za-z_-]+)*\\.?$H\x01R\x07\x64nsName\x88\x01\x01\x12/\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x08\x63omments\x18\x07 \x01(\tH\x03R\x08\x63omments\x88\x01\x01\x12!\n\x04tags\x18\x08 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x11\n\x0f\x61ssigned_objectB\x0b\n\t_dns_nameB\x0e\n\x0c_descriptionB\x0b\n\t_comments\"\xeb\x02\n\nDeviceType\x12\x1f\n\x05model\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x05model\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12:\n\x0cmanufacturer\x18\x03 \x01(\x0b\x32\x16.diode.v1.ManufacturerR\x0cmanufacturer\x12/\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x08\x63omments\x18\x05 \x01(\tH\x01R\x08\x63omments\x88\x01\x01\x12-\n\x0bpart_number\x18\x06 \x01(\tB\x07\xfa\x42\x04r\x02\x18\x32H\x02R\npartNumber\x88\x01\x01\x12!\n\x04tags\x18\x07 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_descriptionB\x0b\n\t_commentsB\x0e\n\x0c_part_number\"\xc2\x01\n\x0cManufacturer\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12/\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12!\n\x04tags\x18\x04 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_description\"\xfa\x01\n\x08Platform\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12:\n\x0cmanufacturer\x18\x03 \x01(\x0b\x32\x16.diode.v1.ManufacturerR\x0cmanufacturer\x12/\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12!\n\x04tags\x18\x05 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_description\"\x8d\x03\n\x06Prefix\x12\x1f\n\x06prefix\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02p\x01R\x06prefix\x12\"\n\x04site\x18\x02 \x01(\x0b\x32\x0e.diode.v1.SiteR\x04site\x12\x46\n\x06status\x18\x03 \x01(\tB.\xfa\x42+r)R\x06\x61\x63tiveR\tcontainerR\x08reservedR\ndeprecatedR\x06status\x12\x1c\n\x07is_pool\x18\x04 \x01(\x08H\x00R\x06isPool\x88\x01\x01\x12(\n\rmark_utilized\x18\x05 \x01(\x08H\x01R\x0cmarkUtilized\x88\x01\x01\x12/\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x08\x63omments\x18\x07 \x01(\tH\x03R\x08\x63omments\x88\x01\x01\x12!\n\x04tags\x18\x08 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\n\n\x08_is_poolB\x10\n\x0e_mark_utilizedB\x0e\n\x0c_descriptionB\x0b\n\t_comments\"\xea\x01\n\x04Role\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12.\n\x05\x63olor\x18\x03 \x01(\tB\x18\xfa\x42\x15r\x13\x10\x06\x18\x06\x32\r^[0-9a-f]{6}$R\x05\x63olor\x12/\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12!\n\x04tags\x18\x05 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_description\"\xa2\x03\n\x04Site\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12Q\n\x06status\x18\x03 \x01(\tB9\xfa\x42\x36r4R\x07plannedR\x07stagingR\x06\x61\x63tiveR\x0f\x64\x65\x63ommissioningR\x07retiredR\x06status\x12(\n\x08\x66\x61\x63ility\x18\x04 \x01(\tB\x07\xfa\x42\x04r\x02\x18\x32H\x00R\x08\x66\x61\x63ility\x88\x01\x01\x12 \n\ttime_zone\x18\x05 \x01(\tH\x01R\x08timeZone\x88\x01\x01\x12/\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x08\x63omments\x18\x07 \x01(\tH\x03R\x08\x63omments\x88\x01\x01\x12!\n\x04tags\x18\x08 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0b\n\t_facilityB\x0c\n\n_time_zoneB\x0e\n\x0c_descriptionB\x0b\n\t_comments\"\x85\x01\n\x03Tag\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12.\n\x05\x63olor\x18\x03 \x01(\tB\x18\xfa\x42\x15r\x13\x10\x06\x18\x06\x32\r^[0-9a-f]{6}$R\x05\x63olor\"\x9d\x04\n\x06\x45ntity\x12$\n\x04site\x18\x01 \x01(\x0b\x32\x0e.diode.v1.SiteH\x00R\x04site\x12\x30\n\x08platform\x18\x02 \x01(\x0b\x32\x12.diode.v1.PlatformH\x00R\x08platform\x12<\n\x0cmanufacturer\x18\x03 \x01(\x0b\x32\x16.diode.v1.ManufacturerH\x00R\x0cmanufacturer\x12*\n\x06\x64\x65vice\x18\x04 \x01(\x0b\x32\x10.diode.v1.DeviceH\x00R\x06\x64\x65vice\x12\x31\n\x0b\x64\x65vice_role\x18\x05 \x01(\x0b\x32\x0e.diode.v1.RoleH\x00R\ndeviceRole\x12\x37\n\x0b\x64\x65vice_type\x18\x06 \x01(\x0b\x32\x14.diode.v1.DeviceTypeH\x00R\ndeviceType\x12\x33\n\tinterface\x18\x07 \x01(\x0b\x32\x13.diode.v1.InterfaceH\x00R\tinterface\x12\x34\n\nip_address\x18\t \x01(\x0b\x32\x13.diode.v1.IPAddressH\x00R\tipAddress\x12*\n\x06prefix\x18\n \x01(\x0b\x32\x10.diode.v1.PrefixH\x00R\x06prefix\x12\x44\n\ttimestamp\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\n\xfa\x42\x07\xb2\x01\x04\x08\x01\x38\x01R\ttimestampB\x08\n\x06\x65ntity\"\xe4\x02\n\rIngestRequest\x12\"\n\x06stream\x18\x01 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01R\x06stream\x12\x39\n\x08\x65ntities\x18\x02 \x03(\x0b\x32\x10.diode.v1.EntityB\x0b\xfa\x42\x08\x92\x01\x05\x08\x01\x10\xe8\x07R\x08\x65ntities\x12\x18\n\x02id\x18\x03 \x01(\tB\x08\xfa\x42\x05r\x03\xb0\x01\x01R\x02id\x12\x36\n\x11producer_app_name\x18\x04 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01R\x0fproducerAppName\x12<\n\x14producer_app_version\x18\x05 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01R\x12producerAppVersion\x12%\n\x08sdk_name\x18\x06 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01R\x07sdkName\x12=\n\x0bsdk_version\x18\x07 \x01(\tB\x1c\xfa\x42\x19r\x17\x32\x15^(\\d)+\\.(\\d)+\\.(\\d)+$R\nsdkVersion\"(\n\x0eIngestResponse\x12\x16\n\x06\x65rrors\x18\x01 \x03(\tR\x06\x65rrors2P\n\x0fIngesterService\x12=\n\x06Ingest\x12\x17.diode.v1.IngestRequest\x1a\x18.diode.v1.IngestResponse\"\x00\x42\x35Z3github.com/netboxlabs/diode-sdk-go/diode/v1/diodepbb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x64iode/v1/ingester.proto\x12\x08\x64iode.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17validate/validate.proto\"\xe4\x05\n\x06\x44\x65vice\x12\x1b\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x18@R\x04name\x12\x30\n\x0b\x64\x65vice_fqdn\x18\x02 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01H\x00R\ndeviceFqdn\x88\x01\x01\x12\x35\n\x0b\x64\x65vice_type\x18\x03 \x01(\x0b\x32\x14.diode.v1.DeviceTypeR\ndeviceType\x12\"\n\x04role\x18\x04 \x01(\x0b\x32\x0e.diode.v1.RoleR\x04role\x12.\n\x08platform\x18\x05 \x01(\x0b\x32\x12.diode.v1.PlatformR\x08platform\x12$\n\x06serial\x18\x06 \x01(\tB\x07\xfa\x42\x04r\x02\x18\x32H\x01R\x06serial\x88\x01\x01\x12\"\n\x04site\x18\x07 \x01(\x0b\x32\x0e.diode.v1.SiteR\x04site\x12*\n\tasset_tag\x18\x08 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x02R\x08\x61ssetTag\x88\x01\x01\x12\x63\n\x06status\x18\t \x01(\tBK\xfa\x42HrFR\x07offlineR\x06\x61\x63tiveR\x07plannedR\x06stagedR\x06\x66\x61iledR\tinventoryR\x0f\x64\x65\x63ommissioningR\x06status\x12/\n\x0b\x64\x65scription\x18\n \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x03R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x08\x63omments\x18\x0b \x01(\tH\x04R\x08\x63omments\x88\x01\x01\x12!\n\x04tags\x18\x0c \x03(\x0b\x32\r.diode.v1.TagR\x04tags\x12\x34\n\x0bprimary_ip4\x18\r \x01(\x0b\x32\x13.diode.v1.IPAddressR\nprimaryIp4\x12\x34\n\x0bprimary_ip6\x18\x0e \x01(\x0b\x32\x13.diode.v1.IPAddressR\nprimaryIp6B\x0e\n\x0c_device_fqdnB\t\n\x07_serialB\x0c\n\n_asset_tagB\x0e\n\x0c_descriptionB\x0b\n\t_comments\"\xef\x11\n\tInterface\x12\x32\n\x06\x64\x65vice\x18\x01 \x01(\x0b\x32\x10.diode.v1.DeviceB\x08\xfa\x42\x05\xa2\x01\x02\x08\x01R\x06\x64\x65vice\x12\x1d\n\x04name\x18\x02 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18@R\x04name\x12$\n\x05label\x18\x03 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18@H\x00R\x05label\x88\x01\x01\x12\xfa\x0c\n\x04type\x18\x04 \x01(\tB\xe5\x0c\xfa\x42\xe1\x0cr\xde\x0cR\x07virtualR\x06\x62ridgeR\x03lagR\n100base-fxR\x0b\x31\x30\x30\x62\x61se-lfxR\n100base-txR\n100base-t1R\n1000base-tR\x0f\x31\x30\x30\x30\x62\x61se-x-gbicR\x0e\x31\x30\x30\x30\x62\x61se-x-sfpR\n2.5gbase-tR\x08\x35gbase-tR\t10gbase-tR\x0b\x31\x30gbase-cx4R\x0e\x31\x30gbase-x-sfppR\r10gbase-x-xfpR\x10\x31\x30gbase-x-xenpakR\x0c\x31\x30gbase-x-x2R\x0f\x32\x35gbase-x-sfp28R\x0f\x35\x30gbase-x-sfp56R\x0f\x34\x30gbase-x-qsfppR\x0f\x35\x30gbase-x-sfp28R\x0e\x31\x30\x30gbase-x-cfpR\x0f\x31\x30\x30gbase-x-cfp2R\x0f\x31\x30\x30gbase-x-cfp4R\x0e\x31\x30\x30gbase-x-cxpR\x0f\x31\x30\x30gbase-x-cpakR\x0f\x31\x30\x30gbase-x-dsfpR\x10\x31\x30\x30gbase-x-sfpddR\x11\x31\x30\x30gbase-x-qsfp28R\x11\x31\x30\x30gbase-x-qsfpddR\x0f\x32\x30\x30gbase-x-cfp2R\x11\x32\x30\x30gbase-x-qsfp56R\x11\x32\x30\x30gbase-x-qsfpddR\x0f\x34\x30\x30gbase-x-cfp2R\x12\x34\x30\x30gbase-x-qsfp112R\x11\x34\x30\x30gbase-x-qsfpddR\x0f\x34\x30\x30gbase-x-osfpR\x13\x34\x30\x30gbase-x-osfp-rhsR\x0f\x34\x30\x30gbase-x-cdfpR\x0f\x34\x30\x30gbase-x-cfp8R\x11\x38\x30\x30gbase-x-qsfpddR\x0f\x38\x30\x30gbase-x-osfpR\x0b\x31\x30\x30\x30\x62\x61se-kxR\n10gbase-krR\x0b\x31\x30gbase-kx4R\n25gbase-krR\x0b\x34\x30gbase-kr4R\n50gbase-krR\x0c\x31\x30\x30gbase-kp4R\x0c\x31\x30\x30gbase-kr2R\x0c\x31\x30\x30gbase-kr4R\x0bieee802.11aR\x0bieee802.11gR\x0bieee802.11nR\x0cieee802.11acR\x0cieee802.11adR\x0cieee802.11axR\x0cieee802.11ayR\x0cieee802.15.1R\x0eother-wirelessR\x03gsmR\x04\x63\x64maR\x03lteR\tsonet-oc3R\nsonet-oc12R\nsonet-oc48R\x0bsonet-oc192R\x0bsonet-oc768R\x0csonet-oc1920R\x0csonet-oc3840R\x08\x31gfc-sfpR\x08\x32gfc-sfpR\x08\x34gfc-sfpR\t8gfc-sfppR\n16gfc-sfppR\x0b\x33\x32gfc-sfp28R\x0b\x36\x34gfc-qsfppR\r128gfc-qsfp28R\x0einfiniband-sdrR\x0einfiniband-ddrR\x0einfiniband-qdrR\x10infiniband-fdr10R\x0einfiniband-fdrR\x0einfiniband-edrR\x0einfiniband-hdrR\x0einfiniband-ndrR\x0einfiniband-xdrR\x02t1R\x02\x65\x31R\x02t3R\x02\x65\x33R\x04xdslR\x06\x64ocsisR\x04gponR\x06xg-ponR\x07xgs-ponR\x07ng-pon2R\x04\x65ponR\x08\x31\x30g-eponR\x0f\x63isco-stackwiseR\x14\x63isco-stackwise-plusR\x0f\x63isco-flexstackR\x14\x63isco-flexstack-plusR\x12\x63isco-stackwise-80R\x13\x63isco-stackwise-160R\x13\x63isco-stackwise-320R\x13\x63isco-stackwise-480R\x12\x63isco-stackwise-1tR\x0bjuniper-vcpR\x13\x65xtreme-summitstackR\x17\x65xtreme-summitstack-128R\x17\x65xtreme-summitstack-256R\x17\x65xtreme-summitstack-512R\x05otherR\x04type\x12\x1d\n\x07\x65nabled\x18\x05 \x01(\x08H\x01R\x07\x65nabled\x88\x01\x01\x12\"\n\x03mtu\x18\x06 \x01(\x05\x42\x0b\xfa\x42\x08\x1a\x06\x18\x80\x80\x04(\x01H\x02R\x03mtu\x88\x01\x01\x12$\n\x0bmac_address\x18\x07 \x01(\tH\x03R\nmacAddress\x88\x01\x01\x12\"\n\x05speed\x18\x08 \x01(\x05\x42\x07\xfa\x42\x04\x1a\x02(\x00H\x04R\x05speed\x88\x01\x01\x12\x15\n\x03wwn\x18\t \x01(\tH\x05R\x03wwn\x88\x01\x01\x12 \n\tmgmt_only\x18\n \x01(\x08H\x06R\x08mgmtOnly\x88\x01\x01\x12/\n\x0b\x64\x65scription\x18\x0b \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x07R\x0b\x64\x65scription\x88\x01\x01\x12*\n\x0emark_connected\x18\x0c \x01(\x08H\x08R\rmarkConnected\x88\x01\x01\x12\x35\n\x04mode\x18\r \x01(\tB!\xfa\x42\x1er\x1cR\x06\x61\x63\x63\x65ssR\x06taggedR\ntagged-allR\x04mode\x12!\n\x04tags\x18\x0e \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x08\n\x06_labelB\n\n\x08_enabledB\x06\n\x04_mtuB\x0e\n\x0c_mac_addressB\x08\n\x06_speedB\x06\n\x04_wwnB\x0c\n\n_mgmt_onlyB\x0e\n\x0c_descriptionB\x11\n\x0f_mark_connected\"\xe3\x02\n\x07\x43luster\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12)\n\x04type\x18\x02 \x01(\x0b\x32\x15.diode.v1.ClusterTypeR\x04type\x12,\n\x05group\x18\x03 \x01(\x0b\x32\x16.diode.v1.ClusterGroupR\x05group\x12\"\n\x04site\x18\x04 \x01(\x0b\x32\x0e.diode.v1.SiteR\x04site\x12X\n\x06status\x18\x05 \x01(\tB@\xfa\x42=r;R\x07offlineR\x06\x61\x63tiveR\x07plannedR\x06stagedR\x06\x66\x61iledR\x0f\x64\x65\x63ommissioningR\x06status\x12/\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12!\n\x04tags\x18\x07 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_description\"\xc1\x01\n\x0b\x43lusterType\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12/\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12!\n\x04tags\x18\x04 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_description\"\xc2\x01\n\x0c\x43lusterGroup\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12/\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12!\n\x04tags\x18\x04 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_description\"\xde\x05\n\x0eVirtualMachine\x12\x1b\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x18@R\x04name\x12X\n\x06status\x18\x02 \x01(\tB@\xfa\x42=r;R\x07offlineR\x06\x61\x63tiveR\x07plannedR\x06stagedR\x06\x66\x61iledR\x0f\x64\x65\x63ommissioningR\x06status\x12\"\n\x04site\x18\x03 \x01(\x0b\x32\x0e.diode.v1.SiteR\x04site\x12+\n\x07\x63luster\x18\x04 \x01(\x0b\x32\x11.diode.v1.ClusterR\x07\x63luster\x12\"\n\x04role\x18\x05 \x01(\x0b\x32\x0e.diode.v1.RoleR\x04role\x12(\n\x06\x64\x65vice\x18\x06 \x01(\x0b\x32\x10.diode.v1.DeviceR\x06\x64\x65vice\x12.\n\x08platform\x18\x07 \x01(\x0b\x32\x12.diode.v1.PlatformR\x08platform\x12\x34\n\x0bprimary_ip4\x18\x08 \x01(\x0b\x32\x13.diode.v1.IPAddressR\nprimaryIp4\x12\x34\n\x0bprimary_ip6\x18\t \x01(\x0b\x32\x13.diode.v1.IPAddressR\nprimaryIp6\x12\"\n\x05vcpus\x18\n \x01(\x05\x42\x07\xfa\x42\x04\x1a\x02(\x00H\x00R\x05vcpus\x88\x01\x01\x12$\n\x06memory\x18\x0b \x01(\x05\x42\x07\xfa\x42\x04\x1a\x02(\x00H\x01R\x06memory\x88\x01\x01\x12 \n\x04\x64isk\x18\x0c \x01(\x05\x42\x07\xfa\x42\x04\x1a\x02(\x00H\x02R\x04\x64isk\x88\x01\x01\x12/\n\x0b\x64\x65scription\x18\r \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x03R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x08\x63omments\x18\x0e \x01(\tH\x04R\x08\x63omments\x88\x01\x01\x12!\n\x04tags\x18\x0f \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x08\n\x06_vcpusB\t\n\x07_memoryB\x07\n\x05_diskB\x0e\n\x0c_descriptionB\x0b\n\t_comments\"\xea\x02\n\x0bVMInterface\x12K\n\x0fvirtual_machine\x18\x01 \x01(\x0b\x32\x18.diode.v1.VirtualMachineB\x08\xfa\x42\x05\xa2\x01\x02\x08\x01R\x0evirtualMachine\x12\x1d\n\x04name\x18\x02 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18@R\x04name\x12\x1d\n\x07\x65nabled\x18\x03 \x01(\x08H\x00R\x07\x65nabled\x88\x01\x01\x12\"\n\x03mtu\x18\x04 \x01(\x05\x42\x0b\xfa\x42\x08\x1a\x06\x18\x80\x80\x04(\x01H\x01R\x03mtu\x88\x01\x01\x12$\n\x0bmac_address\x18\x05 \x01(\tH\x02R\nmacAddress\x88\x01\x01\x12/\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x03R\x0b\x64\x65scription\x88\x01\x01\x12!\n\x04tags\x18\x07 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\n\n\x08_enabledB\x06\n\x04_mtuB\x0e\n\x0c_mac_addressB\x0e\n\x0c_description\"\xfa\x01\n\x0bVirtualDisk\x12K\n\x0fvirtual_machine\x18\x01 \x01(\x0b\x32\x18.diode.v1.VirtualMachineB\x08\xfa\x42\x05\xa2\x01\x02\x08\x01R\x0evirtualMachine\x12\x1d\n\x04name\x18\x02 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12\x1b\n\x04size\x18\x03 \x01(\x05\x42\x07\xfa\x42\x04\x1a\x02(\x00R\x04size\x12/\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12!\n\x04tags\x18\x05 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_description\"\x8c\x04\n\tIPAddress\x12!\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02p\x01R\x07\x61\x64\x64ress\x12\x33\n\tinterface\x18\x02 \x01(\x0b\x32\x13.diode.v1.InterfaceH\x00R\tinterface\x12H\n\x06status\x18\x03 \x01(\tB0\xfa\x42-r+R\x06\x61\x63tiveR\x08reservedR\ndeprecatedR\x04\x64hcpR\x05slaacR\x06status\x12T\n\x04role\x18\x04 \x01(\tB@\xfa\x42=r;R\x08loopbackR\tsecondaryR\x07\x61nycastR\x03vipR\x04vrrpR\x04hsrpR\x04glbpR\x04\x63\x61rpR\x04role\x12U\n\x08\x64ns_name\x18\x05 \x01(\tB5\xfa\x42\x32r0\x18\xff\x01\x32+^([0-9A-Za-z_-]+|\\*)(\\.[0-9A-Za-z_-]+)*\\.?$H\x01R\x07\x64nsName\x88\x01\x01\x12/\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x08\x63omments\x18\x07 \x01(\tH\x03R\x08\x63omments\x88\x01\x01\x12!\n\x04tags\x18\x08 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x11\n\x0f\x61ssigned_objectB\x0b\n\t_dns_nameB\x0e\n\x0c_descriptionB\x0b\n\t_comments\"\xeb\x02\n\nDeviceType\x12\x1f\n\x05model\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x05model\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12:\n\x0cmanufacturer\x18\x03 \x01(\x0b\x32\x16.diode.v1.ManufacturerR\x0cmanufacturer\x12/\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x08\x63omments\x18\x05 \x01(\tH\x01R\x08\x63omments\x88\x01\x01\x12-\n\x0bpart_number\x18\x06 \x01(\tB\x07\xfa\x42\x04r\x02\x18\x32H\x02R\npartNumber\x88\x01\x01\x12!\n\x04tags\x18\x07 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_descriptionB\x0b\n\t_commentsB\x0e\n\x0c_part_number\"\xc2\x01\n\x0cManufacturer\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12/\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12!\n\x04tags\x18\x04 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_description\"\xfa\x01\n\x08Platform\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12:\n\x0cmanufacturer\x18\x03 \x01(\x0b\x32\x16.diode.v1.ManufacturerR\x0cmanufacturer\x12/\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12!\n\x04tags\x18\x05 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_description\"\x8d\x03\n\x06Prefix\x12\x1f\n\x06prefix\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02p\x01R\x06prefix\x12\"\n\x04site\x18\x02 \x01(\x0b\x32\x0e.diode.v1.SiteR\x04site\x12\x46\n\x06status\x18\x03 \x01(\tB.\xfa\x42+r)R\x06\x61\x63tiveR\tcontainerR\x08reservedR\ndeprecatedR\x06status\x12\x1c\n\x07is_pool\x18\x04 \x01(\x08H\x00R\x06isPool\x88\x01\x01\x12(\n\rmark_utilized\x18\x05 \x01(\x08H\x01R\x0cmarkUtilized\x88\x01\x01\x12/\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x08\x63omments\x18\x07 \x01(\tH\x03R\x08\x63omments\x88\x01\x01\x12!\n\x04tags\x18\x08 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\n\n\x08_is_poolB\x10\n\x0e_mark_utilizedB\x0e\n\x0c_descriptionB\x0b\n\t_comments\"\xea\x01\n\x04Role\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12.\n\x05\x63olor\x18\x03 \x01(\tB\x18\xfa\x42\x15r\x13\x10\x06\x18\x06\x32\r^[0-9a-f]{6}$R\x05\x63olor\x12/\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12!\n\x04tags\x18\x05 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0e\n\x0c_description\"\xa2\x03\n\x04Site\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12Q\n\x06status\x18\x03 \x01(\tB9\xfa\x42\x36r4R\x07plannedR\x07stagingR\x06\x61\x63tiveR\x0f\x64\x65\x63ommissioningR\x07retiredR\x06status\x12(\n\x08\x66\x61\x63ility\x18\x04 \x01(\tB\x07\xfa\x42\x04r\x02\x18\x32H\x00R\x08\x66\x61\x63ility\x88\x01\x01\x12 \n\ttime_zone\x18\x05 \x01(\tH\x01R\x08timeZone\x88\x01\x01\x12/\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x08\xfa\x42\x05r\x03\x18\xc8\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12\x1f\n\x08\x63omments\x18\x07 \x01(\tH\x03R\x08\x63omments\x88\x01\x01\x12!\n\x04tags\x18\x08 \x03(\x0b\x32\r.diode.v1.TagR\x04tagsB\x0b\n\t_facilityB\x0c\n\n_time_zoneB\x0e\n\x0c_descriptionB\x0b\n\t_comments\"\x85\x01\n\x03Tag\x12\x1d\n\x04name\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04\x10\x01\x18\x64R\x04name\x12/\n\x04slug\x18\x02 \x01(\tB\x1b\xfa\x42\x18r\x16\x10\x01\x18\x64\x32\x10^[-a-zA-Z0-9_]+$R\x04slug\x12.\n\x05\x63olor\x18\x03 \x01(\tB\x18\xfa\x42\x15r\x13\x10\x06\x18\x06\x32\r^[0-9a-f]{6}$R\x05\x63olor\"\x83\x07\n\x06\x45ntity\x12$\n\x04site\x18\x01 \x01(\x0b\x32\x0e.diode.v1.SiteH\x00R\x04site\x12\x30\n\x08platform\x18\x02 \x01(\x0b\x32\x12.diode.v1.PlatformH\x00R\x08platform\x12<\n\x0cmanufacturer\x18\x03 \x01(\x0b\x32\x16.diode.v1.ManufacturerH\x00R\x0cmanufacturer\x12*\n\x06\x64\x65vice\x18\x04 \x01(\x0b\x32\x10.diode.v1.DeviceH\x00R\x06\x64\x65vice\x12\x31\n\x0b\x64\x65vice_role\x18\x05 \x01(\x0b\x32\x0e.diode.v1.RoleH\x00R\ndeviceRole\x12\x37\n\x0b\x64\x65vice_type\x18\x06 \x01(\x0b\x32\x14.diode.v1.DeviceTypeH\x00R\ndeviceType\x12\x33\n\tinterface\x18\x07 \x01(\x0b\x32\x13.diode.v1.InterfaceH\x00R\tinterface\x12\x34\n\nip_address\x18\t \x01(\x0b\x32\x13.diode.v1.IPAddressH\x00R\tipAddress\x12*\n\x06prefix\x18\n \x01(\x0b\x32\x10.diode.v1.PrefixH\x00R\x06prefix\x12=\n\rcluster_group\x18\x0b \x01(\x0b\x32\x16.diode.v1.ClusterGroupH\x00R\x0c\x63lusterGroup\x12:\n\x0c\x63luster_type\x18\x0c \x01(\x0b\x32\x15.diode.v1.ClusterTypeH\x00R\x0b\x63lusterType\x12-\n\x07\x63luster\x18\r \x01(\x0b\x32\x11.diode.v1.ClusterH\x00R\x07\x63luster\x12\x43\n\x0fvirtual_machine\x18\x0e \x01(\x0b\x32\x18.diode.v1.VirtualMachineH\x00R\x0evirtualMachine\x12\x39\n\x0bvminterface\x18\x0f \x01(\x0b\x32\x15.diode.v1.VMInterfaceH\x00R\x0bvminterface\x12:\n\x0cvirtual_disk\x18\x10 \x01(\x0b\x32\x15.diode.v1.VirtualDiskH\x00R\x0bvirtualDisk\x12\x44\n\ttimestamp\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\n\xfa\x42\x07\xb2\x01\x04\x08\x01\x38\x01R\ttimestampB\x08\n\x06\x65ntity\"\xe4\x02\n\rIngestRequest\x12\"\n\x06stream\x18\x01 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01R\x06stream\x12\x39\n\x08\x65ntities\x18\x02 \x03(\x0b\x32\x10.diode.v1.EntityB\x0b\xfa\x42\x08\x92\x01\x05\x08\x01\x10\xe8\x07R\x08\x65ntities\x12\x18\n\x02id\x18\x03 \x01(\tB\x08\xfa\x42\x05r\x03\xb0\x01\x01R\x02id\x12\x36\n\x11producer_app_name\x18\x04 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01R\x0fproducerAppName\x12<\n\x14producer_app_version\x18\x05 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01R\x12producerAppVersion\x12%\n\x08sdk_name\x18\x06 \x01(\tB\n\xfa\x42\x07r\x05\x10\x01\x18\xff\x01R\x07sdkName\x12=\n\x0bsdk_version\x18\x07 \x01(\tB\x1c\xfa\x42\x19r\x17\x32\x15^(\\d)+\\.(\\d)+\\.(\\d)+$R\nsdkVersion\"(\n\x0eIngestResponse\x12\x16\n\x06\x65rrors\x18\x01 \x03(\tR\x06\x65rrors2P\n\x0fIngesterService\x12=\n\x06Ingest\x12\x17.diode.v1.IngestRequest\x1a\x18.diode.v1.IngestResponse\"\x00\x42\x35Z3github.com/netboxlabs/diode-sdk-go/diode/v1/diodepbb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -52,6 +52,52 @@ _globals['_INTERFACE'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' _globals['_INTERFACE'].fields_by_name['mode']._loaded_options = None _globals['_INTERFACE'].fields_by_name['mode']._serialized_options = b'\372B\036r\034R\006accessR\006taggedR\ntagged-all' + _globals['_CLUSTER'].fields_by_name['name']._loaded_options = None + _globals['_CLUSTER'].fields_by_name['name']._serialized_options = b'\372B\006r\004\020\001\030d' + _globals['_CLUSTER'].fields_by_name['status']._loaded_options = None + _globals['_CLUSTER'].fields_by_name['status']._serialized_options = b'\372B=r;R\007offlineR\006activeR\007plannedR\006stagedR\006failedR\017decommissioning' + _globals['_CLUSTER'].fields_by_name['description']._loaded_options = None + _globals['_CLUSTER'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' + _globals['_CLUSTERTYPE'].fields_by_name['name']._loaded_options = None + _globals['_CLUSTERTYPE'].fields_by_name['name']._serialized_options = b'\372B\006r\004\020\001\030d' + _globals['_CLUSTERTYPE'].fields_by_name['slug']._loaded_options = None + _globals['_CLUSTERTYPE'].fields_by_name['slug']._serialized_options = b'\372B\030r\026\020\001\030d2\020^[-a-zA-Z0-9_]+$' + _globals['_CLUSTERTYPE'].fields_by_name['description']._loaded_options = None + _globals['_CLUSTERTYPE'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' + _globals['_CLUSTERGROUP'].fields_by_name['name']._loaded_options = None + _globals['_CLUSTERGROUP'].fields_by_name['name']._serialized_options = b'\372B\006r\004\020\001\030d' + _globals['_CLUSTERGROUP'].fields_by_name['slug']._loaded_options = None + _globals['_CLUSTERGROUP'].fields_by_name['slug']._serialized_options = b'\372B\030r\026\020\001\030d2\020^[-a-zA-Z0-9_]+$' + _globals['_CLUSTERGROUP'].fields_by_name['description']._loaded_options = None + _globals['_CLUSTERGROUP'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' + _globals['_VIRTUALMACHINE'].fields_by_name['name']._loaded_options = None + _globals['_VIRTUALMACHINE'].fields_by_name['name']._serialized_options = b'\372B\004r\002\030@' + _globals['_VIRTUALMACHINE'].fields_by_name['status']._loaded_options = None + _globals['_VIRTUALMACHINE'].fields_by_name['status']._serialized_options = b'\372B=r;R\007offlineR\006activeR\007plannedR\006stagedR\006failedR\017decommissioning' + _globals['_VIRTUALMACHINE'].fields_by_name['vcpus']._loaded_options = None + _globals['_VIRTUALMACHINE'].fields_by_name['vcpus']._serialized_options = b'\372B\004\032\002(\000' + _globals['_VIRTUALMACHINE'].fields_by_name['memory']._loaded_options = None + _globals['_VIRTUALMACHINE'].fields_by_name['memory']._serialized_options = b'\372B\004\032\002(\000' + _globals['_VIRTUALMACHINE'].fields_by_name['disk']._loaded_options = None + _globals['_VIRTUALMACHINE'].fields_by_name['disk']._serialized_options = b'\372B\004\032\002(\000' + _globals['_VIRTUALMACHINE'].fields_by_name['description']._loaded_options = None + _globals['_VIRTUALMACHINE'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' + _globals['_VMINTERFACE'].fields_by_name['virtual_machine']._loaded_options = None + _globals['_VMINTERFACE'].fields_by_name['virtual_machine']._serialized_options = b'\372B\005\242\001\002\010\001' + _globals['_VMINTERFACE'].fields_by_name['name']._loaded_options = None + _globals['_VMINTERFACE'].fields_by_name['name']._serialized_options = b'\372B\006r\004\020\001\030@' + _globals['_VMINTERFACE'].fields_by_name['mtu']._loaded_options = None + _globals['_VMINTERFACE'].fields_by_name['mtu']._serialized_options = b'\372B\010\032\006\030\200\200\004(\001' + _globals['_VMINTERFACE'].fields_by_name['description']._loaded_options = None + _globals['_VMINTERFACE'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' + _globals['_VIRTUALDISK'].fields_by_name['virtual_machine']._loaded_options = None + _globals['_VIRTUALDISK'].fields_by_name['virtual_machine']._serialized_options = b'\372B\005\242\001\002\010\001' + _globals['_VIRTUALDISK'].fields_by_name['name']._loaded_options = None + _globals['_VIRTUALDISK'].fields_by_name['name']._serialized_options = b'\372B\006r\004\020\001\030d' + _globals['_VIRTUALDISK'].fields_by_name['size']._loaded_options = None + _globals['_VIRTUALDISK'].fields_by_name['size']._serialized_options = b'\372B\004\032\002(\000' + _globals['_VIRTUALDISK'].fields_by_name['description']._loaded_options = None + _globals['_VIRTUALDISK'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' _globals['_IPADDRESS'].fields_by_name['address']._loaded_options = None _globals['_IPADDRESS'].fields_by_name['address']._serialized_options = b'\372B\004r\002p\001' _globals['_IPADDRESS'].fields_by_name['status']._loaded_options = None @@ -132,28 +178,40 @@ _globals['_DEVICE']._serialized_end=836 _globals['_INTERFACE']._serialized_start=839 _globals['_INTERFACE']._serialized_end=3126 - _globals['_IPADDRESS']._serialized_start=3129 - _globals['_IPADDRESS']._serialized_end=3653 - _globals['_DEVICETYPE']._serialized_start=3656 - _globals['_DEVICETYPE']._serialized_end=4019 - _globals['_MANUFACTURER']._serialized_start=4022 - _globals['_MANUFACTURER']._serialized_end=4216 - _globals['_PLATFORM']._serialized_start=4219 - _globals['_PLATFORM']._serialized_end=4469 - _globals['_PREFIX']._serialized_start=4472 - _globals['_PREFIX']._serialized_end=4869 - _globals['_ROLE']._serialized_start=4872 - _globals['_ROLE']._serialized_end=5106 - _globals['_SITE']._serialized_start=5109 - _globals['_SITE']._serialized_end=5527 - _globals['_TAG']._serialized_start=5530 - _globals['_TAG']._serialized_end=5663 - _globals['_ENTITY']._serialized_start=5666 - _globals['_ENTITY']._serialized_end=6207 - _globals['_INGESTREQUEST']._serialized_start=6210 - _globals['_INGESTREQUEST']._serialized_end=6566 - _globals['_INGESTRESPONSE']._serialized_start=6568 - _globals['_INGESTRESPONSE']._serialized_end=6608 - _globals['_INGESTERSERVICE']._serialized_start=6610 - _globals['_INGESTERSERVICE']._serialized_end=6690 + _globals['_CLUSTER']._serialized_start=3129 + _globals['_CLUSTER']._serialized_end=3484 + _globals['_CLUSTERTYPE']._serialized_start=3487 + _globals['_CLUSTERTYPE']._serialized_end=3680 + _globals['_CLUSTERGROUP']._serialized_start=3683 + _globals['_CLUSTERGROUP']._serialized_end=3877 + _globals['_VIRTUALMACHINE']._serialized_start=3880 + _globals['_VIRTUALMACHINE']._serialized_end=4614 + _globals['_VMINTERFACE']._serialized_start=4617 + _globals['_VMINTERFACE']._serialized_end=4979 + _globals['_VIRTUALDISK']._serialized_start=4982 + _globals['_VIRTUALDISK']._serialized_end=5232 + _globals['_IPADDRESS']._serialized_start=5235 + _globals['_IPADDRESS']._serialized_end=5759 + _globals['_DEVICETYPE']._serialized_start=5762 + _globals['_DEVICETYPE']._serialized_end=6125 + _globals['_MANUFACTURER']._serialized_start=6128 + _globals['_MANUFACTURER']._serialized_end=6322 + _globals['_PLATFORM']._serialized_start=6325 + _globals['_PLATFORM']._serialized_end=6575 + _globals['_PREFIX']._serialized_start=6578 + _globals['_PREFIX']._serialized_end=6975 + _globals['_ROLE']._serialized_start=6978 + _globals['_ROLE']._serialized_end=7212 + _globals['_SITE']._serialized_start=7215 + _globals['_SITE']._serialized_end=7633 + _globals['_TAG']._serialized_start=7636 + _globals['_TAG']._serialized_end=7769 + _globals['_ENTITY']._serialized_start=7772 + _globals['_ENTITY']._serialized_end=8671 + _globals['_INGESTREQUEST']._serialized_start=8674 + _globals['_INGESTREQUEST']._serialized_end=9030 + _globals['_INGESTRESPONSE']._serialized_start=9032 + _globals['_INGESTRESPONSE']._serialized_end=9072 + _globals['_INGESTERSERVICE']._serialized_start=9074 + _globals['_INGESTERSERVICE']._serialized_end=9154 # @@protoc_insertion_point(module_scope) diff --git a/netboxlabs/diode/sdk/diode/v1/ingester_pb2.pyi b/netboxlabs/diode/sdk/diode/v1/ingester_pb2.pyi index 689a1a1..3d4ffe0 100644 --- a/netboxlabs/diode/sdk/diode/v1/ingester_pb2.pyi +++ b/netboxlabs/diode/sdk/diode/v1/ingester_pb2.pyi @@ -71,6 +71,114 @@ class Interface(_message.Message): tags: _containers.RepeatedCompositeFieldContainer[Tag] def __init__(self, device: _Optional[_Union[Device, _Mapping]] = ..., name: _Optional[str] = ..., label: _Optional[str] = ..., type: _Optional[str] = ..., enabled: bool = ..., mtu: _Optional[int] = ..., mac_address: _Optional[str] = ..., speed: _Optional[int] = ..., wwn: _Optional[str] = ..., mgmt_only: bool = ..., description: _Optional[str] = ..., mark_connected: bool = ..., mode: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... +class Cluster(_message.Message): + __slots__ = ("name", "type", "group", "site", "status", "description", "tags") + NAME_FIELD_NUMBER: _ClassVar[int] + TYPE_FIELD_NUMBER: _ClassVar[int] + GROUP_FIELD_NUMBER: _ClassVar[int] + SITE_FIELD_NUMBER: _ClassVar[int] + STATUS_FIELD_NUMBER: _ClassVar[int] + DESCRIPTION_FIELD_NUMBER: _ClassVar[int] + TAGS_FIELD_NUMBER: _ClassVar[int] + name: str + type: ClusterType + group: ClusterGroup + site: Site + status: str + description: str + tags: _containers.RepeatedCompositeFieldContainer[Tag] + def __init__(self, name: _Optional[str] = ..., type: _Optional[_Union[ClusterType, _Mapping]] = ..., group: _Optional[_Union[ClusterGroup, _Mapping]] = ..., site: _Optional[_Union[Site, _Mapping]] = ..., status: _Optional[str] = ..., description: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... + +class ClusterType(_message.Message): + __slots__ = ("name", "slug", "description", "tags") + NAME_FIELD_NUMBER: _ClassVar[int] + SLUG_FIELD_NUMBER: _ClassVar[int] + DESCRIPTION_FIELD_NUMBER: _ClassVar[int] + TAGS_FIELD_NUMBER: _ClassVar[int] + name: str + slug: str + description: str + tags: _containers.RepeatedCompositeFieldContainer[Tag] + def __init__(self, name: _Optional[str] = ..., slug: _Optional[str] = ..., description: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... + +class ClusterGroup(_message.Message): + __slots__ = ("name", "slug", "description", "tags") + NAME_FIELD_NUMBER: _ClassVar[int] + SLUG_FIELD_NUMBER: _ClassVar[int] + DESCRIPTION_FIELD_NUMBER: _ClassVar[int] + TAGS_FIELD_NUMBER: _ClassVar[int] + name: str + slug: str + description: str + tags: _containers.RepeatedCompositeFieldContainer[Tag] + def __init__(self, name: _Optional[str] = ..., slug: _Optional[str] = ..., description: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... + +class VirtualMachine(_message.Message): + __slots__ = ("name", "status", "site", "cluster", "role", "device", "platform", "primary_ip4", "primary_ip6", "vcpus", "memory", "disk", "description", "comments", "tags") + NAME_FIELD_NUMBER: _ClassVar[int] + STATUS_FIELD_NUMBER: _ClassVar[int] + SITE_FIELD_NUMBER: _ClassVar[int] + CLUSTER_FIELD_NUMBER: _ClassVar[int] + ROLE_FIELD_NUMBER: _ClassVar[int] + DEVICE_FIELD_NUMBER: _ClassVar[int] + PLATFORM_FIELD_NUMBER: _ClassVar[int] + PRIMARY_IP4_FIELD_NUMBER: _ClassVar[int] + PRIMARY_IP6_FIELD_NUMBER: _ClassVar[int] + VCPUS_FIELD_NUMBER: _ClassVar[int] + MEMORY_FIELD_NUMBER: _ClassVar[int] + DISK_FIELD_NUMBER: _ClassVar[int] + DESCRIPTION_FIELD_NUMBER: _ClassVar[int] + COMMENTS_FIELD_NUMBER: _ClassVar[int] + TAGS_FIELD_NUMBER: _ClassVar[int] + name: str + status: str + site: Site + cluster: Cluster + role: Role + device: Device + platform: Platform + primary_ip4: IPAddress + primary_ip6: IPAddress + vcpus: int + memory: int + disk: int + description: str + comments: str + tags: _containers.RepeatedCompositeFieldContainer[Tag] + def __init__(self, name: _Optional[str] = ..., status: _Optional[str] = ..., site: _Optional[_Union[Site, _Mapping]] = ..., cluster: _Optional[_Union[Cluster, _Mapping]] = ..., role: _Optional[_Union[Role, _Mapping]] = ..., device: _Optional[_Union[Device, _Mapping]] = ..., platform: _Optional[_Union[Platform, _Mapping]] = ..., primary_ip4: _Optional[_Union[IPAddress, _Mapping]] = ..., primary_ip6: _Optional[_Union[IPAddress, _Mapping]] = ..., vcpus: _Optional[int] = ..., memory: _Optional[int] = ..., disk: _Optional[int] = ..., description: _Optional[str] = ..., comments: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... + +class VMInterface(_message.Message): + __slots__ = ("virtual_machine", "name", "enabled", "mtu", "mac_address", "description", "tags") + VIRTUAL_MACHINE_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + ENABLED_FIELD_NUMBER: _ClassVar[int] + MTU_FIELD_NUMBER: _ClassVar[int] + MAC_ADDRESS_FIELD_NUMBER: _ClassVar[int] + DESCRIPTION_FIELD_NUMBER: _ClassVar[int] + TAGS_FIELD_NUMBER: _ClassVar[int] + virtual_machine: VirtualMachine + name: str + enabled: bool + mtu: int + mac_address: str + description: str + tags: _containers.RepeatedCompositeFieldContainer[Tag] + def __init__(self, virtual_machine: _Optional[_Union[VirtualMachine, _Mapping]] = ..., name: _Optional[str] = ..., enabled: bool = ..., mtu: _Optional[int] = ..., mac_address: _Optional[str] = ..., description: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... + +class VirtualDisk(_message.Message): + __slots__ = ("virtual_machine", "name", "size", "description", "tags") + VIRTUAL_MACHINE_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + SIZE_FIELD_NUMBER: _ClassVar[int] + DESCRIPTION_FIELD_NUMBER: _ClassVar[int] + TAGS_FIELD_NUMBER: _ClassVar[int] + virtual_machine: VirtualMachine + name: str + size: int + description: str + tags: _containers.RepeatedCompositeFieldContainer[Tag] + def __init__(self, virtual_machine: _Optional[_Union[VirtualMachine, _Mapping]] = ..., name: _Optional[str] = ..., size: _Optional[int] = ..., description: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... + class IPAddress(_message.Message): __slots__ = ("address", "interface", "status", "role", "dns_name", "description", "comments", "tags") ADDRESS_FIELD_NUMBER: _ClassVar[int] @@ -200,7 +308,7 @@ class Tag(_message.Message): def __init__(self, name: _Optional[str] = ..., slug: _Optional[str] = ..., color: _Optional[str] = ...) -> None: ... class Entity(_message.Message): - __slots__ = ("site", "platform", "manufacturer", "device", "device_role", "device_type", "interface", "ip_address", "prefix", "timestamp") + __slots__ = ("site", "platform", "manufacturer", "device", "device_role", "device_type", "interface", "ip_address", "prefix", "cluster_group", "cluster_type", "cluster", "virtual_machine", "vminterface", "virtual_disk", "timestamp") SITE_FIELD_NUMBER: _ClassVar[int] PLATFORM_FIELD_NUMBER: _ClassVar[int] MANUFACTURER_FIELD_NUMBER: _ClassVar[int] @@ -210,6 +318,12 @@ class Entity(_message.Message): INTERFACE_FIELD_NUMBER: _ClassVar[int] IP_ADDRESS_FIELD_NUMBER: _ClassVar[int] PREFIX_FIELD_NUMBER: _ClassVar[int] + CLUSTER_GROUP_FIELD_NUMBER: _ClassVar[int] + CLUSTER_TYPE_FIELD_NUMBER: _ClassVar[int] + CLUSTER_FIELD_NUMBER: _ClassVar[int] + VIRTUAL_MACHINE_FIELD_NUMBER: _ClassVar[int] + VMINTERFACE_FIELD_NUMBER: _ClassVar[int] + VIRTUAL_DISK_FIELD_NUMBER: _ClassVar[int] TIMESTAMP_FIELD_NUMBER: _ClassVar[int] site: Site platform: Platform @@ -220,8 +334,14 @@ class Entity(_message.Message): interface: Interface ip_address: IPAddress prefix: Prefix + cluster_group: ClusterGroup + cluster_type: ClusterType + cluster: Cluster + virtual_machine: VirtualMachine + vminterface: VMInterface + virtual_disk: VirtualDisk timestamp: _timestamp_pb2.Timestamp - def __init__(self, site: _Optional[_Union[Site, _Mapping]] = ..., platform: _Optional[_Union[Platform, _Mapping]] = ..., manufacturer: _Optional[_Union[Manufacturer, _Mapping]] = ..., device: _Optional[_Union[Device, _Mapping]] = ..., device_role: _Optional[_Union[Role, _Mapping]] = ..., device_type: _Optional[_Union[DeviceType, _Mapping]] = ..., interface: _Optional[_Union[Interface, _Mapping]] = ..., ip_address: _Optional[_Union[IPAddress, _Mapping]] = ..., prefix: _Optional[_Union[Prefix, _Mapping]] = ..., timestamp: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... + def __init__(self, site: _Optional[_Union[Site, _Mapping]] = ..., platform: _Optional[_Union[Platform, _Mapping]] = ..., manufacturer: _Optional[_Union[Manufacturer, _Mapping]] = ..., device: _Optional[_Union[Device, _Mapping]] = ..., device_role: _Optional[_Union[Role, _Mapping]] = ..., device_type: _Optional[_Union[DeviceType, _Mapping]] = ..., interface: _Optional[_Union[Interface, _Mapping]] = ..., ip_address: _Optional[_Union[IPAddress, _Mapping]] = ..., prefix: _Optional[_Union[Prefix, _Mapping]] = ..., cluster_group: _Optional[_Union[ClusterGroup, _Mapping]] = ..., cluster_type: _Optional[_Union[ClusterType, _Mapping]] = ..., cluster: _Optional[_Union[Cluster, _Mapping]] = ..., virtual_machine: _Optional[_Union[VirtualMachine, _Mapping]] = ..., vminterface: _Optional[_Union[VMInterface, _Mapping]] = ..., virtual_disk: _Optional[_Union[VirtualDisk, _Mapping]] = ..., timestamp: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... class IngestRequest(_message.Message): __slots__ = ("stream", "entities", "id", "producer_app_name", "producer_app_version", "sdk_name", "sdk_version") diff --git a/netboxlabs/diode/sdk/ingester.py b/netboxlabs/diode/sdk/ingester.py index 53ab1d4..ad4c90b 100644 --- a/netboxlabs/diode/sdk/ingester.py +++ b/netboxlabs/diode/sdk/ingester.py @@ -7,6 +7,9 @@ # ruff: noqa: I001 from netboxlabs.diode.sdk.diode.v1.ingester_pb2 import ( + Cluster as ClusterPb, + ClusterGroup as ClusterGroupPb, + ClusterType as ClusterTypePb, Device as DevicePb, DeviceType as DeviceTypePb, Entity as EntityPb, @@ -18,6 +21,9 @@ Role as RolePb, Site as SitePb, Tag as TagPb, + VirtualDisk as VirtualDiskPb, + VMInterface as VMInterfacePb, + VirtualMachine as VirtualMachinePb, ) @@ -451,6 +457,210 @@ def __new__( ) +class ClusterGroup: + """ClusterGroup message wrapper.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + description: str | None = None, + tags: list[str | Tag | TagPb] | None = None, + ) -> ClusterGroupPb: + """Create a new cluster group protobuf message.""" + if isinstance(tags, list) and all(isinstance(t, str) for t in tags): + tags = [TagPb(name=tag) for tag in tags] + + return ClusterGroupPb( + name=name, + slug=slug, + description=description, + tags=tags, + ) + + +class ClusterType: + """ClusterType message wrapper.""" + + def __new__( + cls, + name: str | None = None, + slug: str | None = None, + description: str | None = None, + tags: list[str | Tag | TagPb] | None = None, + ) -> ClusterTypePb: + """Create a new cluster type protobuf message.""" + if isinstance(tags, list) and all(isinstance(t, str) for t in tags): + tags = [TagPb(name=tag) for tag in tags] + + return ClusterTypePb( + name=name, + slug=slug, + description=description, + tags=tags, + ) + + +class Cluster: + """Cluster message wrapper.""" + + def __new__( + cls, + name: str | None = None, + group: str | ClusterGroup | ClusterGroupPb | None = None, + type: str | ClusterType | ClusterTypePb | None = None, + site: str | Site | SitePb | None = None, + status: str | None = None, + description: str | None = None, + tags: list[str | Tag | TagPb] | None = None, + ) -> ClusterPb: + """Create a new cluster protobuf message.""" + group = convert_to_protobuf(group, ClusterGroupPb, name=group) + + type = convert_to_protobuf(type, ClusterTypePb, name=type) + + site = convert_to_protobuf(site, SitePb, name=site) + + if isinstance(tags, list) and all(isinstance(t, str) for t in tags): + tags = [TagPb(name=tag) for tag in tags] + + return ClusterPb( + name=name, + group=group, + type=type, + site=site, + status=status, + description=description, + tags=tags, + ) + + +class VirtualMachine: + """VirtualMachine message wrapper.""" + + def __new__( + cls, + name: str | None = None, + status: str | None = None, + site: str | Site | SitePb | None = None, + cluster: str | Cluster | ClusterPb | None = None, + role: str | Role | RolePb | None = None, + device: str | Device | DevicePb | None = None, + platform: str | Platform | PlatformPb | None = None, + primary_ip4: str | IPAddressPb | None = None, + primary_ip6: str | IPAddressPb | None = None, + vcpus: int | None = None, + memory: int | None = None, + disk: int | None = None, + description: str | None = None, + comments: str | None = None, + tags: list[str | Tag | TagPb] | None = None, + ) -> VirtualMachinePb: + """Create a new virtual machine protobuf message.""" + site = convert_to_protobuf(site, SitePb, name=site) + + cluster = convert_to_protobuf(cluster, ClusterPb, name=cluster, site=site) + + if ( + isinstance(cluster, ClusterPb) + and not cluster.HasField("site") + and site is not None + ): + cluster.site.CopyFrom(site) + + role = convert_to_protobuf(role, RolePb, name=role) + + platform = convert_to_protobuf(platform, PlatformPb, name=platform) + + device = convert_to_protobuf( + device, DevicePb, name=device, platform=platform, site=site, role=role + ) + + primary_ip4 = convert_to_protobuf(primary_ip4, IPAddressPb, address=primary_ip4) + primary_ip6 = convert_to_protobuf(primary_ip6, IPAddressPb, address=primary_ip6) + + if isinstance(tags, list) and all(isinstance(t, str) for t in tags): + tags = [TagPb(name=tag) for tag in tags] + + return VirtualMachinePb( + name=name, + status=status, + cluster=cluster, + site=site, + role=role, + device=device, + platform=platform, + primary_ip4=primary_ip4, + primary_ip6=primary_ip6, + vcpus=vcpus, + memory=memory, + disk=disk, + description=description, + comments=comments, + tags=tags, + ) + + +class VirtualDisk: + """VirtualDisk message wrapper.""" + + def __new__( + cls, + name: str | None = None, + virtual_machine: str | VirtualMachine | VirtualMachinePb | None = None, + size: int | None = None, + description: str | None = None, + tags: list[str | Tag | TagPb] | None = None, + ) -> VirtualDiskPb: + """Create a new virtual disk protobuf message.""" + virtual_machine = convert_to_protobuf( + virtual_machine, VirtualMachinePb, name=virtual_machine + ) + + if isinstance(tags, list) and all(isinstance(t, str) for t in tags): + tags = [TagPb(name=tag) for tag in tags] + + return VirtualDiskPb( + name=name, + virtual_machine=virtual_machine, + size=size, + description=description, + tags=tags, + ) + + +class VMInterface: + """VMInterface message wrapper.""" + + def __new__( + cls, + name: str | None = None, + virtual_machine: str | VirtualMachine | VirtualMachinePb | None = None, + enabled: bool | None = None, + mtu: int | None = None, + mac_address: str | None = None, + description: str | None = None, + tags: list[str | Tag | TagPb] | None = None, + ) -> VMInterfacePb: + """Create a new virtual interface protobuf message.""" + virtual_machine = convert_to_protobuf( + virtual_machine, VirtualMachinePb, name=virtual_machine + ) + + if isinstance(tags, list) and all(isinstance(t, str) for t in tags): + tags = [TagPb(name=tag) for tag in tags] + + return VMInterfacePb( + name=name, + virtual_machine=virtual_machine, + enabled=enabled, + mtu=mtu, + mac_address=mac_address, + description=description, + tags=tags, + ) + + class Entity: """Entity message wrapper.""" @@ -465,6 +675,12 @@ def __new__( interface: str | Interface | InterfacePb | None = None, ip_address: str | IPAddress | IPAddressPb | None = None, prefix: str | Prefix | PrefixPb | None = None, + cluster_group: str | ClusterGroup | ClusterGroupPb | None = None, + cluster_type: str | ClusterType | ClusterTypePb | None = None, + cluster: str | Cluster | ClusterPb | None = None, + virtual_disk: str | VirtualDisk | VirtualDiskPb | None = None, + vminterface: str | VMInterface | VMInterfacePb | None = None, + virtual_machine: str | VirtualMachine | VirtualMachinePb | None = None, timestamp: _timestamp_pb2.Timestamp | None = None, ): """Create a new Entity protobuf message.""" @@ -479,6 +695,20 @@ def __new__( ip_address = convert_to_protobuf(ip_address, IPAddressPb, address=ip_address) interface = convert_to_protobuf(interface, InterfacePb, name=interface) prefix = convert_to_protobuf(prefix, PrefixPb, prefix=prefix) + cluster_group = convert_to_protobuf( + cluster_group, ClusterGroupPb, name=cluster_group + ) + cluster_type = convert_to_protobuf( + cluster_type, ClusterTypePb, name=cluster_type + ) + cluster = convert_to_protobuf(cluster, ClusterPb, name=cluster) + virtual_disk = convert_to_protobuf( + virtual_disk, VirtualDiskPb, name=virtual_disk + ) + vminterface = convert_to_protobuf(vminterface, VMInterfacePb, name=vminterface) + virtual_machine = convert_to_protobuf( + virtual_machine, VirtualMachinePb, name=virtual_machine + ) return EntityPb( site=site, @@ -490,5 +720,11 @@ def __new__( interface=interface, ip_address=ip_address, prefix=prefix, + cluster_group=cluster_group, + cluster_type=cluster_type, + cluster=cluster, + virtual_disk=virtual_disk, + vminterface=vminterface, + virtual_machine=virtual_machine, timestamp=timestamp, ) diff --git a/tests/test_ingester.py b/tests/test_ingester.py index 09b0398..e666f50 100644 --- a/tests/test_ingester.py +++ b/tests/test_ingester.py @@ -4,6 +4,9 @@ # ruff: noqa: I001 from netboxlabs.diode.sdk.diode.v1.ingester_pb2 import ( + Cluster as ClusterPb, + ClusterGroup as ClusterGroupPb, + ClusterType as ClusterTypePb, Device as DevicePb, DeviceType as DeviceTypePb, Entity as EntityPb, @@ -15,8 +18,14 @@ Role as RolePb, Site as SitePb, Tag as TagPb, + VirtualDisk as VirtualDiskPb, + VMInterface as VMInterfacePb, + VirtualMachine as VirtualMachinePb, ) from netboxlabs.diode.sdk.ingester import ( + Cluster, + ClusterGroup, + ClusterType, Device, DeviceType, Entity, @@ -28,6 +37,9 @@ Role, Site, Tag, + VirtualDisk, + VMInterface, + VirtualMachine, convert_to_protobuf, ) @@ -471,6 +483,162 @@ def test_prefix_instantiation_with_all_fields(): assert isinstance(tag, TagPb) +def test_cluster_group_instantiation_with_all_fields(): + """Check ClusterGroup instantiation with all fields.""" + cluster_group = ClusterGroup( + name="Group", + slug="group", + description="Cluster group", + tags=["clusters", "grouping"], + ) + assert isinstance(cluster_group, ClusterGroupPb) + assert cluster_group.name == "Group" + assert cluster_group.slug == "group" + assert cluster_group.description == "Cluster group" + assert len(cluster_group.tags) == 2 + for tag in cluster_group.tags: + assert isinstance(tag, TagPb) + + +def test_cluster_type_instantiation_with_all_fields(): + """Check ClusterType instantiation with all fields.""" + cluster_type = ClusterType( + name="VMWare", + slug="vmware", + description="Cluster type for virtual machine", + tags=["clusters", "types"], + ) + assert isinstance(cluster_type, ClusterTypePb) + assert cluster_type.name == "VMWare" + assert cluster_type.slug == "vmware" + assert cluster_type.description == "Cluster type for virtual machine" + assert len(cluster_type.tags) == 2 + for tag in cluster_type.tags: + assert isinstance(tag, TagPb) + + +def test_cluster_instantiation_with_all_fields(): + """Check Cluster instantiation with all fields.""" + cluster = Cluster( + name="gc-us-east1", + status="active", + group=ClusterGroup(name="North America"), + type="Google Cloud", + site="Site1", + description="Cluster on gc us east", + tags=["us", "gc"], + ) + assert isinstance(cluster, ClusterPb) + assert isinstance(cluster.group, ClusterGroupPb) + assert isinstance(cluster.type, ClusterTypePb) + assert isinstance(cluster.site, SitePb) + assert cluster.name == "gc-us-east1" + assert cluster.status == "active" + assert cluster.site.name == "Site1" + assert cluster.description == "Cluster on gc us east" + assert len(cluster.tags) == 2 + for tag in cluster.tags: + assert isinstance(tag, TagPb) + + +def test_virtual_machine_instantiation_with_all_fields(): + """Check VirtualMachine instantiation with all fields.""" + virtual_machine = VirtualMachine( + name="vm1", + status="active", + cluster="gc-us-east1", + site="Site1", + role="admin", + device="dev01", + platform="Platform1", + vcpus=12, + memory=16572, + disk=1225798, + primary_ip4="192.168.0.1", + primary_ip6="2001:db8::1", + description="VM on google cloud", + tags=["vm", "gc"], + ) + assert isinstance(virtual_machine, VirtualMachinePb) + assert isinstance(virtual_machine.cluster, ClusterPb) + assert isinstance(virtual_machine.site, SitePb) + assert isinstance(virtual_machine.role, RolePb) + assert isinstance(virtual_machine.device, DevicePb) + assert isinstance(virtual_machine.platform, PlatformPb) + assert isinstance(virtual_machine.primary_ip4, IPAddressPb) + assert isinstance(virtual_machine.primary_ip6, IPAddressPb) + assert virtual_machine.name == "vm1" + assert virtual_machine.status == "active" + assert virtual_machine.site.name == "Site1" + assert virtual_machine.device.site.name == "Site1" + assert virtual_machine.memory == 16572 + assert virtual_machine.description == "VM on google cloud" + assert len(virtual_machine.tags) == 2 + for tag in virtual_machine.tags: + assert isinstance(tag, TagPb) + + +def test_virtual_machine_instantiation_with_cluster_without_site(): + """Check VirtualMachine instantiation with cluster without explicit site.""" + virtual_machine = VirtualMachine( + name="vm1", + status="active", + cluster=Cluster(name="gc-us-east1"), + site=Site(name="Site1"), + description="VM on google cloud", + ) + assert isinstance(virtual_machine, VirtualMachinePb) + assert isinstance(virtual_machine.cluster, ClusterPb) + assert isinstance(virtual_machine.site, SitePb) + assert isinstance(virtual_machine.role, RolePb) + assert virtual_machine.name == "vm1" + assert virtual_machine.status == "active" + assert virtual_machine.site.name == "Site1" + assert virtual_machine.cluster.site.name == "Site1" + + +def test_virtual_disk_instantiation_with_all_fields(): + """Check VirtualDisk instantiation with all fields.""" + virtual_disk = VirtualDisk( + name="Disk", + virtual_machine="vm1", + size=16512, + description="Virtual disk", + tags=["vm", "disk"], + ) + assert isinstance(virtual_disk, VirtualDiskPb) + assert isinstance(virtual_disk.virtual_machine, VirtualMachinePb) + assert virtual_disk.name == "Disk" + assert virtual_disk.virtual_machine.name == "vm1" + assert virtual_disk.description == "Virtual disk" + assert len(virtual_disk.tags) == 2 + for tag in virtual_disk.tags: + assert isinstance(tag, TagPb) + + +def test_vminterface_instantiation_with_all_fields(): + """Check VMInterface instantiation with all fields.""" + vminterface = VMInterface( + name="eth01", + virtual_machine="vm1", + enabled=True, + mtu=1500, + mac_address="00:00:00:00:00:00", + description="Virtual interface", + tags=["vm", "ifce"], + ) + assert isinstance(vminterface, VMInterfacePb) + assert isinstance(vminterface.virtual_machine, VirtualMachinePb) + assert vminterface.name == "eth01" + assert vminterface.virtual_machine.name == "vm1" + assert vminterface.mtu == 1500 + assert vminterface.mac_address == "00:00:00:00:00:00" + assert vminterface.description == "Virtual interface" + assert len(vminterface.tags) == 2 + for tag in vminterface.tags: + assert isinstance(tag, TagPb) + + def test_site_instantiation_with_all_fields(): """Check Site instantiation with all fields.""" site = Site( @@ -578,3 +746,63 @@ def test_entity_instantiation_with_prefix(): assert isinstance(entity, EntityPb) assert isinstance(entity.prefix, PrefixPb) assert entity.prefix.prefix == "192.168.0.0/24" + + +def test_entity_instantiation_with_cluster_group(): + """Check Entity instantiation with cluster group.""" + entity = Entity( + cluster_group="ClusterGroup1", + ) + assert isinstance(entity, EntityPb) + assert isinstance(entity.cluster_group, ClusterGroupPb) + assert entity.cluster_group.name == "ClusterGroup1" + + +def test_entity_instantiation_with_cluster_type(): + """Check Entity instantiation with cluster type.""" + entity = Entity( + cluster_type="ClusterType1", + ) + assert isinstance(entity, EntityPb) + assert isinstance(entity.cluster_type, ClusterTypePb) + assert entity.cluster_type.name == "ClusterType1" + + +def test_entity_instantiation_with_cluster(): + """Check Entity instantiation with cluster.""" + entity = Entity( + cluster="Cluster1", + ) + assert isinstance(entity, EntityPb) + assert isinstance(entity.cluster, ClusterPb) + assert entity.cluster.name == "Cluster1" + + +def test_entity_instantiation_with_virtual_machine(): + """Check Entity instantiation with virtual machine.""" + entity = Entity( + virtual_machine="VM1", + ) + assert isinstance(entity, EntityPb) + assert isinstance(entity.virtual_machine, VirtualMachinePb) + assert entity.virtual_machine.name == "VM1" + + +def test_entity_instantiation_with_virtual_disk(): + """Check Entity instantiation with virtual disk.""" + entity = Entity( + virtual_disk="VirtualDisk1", + ) + assert isinstance(entity, EntityPb) + assert isinstance(entity.virtual_disk, VirtualDiskPb) + assert entity.virtual_disk.name == "VirtualDisk1" + + +def test_entity_instantiation_with_vminterface(): + """Check Entity instantiation with virtual interface.""" + entity = Entity( + vminterface="VMInterface1", + ) + assert isinstance(entity, EntityPb) + assert isinstance(entity.vminterface, VMInterfacePb) + assert entity.vminterface.name == "VMInterface1"