From 5ec5dc9242e7321459714c1585c00443898069ab Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Thu, 6 Feb 2025 20:42:59 +0100 Subject: [PATCH 1/4] chore: remove reconciler sdk Signed-off-by: Michal Fiedorowicz --- Makefile | 2 +- netbox_diode_plugin/reconciler/__init__.py | 3 - .../reconciler/sdk/__init__.py | 3 - netbox_diode_plugin/reconciler/sdk/client.py | 256 --------- .../reconciler/sdk/exceptions.py | 33 -- .../reconciler/sdk/v1/__init__.py | 3 - .../reconciler/sdk/v1/ingester_pb2.py | 217 -------- .../reconciler/sdk/v1/ingester_pb2.pyi | 368 ------------- .../reconciler/sdk/v1/ingester_pb2_grpc.py | 70 --- .../reconciler/sdk/v1/reconciler_pb2.py | 67 --- .../reconciler/sdk/v1/reconciler_pb2.pyi | 234 --------- .../reconciler/sdk/v1/reconciler_pb2_grpc.py | 138 ----- .../reconciler/sdk/validate/__init__.py | 3 - .../reconciler/sdk/validate/validate_pb2.py | 76 --- .../reconciler/sdk/validate/validate_pb2.pyi | 494 ------------------ .../sdk/validate/validate_pb2_grpc.py | 4 - netbox_diode_plugin/templatetags/__init__.py | 3 - 17 files changed, 1 insertion(+), 1973 deletions(-) delete mode 100644 netbox_diode_plugin/reconciler/__init__.py delete mode 100644 netbox_diode_plugin/reconciler/sdk/__init__.py delete mode 100644 netbox_diode_plugin/reconciler/sdk/client.py delete mode 100644 netbox_diode_plugin/reconciler/sdk/exceptions.py delete mode 100644 netbox_diode_plugin/reconciler/sdk/v1/__init__.py delete mode 100644 netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2.py delete mode 100644 netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2.pyi delete mode 100644 netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2_grpc.py delete mode 100644 netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2.py delete mode 100644 netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2.pyi delete mode 100644 netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2_grpc.py delete mode 100644 netbox_diode_plugin/reconciler/sdk/validate/__init__.py delete mode 100644 netbox_diode_plugin/reconciler/sdk/validate/validate_pb2.py delete mode 100644 netbox_diode_plugin/reconciler/sdk/validate/validate_pb2.pyi delete mode 100644 netbox_diode_plugin/reconciler/sdk/validate/validate_pb2_grpc.py delete mode 100644 netbox_diode_plugin/templatetags/__init__.py diff --git a/Makefile b/Makefile index 2587f4e..6145666 100644 --- a/Makefile +++ b/Makefile @@ -19,5 +19,5 @@ docker-compose-netbox-plugin-test: .PHONY: docker-compose-netbox-plugin-test-cover docker-compose-netbox-plugin-test-cover: - -@$(DOCKER_COMPOSE) -f docker/docker-compose.yaml -f docker/docker-compose.test.yaml run --rm -u root -e COVERAGE_FILE=/opt/netbox/netbox/coverage/.coverage netbox sh -c "coverage run --source=netbox_diode_plugin --omit=*_pb2*,*/migrations/* ./manage.py test --keepdb netbox_diode_plugin && coverage xml -o /opt/netbox/netbox/coverage/report.xml && coverage report -m | tee /opt/netbox/netbox/coverage/report.txt" + -@$(DOCKER_COMPOSE) -f docker/docker-compose.yaml -f docker/docker-compose.test.yaml run --rm -u root -e COVERAGE_FILE=/opt/netbox/netbox/coverage/.coverage netbox sh -c "coverage run --source=netbox_diode_plugin --omit=*/migrations/* ./manage.py test --keepdb netbox_diode_plugin && coverage xml -o /opt/netbox/netbox/coverage/report.xml && coverage report -m | tee /opt/netbox/netbox/coverage/report.txt" @$(MAKE) docker-compose-netbox-plugin-down diff --git a/netbox_diode_plugin/reconciler/__init__.py b/netbox_diode_plugin/reconciler/__init__.py deleted file mode 100644 index 96bc1bd..0000000 --- a/netbox_diode_plugin/reconciler/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""Diode NetBox Plugin - Reconciler.""" diff --git a/netbox_diode_plugin/reconciler/sdk/__init__.py b/netbox_diode_plugin/reconciler/sdk/__init__.py deleted file mode 100644 index 8945f40..0000000 --- a/netbox_diode_plugin/reconciler/sdk/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""Diode NetBox Plugin - Reconciler - SDK.""" diff --git a/netbox_diode_plugin/reconciler/sdk/client.py b/netbox_diode_plugin/reconciler/sdk/client.py deleted file mode 100644 index 3273618..0000000 --- a/netbox_diode_plugin/reconciler/sdk/client.py +++ /dev/null @@ -1,256 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""Diode NetBox Plugin - Reconciler - SDK - Client.""" - -import collections -import logging -import platform -from urllib.parse import urlparse - -import certifi -import grpc - -import netbox_diode_plugin -from netbox_diode_plugin.reconciler.sdk.exceptions import ReconcilerClientError -from netbox_diode_plugin.reconciler.sdk.v1 import reconciler_pb2, reconciler_pb2_grpc - -_LOGGER = logging.getLogger(__name__) - - -def _load_certs() -> bytes: - """Loads cacert.pem.""" - with open(certifi.where(), "rb") as f: - return f.read() - - -def parse_target(target: str) -> tuple[str, str, bool]: - """Parse the target into authority, path and tls_verify.""" - parsed_target = urlparse(target) - - if parsed_target.scheme not in ["grpc", "grpcs"]: - raise ValueError("target should start with grpc:// or grpcs://") - - tls_verify = parsed_target.scheme == "grpcs" - - authority = parsed_target.netloc - - if ":" not in authority: - authority += ":443" - - return authority, parsed_target.path, tls_verify - - -class ReconcilerClient: - """Reconciler Client.""" - - _name = "reconciler-sdk-python" - _version = "0.0.1" - _channel = None - _stub = None - - def __init__( - self, - target: str, - api_key: str, - ): - """Initiate a new client.""" - self._target, self._path, self._tls_verify = parse_target(target) - - plugin_config = netbox_diode_plugin.config - - self._app_name = plugin_config.name - self._app_version = plugin_config.version - self._platform = platform.platform() - self._python_version = platform.python_version() - - self._metadata = ( - ("authorization", api_key), - ("platform", self._platform), - ("python-version", self._python_version), - ) - - channel_opts = ( - ("grpc.primary_user_agent", f"{self._name}/{self._version} {self._app_name}/{self._app_version}"), - ) - - if self._tls_verify: - _LOGGER.debug("Setting up gRPC secure channel") - self._channel = grpc.secure_channel( - self._target, - grpc.ssl_channel_credentials( - root_certificates=_load_certs(), - ), - options=channel_opts, - ) - else: - _LOGGER.debug("Setting up gRPC insecure channel") - self._channel = grpc.insecure_channel( - target=self._target, - options=channel_opts, - ) - - channel = self._channel - - if self._path: - _LOGGER.debug(f"Setting up gRPC interceptor for path: {self._path}") - rpc_method_interceptor = ReconcilerMethodClientInterceptor(subpath=self._path) - - intercept_channel = grpc.intercept_channel( - self._channel, rpc_method_interceptor - ) - channel = intercept_channel - - self._stub = reconciler_pb2_grpc.ReconcilerServiceStub(channel) - - - @property - def name(self) -> str: - """Retrieve the name.""" - return self._name - - @property - def version(self) -> str: - """Retrieve the version.""" - return self._version - - @property - def target(self) -> str: - """Retrieve the target.""" - return self._target - - @property - def path(self) -> str: - """Retrieve the path.""" - return self._path - - @property - def tls_verify(self) -> bool: - """Retrieve the tls_verify.""" - return self._tls_verify - - @property - def app_name(self) -> str: - """Retrieve the app name.""" - return self._app_name - - @property - def app_version(self) -> str: - """Retrieve the app version.""" - return self._app_version - - @property - def channel(self) -> grpc.Channel: - """Retrieve the channel.""" - return self._channel - - def __enter__(self): - """Enters the runtime context related to the channel object.""" - return self - - def __exit__(self, exc_type, exc_value, exc_traceback): - """Exits the runtime context related to the channel object.""" - self.close() - - def close(self): - """Close the channel.""" - self._channel.close() - - def retrieve_ingestion_logs( - self, - state: str | None = None, - data_type: str | None = None, - request_id: str | None = None, - ingestion_ts_start: int | None = None, - ingestion_ts_end: int | None = None, - page_token: str | None = None, - page_size: int = 100, - only_metrics: bool = False, - ) -> reconciler_pb2.RetrieveIngestionLogsResponse: - """Retrieve ingestion logs.""" - try: - request = reconciler_pb2.RetrieveIngestionLogsRequest( - page_size=page_size, - state=state, - data_type=data_type, - request_id=request_id, - ingestion_ts_start=ingestion_ts_start, - ingestion_ts_end=ingestion_ts_end, - page_token=page_token, - only_metrics=only_metrics, - ) - - return self._stub.RetrieveIngestionLogs(request, metadata=self._metadata) - except grpc.RpcError as err: - raise ReconcilerClientError(err) from err - - -class _ClientCallDetails( - collections.namedtuple( - "_ClientCallDetails", - ( - "method", - "timeout", - "metadata", - "credentials", - "wait_for_ready", - "compression", - ), - ), - grpc.ClientCallDetails, -): - """ - _ClientCallDetails class. - - This class describes an RPC to be invoked and is required for custom gRPC interceptors. - - """ - - pass - - -class ReconcilerMethodClientInterceptor( - grpc.UnaryUnaryClientInterceptor, grpc.StreamUnaryClientInterceptor -): - """ - Reconciler Method Client Interceptor class. - - This class is used to intercept the client calls and modify the method details. It inherits from - grpc.UnaryUnaryClientInterceptor and grpc.StreamUnaryClientInterceptor. - - Reconciler's default method generated from Protocol Buffers definition is /diode.v1.ReconcilerService/RetrieveIngestionLogs and in order - to use Diode targets with path (i.e. localhost:8081/this/is/custom/path), this interceptor is used to modify the - method details, by prepending the generated method name with the path extracted from initial target. - - """ - - def __init__(self, subpath): - """Initiate a new interceptor.""" - self._subpath = subpath - - def _intercept_call(self, continuation, client_call_details, request_or_iterator): - """Intercept call.""" - method = client_call_details.method - if client_call_details.method is not None: - method = f"{self._subpath}{client_call_details.method}" - - client_call_details = _ClientCallDetails( - method, - client_call_details.timeout, - client_call_details.metadata, - client_call_details.credentials, - client_call_details.wait_for_ready, - client_call_details.compression, - ) - - response = continuation(client_call_details, request_or_iterator) - return response - - def intercept_unary_unary(self, continuation, client_call_details, request): - """Intercept unary unary.""" - return self._intercept_call(continuation, client_call_details, request) - - def intercept_stream_unary( - self, continuation, client_call_details, request_iterator - ): - """Intercept stream unary.""" - return self._intercept_call(continuation, client_call_details, request_iterator) diff --git a/netbox_diode_plugin/reconciler/sdk/exceptions.py b/netbox_diode_plugin/reconciler/sdk/exceptions.py deleted file mode 100644 index 18a25b6..0000000 --- a/netbox_diode_plugin/reconciler/sdk/exceptions.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""Diode NetBox Plugin - Reconciler - SDK - Exceptions.""" - -from grpc import RpcError, StatusCode - - -class ReconcilerClientError(RpcError): - """Reconciler Client Error.""" - - _status_code = None - _details = None - - def __init__(self, err: RpcError): - """Initialize ReconcilerClientError.""" - self._status_code = err.code() - self._details = err.details() - - @property - def status_code(self): - """Return status code.""" - if isinstance(self._status_code, StatusCode): - return self._status_code.name - return self._status_code - - @property - def details(self): - """Return error details.""" - return self._details - - def __repr__(self): - """Return string representation.""" - return f"" diff --git a/netbox_diode_plugin/reconciler/sdk/v1/__init__.py b/netbox_diode_plugin/reconciler/sdk/v1/__init__.py deleted file mode 100644 index 0a4a1e8..0000000 --- a/netbox_diode_plugin/reconciler/sdk/v1/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""Diode NetBox Plugin - Reconciler - SDK - V1.""" diff --git a/netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2.py b/netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2.py deleted file mode 100644 index 68e4bb0..0000000 --- a/netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2.py +++ /dev/null @@ -1,217 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: diode/v1/ingester.proto -# Protobuf Python Version: 5.26.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from netbox_diode_plugin.reconciler.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\"\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) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'diode.v1.ingester_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'Z3github.com/netboxlabs/diode-sdk-go/diode/v1/diodepb' - _globals['_DEVICE'].fields_by_name['name']._loaded_options = None - _globals['_DEVICE'].fields_by_name['name']._serialized_options = b'\372B\004r\002\030@' - _globals['_DEVICE'].fields_by_name['device_fqdn']._loaded_options = None - _globals['_DEVICE'].fields_by_name['device_fqdn']._serialized_options = b'\372B\007r\005\020\001\030\377\001' - _globals['_DEVICE'].fields_by_name['serial']._loaded_options = None - _globals['_DEVICE'].fields_by_name['serial']._serialized_options = b'\372B\004r\002\0302' - _globals['_DEVICE'].fields_by_name['asset_tag']._loaded_options = None - _globals['_DEVICE'].fields_by_name['asset_tag']._serialized_options = b'\372B\005r\003\030\310\001' - _globals['_DEVICE'].fields_by_name['status']._loaded_options = None - _globals['_DEVICE'].fields_by_name['status']._serialized_options = b'\372BHrFR\007offlineR\006activeR\007plannedR\006stagedR\006failedR\tinventoryR\017decommissioning' - _globals['_DEVICE'].fields_by_name['description']._loaded_options = None - _globals['_DEVICE'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' - _globals['_INTERFACE'].fields_by_name['device']._loaded_options = None - _globals['_INTERFACE'].fields_by_name['device']._serialized_options = b'\372B\005\242\001\002\010\001' - _globals['_INTERFACE'].fields_by_name['name']._loaded_options = None - _globals['_INTERFACE'].fields_by_name['name']._serialized_options = b'\372B\006r\004\020\001\030@' - _globals['_INTERFACE'].fields_by_name['label']._loaded_options = None - _globals['_INTERFACE'].fields_by_name['label']._serialized_options = b'\372B\006r\004\020\001\030@' - _globals['_INTERFACE'].fields_by_name['type']._loaded_options = None - _globals['_INTERFACE'].fields_by_name['type']._serialized_options = b'\372B\341\014r\336\014R\007virtualR\006bridgeR\003lagR\n100base-fxR\013100base-lfxR\n100base-txR\n100base-t1R\n1000base-tR\0171000base-x-gbicR\0161000base-x-sfpR\n2.5gbase-tR\0105gbase-tR\t10gbase-tR\01310gbase-cx4R\01610gbase-x-sfppR\r10gbase-x-xfpR\02010gbase-x-xenpakR\01410gbase-x-x2R\01725gbase-x-sfp28R\01750gbase-x-sfp56R\01740gbase-x-qsfppR\01750gbase-x-sfp28R\016100gbase-x-cfpR\017100gbase-x-cfp2R\017100gbase-x-cfp4R\016100gbase-x-cxpR\017100gbase-x-cpakR\017100gbase-x-dsfpR\020100gbase-x-sfpddR\021100gbase-x-qsfp28R\021100gbase-x-qsfpddR\017200gbase-x-cfp2R\021200gbase-x-qsfp56R\021200gbase-x-qsfpddR\017400gbase-x-cfp2R\022400gbase-x-qsfp112R\021400gbase-x-qsfpddR\017400gbase-x-osfpR\023400gbase-x-osfp-rhsR\017400gbase-x-cdfpR\017400gbase-x-cfp8R\021800gbase-x-qsfpddR\017800gbase-x-osfpR\0131000base-kxR\n10gbase-krR\01310gbase-kx4R\n25gbase-krR\01340gbase-kr4R\n50gbase-krR\014100gbase-kp4R\014100gbase-kr2R\014100gbase-kr4R\013ieee802.11aR\013ieee802.11gR\013ieee802.11nR\014ieee802.11acR\014ieee802.11adR\014ieee802.11axR\014ieee802.11ayR\014ieee802.15.1R\016other-wirelessR\003gsmR\004cdmaR\003lteR\tsonet-oc3R\nsonet-oc12R\nsonet-oc48R\013sonet-oc192R\013sonet-oc768R\014sonet-oc1920R\014sonet-oc3840R\0101gfc-sfpR\0102gfc-sfpR\0104gfc-sfpR\t8gfc-sfppR\n16gfc-sfppR\01332gfc-sfp28R\01364gfc-qsfppR\r128gfc-qsfp28R\016infiniband-sdrR\016infiniband-ddrR\016infiniband-qdrR\020infiniband-fdr10R\016infiniband-fdrR\016infiniband-edrR\016infiniband-hdrR\016infiniband-ndrR\016infiniband-xdrR\002t1R\002e1R\002t3R\002e3R\004xdslR\006docsisR\004gponR\006xg-ponR\007xgs-ponR\007ng-pon2R\004eponR\01010g-eponR\017cisco-stackwiseR\024cisco-stackwise-plusR\017cisco-flexstackR\024cisco-flexstack-plusR\022cisco-stackwise-80R\023cisco-stackwise-160R\023cisco-stackwise-320R\023cisco-stackwise-480R\022cisco-stackwise-1tR\013juniper-vcpR\023extreme-summitstackR\027extreme-summitstack-128R\027extreme-summitstack-256R\027extreme-summitstack-512R\005other' - _globals['_INTERFACE'].fields_by_name['mtu']._loaded_options = None - _globals['_INTERFACE'].fields_by_name['mtu']._serialized_options = b'\372B\010\032\006\030\200\200\004(\001' - _globals['_INTERFACE'].fields_by_name['speed']._loaded_options = None - _globals['_INTERFACE'].fields_by_name['speed']._serialized_options = b'\372B\004\032\002(\000' - _globals['_INTERFACE'].fields_by_name['description']._loaded_options = None - _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 - _globals['_IPADDRESS'].fields_by_name['status']._serialized_options = b'\372B-r+R\006activeR\010reservedR\ndeprecatedR\004dhcpR\005slaac' - _globals['_IPADDRESS'].fields_by_name['role']._loaded_options = None - _globals['_IPADDRESS'].fields_by_name['role']._serialized_options = b'\372B=r;R\010loopbackR\tsecondaryR\007anycastR\003vipR\004vrrpR\004hsrpR\004glbpR\004carp' - _globals['_IPADDRESS'].fields_by_name['dns_name']._loaded_options = None - _globals['_IPADDRESS'].fields_by_name['dns_name']._serialized_options = b'\372B2r0\030\377\0012+^([0-9A-Za-z_-]+|\\*)(\\.[0-9A-Za-z_-]+)*\\.?$' - _globals['_IPADDRESS'].fields_by_name['description']._loaded_options = None - _globals['_IPADDRESS'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' - _globals['_DEVICETYPE'].fields_by_name['model']._loaded_options = None - _globals['_DEVICETYPE'].fields_by_name['model']._serialized_options = b'\372B\006r\004\020\001\030d' - _globals['_DEVICETYPE'].fields_by_name['slug']._loaded_options = None - _globals['_DEVICETYPE'].fields_by_name['slug']._serialized_options = b'\372B\030r\026\020\001\030d2\020^[-a-zA-Z0-9_]+$' - _globals['_DEVICETYPE'].fields_by_name['description']._loaded_options = None - _globals['_DEVICETYPE'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' - _globals['_DEVICETYPE'].fields_by_name['part_number']._loaded_options = None - _globals['_DEVICETYPE'].fields_by_name['part_number']._serialized_options = b'\372B\004r\002\0302' - _globals['_MANUFACTURER'].fields_by_name['name']._loaded_options = None - _globals['_MANUFACTURER'].fields_by_name['name']._serialized_options = b'\372B\006r\004\020\001\030d' - _globals['_MANUFACTURER'].fields_by_name['slug']._loaded_options = None - _globals['_MANUFACTURER'].fields_by_name['slug']._serialized_options = b'\372B\030r\026\020\001\030d2\020^[-a-zA-Z0-9_]+$' - _globals['_MANUFACTURER'].fields_by_name['description']._loaded_options = None - _globals['_MANUFACTURER'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' - _globals['_PLATFORM'].fields_by_name['name']._loaded_options = None - _globals['_PLATFORM'].fields_by_name['name']._serialized_options = b'\372B\006r\004\020\001\030d' - _globals['_PLATFORM'].fields_by_name['slug']._loaded_options = None - _globals['_PLATFORM'].fields_by_name['slug']._serialized_options = b'\372B\030r\026\020\001\030d2\020^[-a-zA-Z0-9_]+$' - _globals['_PLATFORM'].fields_by_name['description']._loaded_options = None - _globals['_PLATFORM'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' - _globals['_PREFIX'].fields_by_name['prefix']._loaded_options = None - _globals['_PREFIX'].fields_by_name['prefix']._serialized_options = b'\372B\004r\002p\001' - _globals['_PREFIX'].fields_by_name['status']._loaded_options = None - _globals['_PREFIX'].fields_by_name['status']._serialized_options = b'\372B+r)R\006activeR\tcontainerR\010reservedR\ndeprecated' - _globals['_PREFIX'].fields_by_name['description']._loaded_options = None - _globals['_PREFIX'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' - _globals['_ROLE'].fields_by_name['name']._loaded_options = None - _globals['_ROLE'].fields_by_name['name']._serialized_options = b'\372B\006r\004\020\001\030d' - _globals['_ROLE'].fields_by_name['slug']._loaded_options = None - _globals['_ROLE'].fields_by_name['slug']._serialized_options = b'\372B\030r\026\020\001\030d2\020^[-a-zA-Z0-9_]+$' - _globals['_ROLE'].fields_by_name['color']._loaded_options = None - _globals['_ROLE'].fields_by_name['color']._serialized_options = b'\372B\025r\023\020\006\030\0062\r^[0-9a-f]{6}$' - _globals['_ROLE'].fields_by_name['description']._loaded_options = None - _globals['_ROLE'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' - _globals['_SITE'].fields_by_name['name']._loaded_options = None - _globals['_SITE'].fields_by_name['name']._serialized_options = b'\372B\006r\004\020\001\030d' - _globals['_SITE'].fields_by_name['slug']._loaded_options = None - _globals['_SITE'].fields_by_name['slug']._serialized_options = b'\372B\030r\026\020\001\030d2\020^[-a-zA-Z0-9_]+$' - _globals['_SITE'].fields_by_name['status']._loaded_options = None - _globals['_SITE'].fields_by_name['status']._serialized_options = b'\372B6r4R\007plannedR\007stagingR\006activeR\017decommissioningR\007retired' - _globals['_SITE'].fields_by_name['facility']._loaded_options = None - _globals['_SITE'].fields_by_name['facility']._serialized_options = b'\372B\004r\002\0302' - _globals['_SITE'].fields_by_name['description']._loaded_options = None - _globals['_SITE'].fields_by_name['description']._serialized_options = b'\372B\005r\003\030\310\001' - _globals['_TAG'].fields_by_name['name']._loaded_options = None - _globals['_TAG'].fields_by_name['name']._serialized_options = b'\372B\006r\004\020\001\030d' - _globals['_TAG'].fields_by_name['slug']._loaded_options = None - _globals['_TAG'].fields_by_name['slug']._serialized_options = b'\372B\030r\026\020\001\030d2\020^[-a-zA-Z0-9_]+$' - _globals['_TAG'].fields_by_name['color']._loaded_options = None - _globals['_TAG'].fields_by_name['color']._serialized_options = b'\372B\025r\023\020\006\030\0062\r^[0-9a-f]{6}$' - _globals['_ENTITY'].fields_by_name['timestamp']._loaded_options = None - _globals['_ENTITY'].fields_by_name['timestamp']._serialized_options = b'\372B\007\262\001\004\010\0018\001' - _globals['_INGESTREQUEST'].fields_by_name['stream']._loaded_options = None - _globals['_INGESTREQUEST'].fields_by_name['stream']._serialized_options = b'\372B\007r\005\020\001\030\377\001' - _globals['_INGESTREQUEST'].fields_by_name['entities']._loaded_options = None - _globals['_INGESTREQUEST'].fields_by_name['entities']._serialized_options = b'\372B\010\222\001\005\010\001\020\350\007' - _globals['_INGESTREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_INGESTREQUEST'].fields_by_name['id']._serialized_options = b'\372B\005r\003\260\001\001' - _globals['_INGESTREQUEST'].fields_by_name['producer_app_name']._loaded_options = None - _globals['_INGESTREQUEST'].fields_by_name['producer_app_name']._serialized_options = b'\372B\007r\005\020\001\030\377\001' - _globals['_INGESTREQUEST'].fields_by_name['producer_app_version']._loaded_options = None - _globals['_INGESTREQUEST'].fields_by_name['producer_app_version']._serialized_options = b'\372B\007r\005\020\001\030\377\001' - _globals['_INGESTREQUEST'].fields_by_name['sdk_name']._loaded_options = None - _globals['_INGESTREQUEST'].fields_by_name['sdk_name']._serialized_options = b'\372B\007r\005\020\001\030\377\001' - _globals['_INGESTREQUEST'].fields_by_name['sdk_version']._loaded_options = None - _globals['_INGESTREQUEST'].fields_by_name['sdk_version']._serialized_options = b'\372B\031r\0272\025^(\\d)+\\.(\\d)+\\.(\\d)+$' - _globals['_DEVICE']._serialized_start=96 - _globals['_DEVICE']._serialized_end=836 - _globals['_INTERFACE']._serialized_start=839 - _globals['_INTERFACE']._serialized_end=3126 - _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/netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2.pyi b/netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2.pyi deleted file mode 100644 index b9d44fe..0000000 --- a/netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2.pyi +++ /dev/null @@ -1,368 +0,0 @@ -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from netbox_diode_plugin.reconciler.sdk.validate import validate_pb2 as _validate_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class Device(_message.Message): - __slots__ = ("name", "device_fqdn", "device_type", "role", "platform", "serial", "site", "asset_tag", "status", "description", "comments", "tags", "primary_ip4", "primary_ip6") - NAME_FIELD_NUMBER: _ClassVar[int] - DEVICE_FQDN_FIELD_NUMBER: _ClassVar[int] - DEVICE_TYPE_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - PLATFORM_FIELD_NUMBER: _ClassVar[int] - SERIAL_FIELD_NUMBER: _ClassVar[int] - SITE_FIELD_NUMBER: _ClassVar[int] - ASSET_TAG_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - COMMENTS_FIELD_NUMBER: _ClassVar[int] - TAGS_FIELD_NUMBER: _ClassVar[int] - PRIMARY_IP4_FIELD_NUMBER: _ClassVar[int] - PRIMARY_IP6_FIELD_NUMBER: _ClassVar[int] - name: str - device_fqdn: str - device_type: DeviceType - role: Role - platform: Platform - serial: str - site: Site - asset_tag: str - status: str - description: str - comments: str - tags: _containers.RepeatedCompositeFieldContainer[Tag] - primary_ip4: IPAddress - primary_ip6: IPAddress - def __init__(self, name: _Optional[str] = ..., device_fqdn: _Optional[str] = ..., device_type: _Optional[_Union[DeviceType, _Mapping]] = ..., role: _Optional[_Union[Role, _Mapping]] = ..., platform: _Optional[_Union[Platform, _Mapping]] = ..., serial: _Optional[str] = ..., site: _Optional[_Union[Site, _Mapping]] = ..., asset_tag: _Optional[str] = ..., status: _Optional[str] = ..., description: _Optional[str] = ..., comments: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ..., primary_ip4: _Optional[_Union[IPAddress, _Mapping]] = ..., primary_ip6: _Optional[_Union[IPAddress, _Mapping]] = ...) -> None: ... - -class Interface(_message.Message): - __slots__ = ("device", "name", "label", "type", "enabled", "mtu", "mac_address", "speed", "wwn", "mgmt_only", "description", "mark_connected", "mode", "tags") - DEVICE_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - LABEL_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - ENABLED_FIELD_NUMBER: _ClassVar[int] - MTU_FIELD_NUMBER: _ClassVar[int] - MAC_ADDRESS_FIELD_NUMBER: _ClassVar[int] - SPEED_FIELD_NUMBER: _ClassVar[int] - WWN_FIELD_NUMBER: _ClassVar[int] - MGMT_ONLY_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - MARK_CONNECTED_FIELD_NUMBER: _ClassVar[int] - MODE_FIELD_NUMBER: _ClassVar[int] - TAGS_FIELD_NUMBER: _ClassVar[int] - device: Device - name: str - label: str - type: str - enabled: bool - mtu: int - mac_address: str - speed: int - wwn: str - mgmt_only: bool - description: str - mark_connected: bool - mode: str - 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] - INTERFACE_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - DNS_NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - COMMENTS_FIELD_NUMBER: _ClassVar[int] - TAGS_FIELD_NUMBER: _ClassVar[int] - address: str - interface: Interface - status: str - role: str - dns_name: str - description: str - comments: str - tags: _containers.RepeatedCompositeFieldContainer[Tag] - def __init__(self, address: _Optional[str] = ..., interface: _Optional[_Union[Interface, _Mapping]] = ..., status: _Optional[str] = ..., role: _Optional[str] = ..., dns_name: _Optional[str] = ..., description: _Optional[str] = ..., comments: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... - -class DeviceType(_message.Message): - __slots__ = ("model", "slug", "manufacturer", "description", "comments", "part_number", "tags") - MODEL_FIELD_NUMBER: _ClassVar[int] - SLUG_FIELD_NUMBER: _ClassVar[int] - MANUFACTURER_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - COMMENTS_FIELD_NUMBER: _ClassVar[int] - PART_NUMBER_FIELD_NUMBER: _ClassVar[int] - TAGS_FIELD_NUMBER: _ClassVar[int] - model: str - slug: str - manufacturer: Manufacturer - description: str - comments: str - part_number: str - tags: _containers.RepeatedCompositeFieldContainer[Tag] - def __init__(self, model: _Optional[str] = ..., slug: _Optional[str] = ..., manufacturer: _Optional[_Union[Manufacturer, _Mapping]] = ..., description: _Optional[str] = ..., comments: _Optional[str] = ..., part_number: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... - -class Manufacturer(_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 Platform(_message.Message): - __slots__ = ("name", "slug", "manufacturer", "description", "tags") - NAME_FIELD_NUMBER: _ClassVar[int] - SLUG_FIELD_NUMBER: _ClassVar[int] - MANUFACTURER_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - TAGS_FIELD_NUMBER: _ClassVar[int] - name: str - slug: str - manufacturer: Manufacturer - description: str - tags: _containers.RepeatedCompositeFieldContainer[Tag] - def __init__(self, name: _Optional[str] = ..., slug: _Optional[str] = ..., manufacturer: _Optional[_Union[Manufacturer, _Mapping]] = ..., description: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... - -class Prefix(_message.Message): - __slots__ = ("prefix", "site", "status", "is_pool", "mark_utilized", "description", "comments", "tags") - PREFIX_FIELD_NUMBER: _ClassVar[int] - SITE_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - IS_POOL_FIELD_NUMBER: _ClassVar[int] - MARK_UTILIZED_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - COMMENTS_FIELD_NUMBER: _ClassVar[int] - TAGS_FIELD_NUMBER: _ClassVar[int] - prefix: str - site: Site - status: str - is_pool: bool - mark_utilized: bool - description: str - comments: str - tags: _containers.RepeatedCompositeFieldContainer[Tag] - def __init__(self, prefix: _Optional[str] = ..., site: _Optional[_Union[Site, _Mapping]] = ..., status: _Optional[str] = ..., is_pool: bool = ..., mark_utilized: bool = ..., description: _Optional[str] = ..., comments: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... - -class Role(_message.Message): - __slots__ = ("name", "slug", "color", "description", "tags") - NAME_FIELD_NUMBER: _ClassVar[int] - SLUG_FIELD_NUMBER: _ClassVar[int] - COLOR_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - TAGS_FIELD_NUMBER: _ClassVar[int] - name: str - slug: str - color: str - description: str - tags: _containers.RepeatedCompositeFieldContainer[Tag] - def __init__(self, name: _Optional[str] = ..., slug: _Optional[str] = ..., color: _Optional[str] = ..., description: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... - -class Site(_message.Message): - __slots__ = ("name", "slug", "status", "facility", "time_zone", "description", "comments", "tags") - NAME_FIELD_NUMBER: _ClassVar[int] - SLUG_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - FACILITY_FIELD_NUMBER: _ClassVar[int] - TIME_ZONE_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - COMMENTS_FIELD_NUMBER: _ClassVar[int] - TAGS_FIELD_NUMBER: _ClassVar[int] - name: str - slug: str - status: str - facility: str - time_zone: str - description: str - comments: str - tags: _containers.RepeatedCompositeFieldContainer[Tag] - def __init__(self, name: _Optional[str] = ..., slug: _Optional[str] = ..., status: _Optional[str] = ..., facility: _Optional[str] = ..., time_zone: _Optional[str] = ..., description: _Optional[str] = ..., comments: _Optional[str] = ..., tags: _Optional[_Iterable[_Union[Tag, _Mapping]]] = ...) -> None: ... - -class Tag(_message.Message): - __slots__ = ("name", "slug", "color") - NAME_FIELD_NUMBER: _ClassVar[int] - SLUG_FIELD_NUMBER: _ClassVar[int] - COLOR_FIELD_NUMBER: _ClassVar[int] - name: str - slug: str - color: str - 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", "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] - DEVICE_FIELD_NUMBER: _ClassVar[int] - DEVICE_ROLE_FIELD_NUMBER: _ClassVar[int] - DEVICE_TYPE_FIELD_NUMBER: _ClassVar[int] - 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 - manufacturer: Manufacturer - device: Device - device_role: Role - device_type: DeviceType - 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]] = ..., 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") - STREAM_FIELD_NUMBER: _ClassVar[int] - ENTITIES_FIELD_NUMBER: _ClassVar[int] - ID_FIELD_NUMBER: _ClassVar[int] - PRODUCER_APP_NAME_FIELD_NUMBER: _ClassVar[int] - PRODUCER_APP_VERSION_FIELD_NUMBER: _ClassVar[int] - SDK_NAME_FIELD_NUMBER: _ClassVar[int] - SDK_VERSION_FIELD_NUMBER: _ClassVar[int] - stream: str - entities: _containers.RepeatedCompositeFieldContainer[Entity] - id: str - producer_app_name: str - producer_app_version: str - sdk_name: str - sdk_version: str - def __init__(self, stream: _Optional[str] = ..., entities: _Optional[_Iterable[_Union[Entity, _Mapping]]] = ..., id: _Optional[str] = ..., producer_app_name: _Optional[str] = ..., producer_app_version: _Optional[str] = ..., sdk_name: _Optional[str] = ..., sdk_version: _Optional[str] = ...) -> None: ... - -class IngestResponse(_message.Message): - __slots__ = ("errors",) - ERRORS_FIELD_NUMBER: _ClassVar[int] - errors: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, errors: _Optional[_Iterable[str]] = ...) -> None: ... diff --git a/netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2_grpc.py b/netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2_grpc.py deleted file mode 100644 index 98798c1..0000000 --- a/netbox_diode_plugin/reconciler/sdk/v1/ingester_pb2_grpc.py +++ /dev/null @@ -1,70 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from netbox_diode_plugin.reconciler.sdk.v1 import ingester_pb2 as diode_dot_v1_dot_ingester__pb2 - - -class IngesterServiceStub(object): - """Ingestion API - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Ingest = channel.unary_unary( - '/diode.v1.IngesterService/Ingest', - request_serializer=diode_dot_v1_dot_ingester__pb2.IngestRequest.SerializeToString, - response_deserializer=diode_dot_v1_dot_ingester__pb2.IngestResponse.FromString, - ) - - -class IngesterServiceServicer(object): - """Ingestion API - """ - - def Ingest(self, request, context): - """Ingests data into the system - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_IngesterServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'Ingest': grpc.unary_unary_rpc_method_handler( - servicer.Ingest, - request_deserializer=diode_dot_v1_dot_ingester__pb2.IngestRequest.FromString, - response_serializer=diode_dot_v1_dot_ingester__pb2.IngestResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'diode.v1.IngesterService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class IngesterService(object): - """Ingestion API - """ - - @staticmethod - def Ingest(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/diode.v1.IngesterService/Ingest', - diode_dot_v1_dot_ingester__pb2.IngestRequest.SerializeToString, - diode_dot_v1_dot_ingester__pb2.IngestResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2.py b/netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2.py deleted file mode 100644 index e811c9c..0000000 --- a/netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2.py +++ /dev/null @@ -1,67 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: diode/v1/reconciler.proto -# Protobuf Python Version: 5.26.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from netbox_diode_plugin.reconciler.sdk.v1 import ingester_pb2 as diode_dot_v1_dot_ingester__pb2 -from netbox_diode_plugin.reconciler.sdk.validate import validate_pb2 as validate_dot_validate__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19\x64iode/v1/reconciler.proto\x12\x08\x64iode.v1\x1a\x17\x64iode/v1/ingester.proto\x1a\x17validate/validate.proto\"\xbe\x02\n\x0eIngestionError\x12\x18\n\x07message\x18\x01 \x01(\tR\x07message\x12\x12\n\x04\x63ode\x18\x02 \x01(\x05R\x04\x63ode\x12:\n\x07\x64\x65tails\x18\x03 \x01(\x0b\x32 .diode.v1.IngestionError.DetailsR\x07\x64\x65tails\x1a\xc1\x01\n\x07\x44\x65tails\x12\"\n\rchange_set_id\x18\x01 \x01(\tR\x0b\x63hangeSetId\x12\x16\n\x06result\x18\x02 \x01(\tR\x06result\x12>\n\x06\x65rrors\x18\x03 \x03(\x0b\x32&.diode.v1.IngestionError.Details.ErrorR\x06\x65rrors\x1a:\n\x05\x45rror\x12\x14\n\x05\x65rror\x18\x01 \x01(\tR\x05\x65rror\x12\x1b\n\tchange_id\x18\x02 \x01(\tR\x08\x63hangeId\"\x97\x01\n\x10IngestionMetrics\x12\x14\n\x05total\x18\x01 \x01(\x05R\x05total\x12\x16\n\x06queued\x18\x02 \x01(\x05R\x06queued\x12\x1e\n\nreconciled\x18\x03 \x01(\x05R\nreconciled\x12\x16\n\x06\x66\x61iled\x18\x04 \x01(\x05R\x06\x66\x61iled\x12\x1d\n\nno_changes\x18\x05 \x01(\x05R\tnoChanges\"\x9e\x01\n\tChangeSet\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12 \n\tbranch_id\x18\x03 \x01(\tH\x00R\x08\x62ranchId\x88\x01\x01\x12*\n\x0e\x64\x65viation_name\x18\x04 \x01(\tH\x01R\rdeviationName\x88\x01\x01\x42\x0c\n\n_branch_idB\x11\n\x0f_deviation_name\"\x8e\x04\n\x0cIngestionLog\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n\tdata_type\x18\x02 \x01(\tB\x02\x18\x01R\x08\x64\x61taType\x12%\n\x05state\x18\x03 \x01(\x0e\x32\x0f.diode.v1.StateR\x05state\x12\x1d\n\nrequest_id\x18\x04 \x01(\tR\trequestId\x12!\n\x0cingestion_ts\x18\x05 \x01(\x03R\x0bingestionTs\x12*\n\x11producer_app_name\x18\x06 \x01(\tR\x0fproducerAppName\x12\x30\n\x14producer_app_version\x18\x07 \x01(\tR\x12producerAppVersion\x12\x19\n\x08sdk_name\x18\x08 \x01(\tR\x07sdkName\x12\x1f\n\x0bsdk_version\x18\t \x01(\tR\nsdkVersion\x12(\n\x06\x65ntity\x18\n \x01(\x0b\x32\x10.diode.v1.EntityR\x06\x65ntity\x12.\n\x05\x65rror\x18\x0b \x01(\x0b\x32\x18.diode.v1.IngestionErrorR\x05\x65rror\x12\x32\n\nchange_set\x18\x0c \x01(\x0b\x32\x13.diode.v1.ChangeSetR\tchangeSet\x12\x1f\n\x0bobject_type\x18\r \x01(\tR\nobjectType\x12\x1b\n\tsource_ts\x18\x0e \x01(\x03R\x08sourceTs\"\xff\x02\n\x1cRetrieveIngestionLogsRequest\x12 \n\tpage_size\x18\x01 \x01(\x05H\x00R\x08pageSize\x88\x01\x01\x12*\n\x05state\x18\x02 \x01(\x0e\x32\x0f.diode.v1.StateH\x01R\x05state\x88\x01\x01\x12\x1f\n\tdata_type\x18\x03 \x01(\tB\x02\x18\x01R\x08\x64\x61taType\x12\x1d\n\nrequest_id\x18\x04 \x01(\tR\trequestId\x12,\n\x12ingestion_ts_start\x18\x05 \x01(\x03R\x10ingestionTsStart\x12(\n\x10ingestion_ts_end\x18\x06 \x01(\x03R\x0eingestionTsEnd\x12\x1d\n\npage_token\x18\x07 \x01(\tR\tpageToken\x12!\n\x0conly_metrics\x18\x08 \x01(\x08R\x0bonlyMetrics\x12\x1f\n\x0bobject_type\x18\t \x01(\tR\nobjectTypeB\x0c\n\n_page_sizeB\x08\n\x06_state\"\xa9\x01\n\x1dRetrieveIngestionLogsResponse\x12*\n\x04logs\x18\x01 \x03(\x0b\x32\x16.diode.v1.IngestionLogR\x04logs\x12\x34\n\x07metrics\x18\x02 \x01(\x0b\x32\x1a.diode.v1.IngestionMetricsR\x07metrics\x12&\n\x0fnext_page_token\x18\x03 \x01(\tR\rnextPageToken\"\xa7\x02\n\x19RetrieveDeviationsRequest\x12 \n\tpage_size\x18\x01 \x01(\x05H\x00R\x08pageSize\x88\x01\x01\x12\x1d\n\npage_token\x18\x02 \x01(\tR\tpageToken\x12,\n\x12ingestion_ts_start\x18\x03 \x01(\x03R\x10ingestionTsStart\x12(\n\x10ingestion_ts_end\x18\x04 \x01(\x03R\x0eingestionTsEnd\x12%\n\x05state\x18\x05 \x03(\x0e\x32\x0f.diode.v1.StateR\x05state\x12\x1f\n\x0bobject_type\x18\x06 \x03(\tR\nobjectType\x12\x1b\n\tbranch_id\x18\x07 \x03(\tR\x08\x62ranchIdB\x0c\n\n_page_size\">\n\x0e\x44\x65viationError\x12\x18\n\x07message\x18\x01 \x01(\tR\x07message\x12\x12\n\x04\x63ode\x18\x02 \x01(\x05R\x04\x63ode\"\xba\x01\n\x06\x43hange\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n\x0bobject_type\x18\x02 \x01(\tR\nobjectType\x12\x30\n\x14object_primary_value\x18\x03 \x01(\tR\x12objectPrimaryValue\x12\x1f\n\x0b\x63hange_type\x18\x04 \x01(\tR\nchangeType\x12\x16\n\x06\x62\x65\x66ore\x18\x05 \x01(\x0cR\x06\x62\x65\x66ore\x12\x14\n\x05\x61\x66ter\x18\x06 \x01(\x0cR\x05\x61\x66ter\"\xbc\x03\n\tDeviation\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12!\n\x0cingestion_ts\x18\x02 \x01(\x03R\x0bingestionTs\x12$\n\x0elast_update_ts\x18\x03 \x01(\x03R\x0clastUpdateTs\x12\x12\n\x04name\x18\x04 \x01(\tR\x04name\x12\x16\n\x06source\x18\x05 \x01(\tR\x06source\x12%\n\x05state\x18\x06 \x01(\x0e\x32\x0f.diode.v1.StateR\x05state\x12\x1f\n\x0bobject_type\x18\x07 \x01(\tR\nobjectType\x12 \n\tbranch_id\x18\x08 \x01(\tH\x00R\x08\x62ranchId\x88\x01\x01\x12\x39\n\x0fingested_entity\x18\t \x01(\x0b\x32\x10.diode.v1.EntityR\x0eingestedEntity\x12.\n\x05\x65rror\x18\n \x01(\x0b\x32\x18.diode.v1.DeviationErrorR\x05\x65rror\x12*\n\x07\x63hanges\x18\x0b \x03(\x0b\x32\x10.diode.v1.ChangeR\x07\x63hanges\x12\x1b\n\tsource_ts\x18\x0c \x01(\x03R\x08sourceTsB\x0c\n\n_branch_id\"y\n\x1aRetrieveDeviationsResponse\x12\x33\n\ndeviations\x18\x01 \x03(\x0b\x32\x13.diode.v1.DeviationR\ndeviations\x12&\n\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\".\n\x1cRetrieveDeviationByIDRequest\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\"R\n\x1dRetrieveDeviationByIDResponse\x12\x31\n\tdeviation\x18\x01 \x01(\x0b\x32\x13.diode.v1.DeviationR\tdeviation*w\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\x08\n\x04OPEN\x10\x02\x12\x0b\n\x07\x41PPLIED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0e\n\nNO_CHANGES\x10\x05\x12\x0b\n\x07IGNORED\x10\x06\x12\x0b\n\x07\x45RRORED\x10\x07\x32\xcd\x02\n\x11ReconcilerService\x12m\n\x15RetrieveIngestionLogs\x12&.diode.v1.RetrieveIngestionLogsRequest\x1a\'.diode.v1.RetrieveIngestionLogsResponse\"\x03\x88\x02\x01\x12_\n\x12RetrieveDeviations\x12#.diode.v1.RetrieveDeviationsRequest\x1a$.diode.v1.RetrieveDeviationsResponse\x12h\n\x15RetrieveDeviationByID\x12&.diode.v1.RetrieveDeviationByIDRequest\x1a\'.diode.v1.RetrieveDeviationByIDResponseBDZBgithub.com/netboxlabs/diode/diode-server/gen/diode/v1/reconcilerpbb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'diode.v1.reconciler_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'ZBgithub.com/netboxlabs/diode/diode-server/gen/diode/v1/reconcilerpb' - _globals['_INGESTIONLOG'].fields_by_name['data_type']._loaded_options = None - _globals['_INGESTIONLOG'].fields_by_name['data_type']._serialized_options = b'\030\001' - _globals['_RETRIEVEINGESTIONLOGSREQUEST'].fields_by_name['data_type']._loaded_options = None - _globals['_RETRIEVEINGESTIONLOGSREQUEST'].fields_by_name['data_type']._serialized_options = b'\030\001' - _globals['_RECONCILERSERVICE'].methods_by_name['RetrieveIngestionLogs']._loaded_options = None - _globals['_RECONCILERSERVICE'].methods_by_name['RetrieveIngestionLogs']._serialized_options = b'\210\002\001' - _globals['_STATE']._serialized_start=3065 - _globals['_STATE']._serialized_end=3184 - _globals['_INGESTIONERROR']._serialized_start=90 - _globals['_INGESTIONERROR']._serialized_end=408 - _globals['_INGESTIONERROR_DETAILS']._serialized_start=215 - _globals['_INGESTIONERROR_DETAILS']._serialized_end=408 - _globals['_INGESTIONERROR_DETAILS_ERROR']._serialized_start=350 - _globals['_INGESTIONERROR_DETAILS_ERROR']._serialized_end=408 - _globals['_INGESTIONMETRICS']._serialized_start=411 - _globals['_INGESTIONMETRICS']._serialized_end=562 - _globals['_CHANGESET']._serialized_start=565 - _globals['_CHANGESET']._serialized_end=723 - _globals['_INGESTIONLOG']._serialized_start=726 - _globals['_INGESTIONLOG']._serialized_end=1252 - _globals['_RETRIEVEINGESTIONLOGSREQUEST']._serialized_start=1255 - _globals['_RETRIEVEINGESTIONLOGSREQUEST']._serialized_end=1638 - _globals['_RETRIEVEINGESTIONLOGSRESPONSE']._serialized_start=1641 - _globals['_RETRIEVEINGESTIONLOGSRESPONSE']._serialized_end=1810 - _globals['_RETRIEVEDEVIATIONSREQUEST']._serialized_start=1813 - _globals['_RETRIEVEDEVIATIONSREQUEST']._serialized_end=2108 - _globals['_DEVIATIONERROR']._serialized_start=2110 - _globals['_DEVIATIONERROR']._serialized_end=2172 - _globals['_CHANGE']._serialized_start=2175 - _globals['_CHANGE']._serialized_end=2361 - _globals['_DEVIATION']._serialized_start=2364 - _globals['_DEVIATION']._serialized_end=2808 - _globals['_RETRIEVEDEVIATIONSRESPONSE']._serialized_start=2810 - _globals['_RETRIEVEDEVIATIONSRESPONSE']._serialized_end=2931 - _globals['_RETRIEVEDEVIATIONBYIDREQUEST']._serialized_start=2933 - _globals['_RETRIEVEDEVIATIONBYIDREQUEST']._serialized_end=2979 - _globals['_RETRIEVEDEVIATIONBYIDRESPONSE']._serialized_start=2981 - _globals['_RETRIEVEDEVIATIONBYIDRESPONSE']._serialized_end=3063 - _globals['_RECONCILERSERVICE']._serialized_start=3187 - _globals['_RECONCILERSERVICE']._serialized_end=3520 -# @@protoc_insertion_point(module_scope) diff --git a/netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2.pyi b/netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2.pyi deleted file mode 100644 index 200ffb3..0000000 --- a/netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2.pyi +++ /dev/null @@ -1,234 +0,0 @@ -from netbox_diode_plugin.reconciler.sdk.v1 import ingester_pb2 as _ingester_pb2 -from netbox_diode_plugin.reconciler.sdk.validate import validate_pb2 as _validate_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class State(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - STATE_UNSPECIFIED: _ClassVar[State] - QUEUED: _ClassVar[State] - OPEN: _ClassVar[State] - APPLIED: _ClassVar[State] - FAILED: _ClassVar[State] - NO_CHANGES: _ClassVar[State] - IGNORED: _ClassVar[State] - ERRORED: _ClassVar[State] -STATE_UNSPECIFIED: State -QUEUED: State -OPEN: State -APPLIED: State -FAILED: State -NO_CHANGES: State -IGNORED: State -ERRORED: State - -class IngestionError(_message.Message): - __slots__ = ("message", "code", "details") - class Details(_message.Message): - __slots__ = ("change_set_id", "result", "errors") - class Error(_message.Message): - __slots__ = ("error", "change_id") - ERROR_FIELD_NUMBER: _ClassVar[int] - CHANGE_ID_FIELD_NUMBER: _ClassVar[int] - error: str - change_id: str - def __init__(self, error: _Optional[str] = ..., change_id: _Optional[str] = ...) -> None: ... - CHANGE_SET_ID_FIELD_NUMBER: _ClassVar[int] - RESULT_FIELD_NUMBER: _ClassVar[int] - ERRORS_FIELD_NUMBER: _ClassVar[int] - change_set_id: str - result: str - errors: _containers.RepeatedCompositeFieldContainer[IngestionError.Details.Error] - def __init__(self, change_set_id: _Optional[str] = ..., result: _Optional[str] = ..., errors: _Optional[_Iterable[_Union[IngestionError.Details.Error, _Mapping]]] = ...) -> None: ... - MESSAGE_FIELD_NUMBER: _ClassVar[int] - CODE_FIELD_NUMBER: _ClassVar[int] - DETAILS_FIELD_NUMBER: _ClassVar[int] - message: str - code: int - details: IngestionError.Details - def __init__(self, message: _Optional[str] = ..., code: _Optional[int] = ..., details: _Optional[_Union[IngestionError.Details, _Mapping]] = ...) -> None: ... - -class IngestionMetrics(_message.Message): - __slots__ = ("total", "queued", "reconciled", "failed", "no_changes") - TOTAL_FIELD_NUMBER: _ClassVar[int] - QUEUED_FIELD_NUMBER: _ClassVar[int] - RECONCILED_FIELD_NUMBER: _ClassVar[int] - FAILED_FIELD_NUMBER: _ClassVar[int] - NO_CHANGES_FIELD_NUMBER: _ClassVar[int] - total: int - queued: int - reconciled: int - failed: int - no_changes: int - def __init__(self, total: _Optional[int] = ..., queued: _Optional[int] = ..., reconciled: _Optional[int] = ..., failed: _Optional[int] = ..., no_changes: _Optional[int] = ...) -> None: ... - -class ChangeSet(_message.Message): - __slots__ = ("id", "data", "branch_id", "deviation_name") - ID_FIELD_NUMBER: _ClassVar[int] - DATA_FIELD_NUMBER: _ClassVar[int] - BRANCH_ID_FIELD_NUMBER: _ClassVar[int] - DEVIATION_NAME_FIELD_NUMBER: _ClassVar[int] - id: str - data: bytes - branch_id: str - deviation_name: str - def __init__(self, id: _Optional[str] = ..., data: _Optional[bytes] = ..., branch_id: _Optional[str] = ..., deviation_name: _Optional[str] = ...) -> None: ... - -class IngestionLog(_message.Message): - __slots__ = ("id", "data_type", "state", "request_id", "ingestion_ts", "producer_app_name", "producer_app_version", "sdk_name", "sdk_version", "entity", "error", "change_set", "object_type", "source_ts") - ID_FIELD_NUMBER: _ClassVar[int] - DATA_TYPE_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - REQUEST_ID_FIELD_NUMBER: _ClassVar[int] - INGESTION_TS_FIELD_NUMBER: _ClassVar[int] - PRODUCER_APP_NAME_FIELD_NUMBER: _ClassVar[int] - PRODUCER_APP_VERSION_FIELD_NUMBER: _ClassVar[int] - SDK_NAME_FIELD_NUMBER: _ClassVar[int] - SDK_VERSION_FIELD_NUMBER: _ClassVar[int] - ENTITY_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - CHANGE_SET_FIELD_NUMBER: _ClassVar[int] - OBJECT_TYPE_FIELD_NUMBER: _ClassVar[int] - SOURCE_TS_FIELD_NUMBER: _ClassVar[int] - id: str - data_type: str - state: State - request_id: str - ingestion_ts: int - producer_app_name: str - producer_app_version: str - sdk_name: str - sdk_version: str - entity: _ingester_pb2.Entity - error: IngestionError - change_set: ChangeSet - object_type: str - source_ts: int - def __init__(self, id: _Optional[str] = ..., data_type: _Optional[str] = ..., state: _Optional[_Union[State, str]] = ..., request_id: _Optional[str] = ..., ingestion_ts: _Optional[int] = ..., producer_app_name: _Optional[str] = ..., producer_app_version: _Optional[str] = ..., sdk_name: _Optional[str] = ..., sdk_version: _Optional[str] = ..., entity: _Optional[_Union[_ingester_pb2.Entity, _Mapping]] = ..., error: _Optional[_Union[IngestionError, _Mapping]] = ..., change_set: _Optional[_Union[ChangeSet, _Mapping]] = ..., object_type: _Optional[str] = ..., source_ts: _Optional[int] = ...) -> None: ... - -class RetrieveIngestionLogsRequest(_message.Message): - __slots__ = ("page_size", "state", "data_type", "request_id", "ingestion_ts_start", "ingestion_ts_end", "page_token", "only_metrics", "object_type") - PAGE_SIZE_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - DATA_TYPE_FIELD_NUMBER: _ClassVar[int] - REQUEST_ID_FIELD_NUMBER: _ClassVar[int] - INGESTION_TS_START_FIELD_NUMBER: _ClassVar[int] - INGESTION_TS_END_FIELD_NUMBER: _ClassVar[int] - PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int] - ONLY_METRICS_FIELD_NUMBER: _ClassVar[int] - OBJECT_TYPE_FIELD_NUMBER: _ClassVar[int] - page_size: int - state: State - data_type: str - request_id: str - ingestion_ts_start: int - ingestion_ts_end: int - page_token: str - only_metrics: bool - object_type: str - def __init__(self, page_size: _Optional[int] = ..., state: _Optional[_Union[State, str]] = ..., data_type: _Optional[str] = ..., request_id: _Optional[str] = ..., ingestion_ts_start: _Optional[int] = ..., ingestion_ts_end: _Optional[int] = ..., page_token: _Optional[str] = ..., only_metrics: bool = ..., object_type: _Optional[str] = ...) -> None: ... - -class RetrieveIngestionLogsResponse(_message.Message): - __slots__ = ("logs", "metrics", "next_page_token") - LOGS_FIELD_NUMBER: _ClassVar[int] - METRICS_FIELD_NUMBER: _ClassVar[int] - NEXT_PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int] - logs: _containers.RepeatedCompositeFieldContainer[IngestionLog] - metrics: IngestionMetrics - next_page_token: str - def __init__(self, logs: _Optional[_Iterable[_Union[IngestionLog, _Mapping]]] = ..., metrics: _Optional[_Union[IngestionMetrics, _Mapping]] = ..., next_page_token: _Optional[str] = ...) -> None: ... - -class RetrieveDeviationsRequest(_message.Message): - __slots__ = ("page_size", "page_token", "ingestion_ts_start", "ingestion_ts_end", "state", "object_type", "branch_id") - PAGE_SIZE_FIELD_NUMBER: _ClassVar[int] - PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int] - INGESTION_TS_START_FIELD_NUMBER: _ClassVar[int] - INGESTION_TS_END_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - OBJECT_TYPE_FIELD_NUMBER: _ClassVar[int] - BRANCH_ID_FIELD_NUMBER: _ClassVar[int] - page_size: int - page_token: str - ingestion_ts_start: int - ingestion_ts_end: int - state: _containers.RepeatedScalarFieldContainer[State] - object_type: _containers.RepeatedScalarFieldContainer[str] - branch_id: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, page_size: _Optional[int] = ..., page_token: _Optional[str] = ..., ingestion_ts_start: _Optional[int] = ..., ingestion_ts_end: _Optional[int] = ..., state: _Optional[_Iterable[_Union[State, str]]] = ..., object_type: _Optional[_Iterable[str]] = ..., branch_id: _Optional[_Iterable[str]] = ...) -> None: ... - -class DeviationError(_message.Message): - __slots__ = ("message", "code") - MESSAGE_FIELD_NUMBER: _ClassVar[int] - CODE_FIELD_NUMBER: _ClassVar[int] - message: str - code: int - def __init__(self, message: _Optional[str] = ..., code: _Optional[int] = ...) -> None: ... - -class Change(_message.Message): - __slots__ = ("id", "object_type", "object_primary_value", "change_type", "before", "after") - ID_FIELD_NUMBER: _ClassVar[int] - OBJECT_TYPE_FIELD_NUMBER: _ClassVar[int] - OBJECT_PRIMARY_VALUE_FIELD_NUMBER: _ClassVar[int] - CHANGE_TYPE_FIELD_NUMBER: _ClassVar[int] - BEFORE_FIELD_NUMBER: _ClassVar[int] - AFTER_FIELD_NUMBER: _ClassVar[int] - id: str - object_type: str - object_primary_value: str - change_type: str - before: bytes - after: bytes - def __init__(self, id: _Optional[str] = ..., object_type: _Optional[str] = ..., object_primary_value: _Optional[str] = ..., change_type: _Optional[str] = ..., before: _Optional[bytes] = ..., after: _Optional[bytes] = ...) -> None: ... - -class Deviation(_message.Message): - __slots__ = ("id", "ingestion_ts", "last_update_ts", "name", "source", "state", "object_type", "branch_id", "ingested_entity", "error", "changes", "source_ts") - ID_FIELD_NUMBER: _ClassVar[int] - INGESTION_TS_FIELD_NUMBER: _ClassVar[int] - LAST_UPDATE_TS_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - SOURCE_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - OBJECT_TYPE_FIELD_NUMBER: _ClassVar[int] - BRANCH_ID_FIELD_NUMBER: _ClassVar[int] - INGESTED_ENTITY_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - CHANGES_FIELD_NUMBER: _ClassVar[int] - SOURCE_TS_FIELD_NUMBER: _ClassVar[int] - id: str - ingestion_ts: int - last_update_ts: int - name: str - source: str - state: State - object_type: str - branch_id: str - ingested_entity: _ingester_pb2.Entity - error: DeviationError - changes: _containers.RepeatedCompositeFieldContainer[Change] - source_ts: int - def __init__(self, id: _Optional[str] = ..., ingestion_ts: _Optional[int] = ..., last_update_ts: _Optional[int] = ..., name: _Optional[str] = ..., source: _Optional[str] = ..., state: _Optional[_Union[State, str]] = ..., object_type: _Optional[str] = ..., branch_id: _Optional[str] = ..., ingested_entity: _Optional[_Union[_ingester_pb2.Entity, _Mapping]] = ..., error: _Optional[_Union[DeviationError, _Mapping]] = ..., changes: _Optional[_Iterable[_Union[Change, _Mapping]]] = ..., source_ts: _Optional[int] = ...) -> None: ... - -class RetrieveDeviationsResponse(_message.Message): - __slots__ = ("deviations", "next_page_token") - DEVIATIONS_FIELD_NUMBER: _ClassVar[int] - NEXT_PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int] - deviations: _containers.RepeatedCompositeFieldContainer[Deviation] - next_page_token: str - def __init__(self, deviations: _Optional[_Iterable[_Union[Deviation, _Mapping]]] = ..., next_page_token: _Optional[str] = ...) -> None: ... - -class RetrieveDeviationByIDRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class RetrieveDeviationByIDResponse(_message.Message): - __slots__ = ("deviation",) - DEVIATION_FIELD_NUMBER: _ClassVar[int] - deviation: Deviation - def __init__(self, deviation: _Optional[_Union[Deviation, _Mapping]] = ...) -> None: ... diff --git a/netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2_grpc.py b/netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2_grpc.py deleted file mode 100644 index 73d37b7..0000000 --- a/netbox_diode_plugin/reconciler/sdk/v1/reconciler_pb2_grpc.py +++ /dev/null @@ -1,138 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from netbox_diode_plugin.reconciler.sdk.v1 import reconciler_pb2 as diode_dot_v1_dot_reconciler__pb2 - - -class ReconcilerServiceStub(object): - """Reconciler service API - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.RetrieveIngestionLogs = channel.unary_unary( - '/diode.v1.ReconcilerService/RetrieveIngestionLogs', - request_serializer=diode_dot_v1_dot_reconciler__pb2.RetrieveIngestionLogsRequest.SerializeToString, - response_deserializer=diode_dot_v1_dot_reconciler__pb2.RetrieveIngestionLogsResponse.FromString, - ) - self.RetrieveDeviations = channel.unary_unary( - '/diode.v1.ReconcilerService/RetrieveDeviations', - request_serializer=diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationsRequest.SerializeToString, - response_deserializer=diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationsResponse.FromString, - ) - self.RetrieveDeviationByID = channel.unary_unary( - '/diode.v1.ReconcilerService/RetrieveDeviationByID', - request_serializer=diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationByIDRequest.SerializeToString, - response_deserializer=diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationByIDResponse.FromString, - ) - - -class ReconcilerServiceServicer(object): - """Reconciler service API - """ - - def RetrieveIngestionLogs(self, request, context): - """Retrieves ingestion logs - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RetrieveDeviations(self, request, context): - """Retrieve deviations - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RetrieveDeviationByID(self, request, context): - """Retrieve deviation by ID - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ReconcilerServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'RetrieveIngestionLogs': grpc.unary_unary_rpc_method_handler( - servicer.RetrieveIngestionLogs, - request_deserializer=diode_dot_v1_dot_reconciler__pb2.RetrieveIngestionLogsRequest.FromString, - response_serializer=diode_dot_v1_dot_reconciler__pb2.RetrieveIngestionLogsResponse.SerializeToString, - ), - 'RetrieveDeviations': grpc.unary_unary_rpc_method_handler( - servicer.RetrieveDeviations, - request_deserializer=diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationsRequest.FromString, - response_serializer=diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationsResponse.SerializeToString, - ), - 'RetrieveDeviationByID': grpc.unary_unary_rpc_method_handler( - servicer.RetrieveDeviationByID, - request_deserializer=diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationByIDRequest.FromString, - response_serializer=diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationByIDResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'diode.v1.ReconcilerService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class ReconcilerService(object): - """Reconciler service API - """ - - @staticmethod - def RetrieveIngestionLogs(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/diode.v1.ReconcilerService/RetrieveIngestionLogs', - diode_dot_v1_dot_reconciler__pb2.RetrieveIngestionLogsRequest.SerializeToString, - diode_dot_v1_dot_reconciler__pb2.RetrieveIngestionLogsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def RetrieveDeviations(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/diode.v1.ReconcilerService/RetrieveDeviations', - diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationsRequest.SerializeToString, - diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def RetrieveDeviationByID(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/diode.v1.ReconcilerService/RetrieveDeviationByID', - diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationByIDRequest.SerializeToString, - diode_dot_v1_dot_reconciler__pb2.RetrieveDeviationByIDResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/netbox_diode_plugin/reconciler/sdk/validate/__init__.py b/netbox_diode_plugin/reconciler/sdk/validate/__init__.py deleted file mode 100644 index feaaf48..0000000 --- a/netbox_diode_plugin/reconciler/sdk/validate/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""Diode NetBox Plugin - Reconciler - SDK - Validate.""" diff --git a/netbox_diode_plugin/reconciler/sdk/validate/validate_pb2.py b/netbox_diode_plugin/reconciler/sdk/validate/validate_pb2.py deleted file mode 100644 index cb59def..0000000 --- a/netbox_diode_plugin/reconciler/sdk/validate/validate_pb2.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: validate/validate.proto -# Protobuf Python Version: 5.26.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17validate/validate.proto\x12\x08validate\x1a google/protobuf/descriptor.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc8\x08\n\nFieldRules\x12\x30\n\x07message\x18\x11 \x01(\x0b\x32\x16.validate.MessageRulesR\x07message\x12,\n\x05\x66loat\x18\x01 \x01(\x0b\x32\x14.validate.FloatRulesH\x00R\x05\x66loat\x12/\n\x06\x64ouble\x18\x02 \x01(\x0b\x32\x15.validate.DoubleRulesH\x00R\x06\x64ouble\x12,\n\x05int32\x18\x03 \x01(\x0b\x32\x14.validate.Int32RulesH\x00R\x05int32\x12,\n\x05int64\x18\x04 \x01(\x0b\x32\x14.validate.Int64RulesH\x00R\x05int64\x12/\n\x06uint32\x18\x05 \x01(\x0b\x32\x15.validate.UInt32RulesH\x00R\x06uint32\x12/\n\x06uint64\x18\x06 \x01(\x0b\x32\x15.validate.UInt64RulesH\x00R\x06uint64\x12/\n\x06sint32\x18\x07 \x01(\x0b\x32\x15.validate.SInt32RulesH\x00R\x06sint32\x12/\n\x06sint64\x18\x08 \x01(\x0b\x32\x15.validate.SInt64RulesH\x00R\x06sint64\x12\x32\n\x07\x66ixed32\x18\t \x01(\x0b\x32\x16.validate.Fixed32RulesH\x00R\x07\x66ixed32\x12\x32\n\x07\x66ixed64\x18\n \x01(\x0b\x32\x16.validate.Fixed64RulesH\x00R\x07\x66ixed64\x12\x35\n\x08sfixed32\x18\x0b \x01(\x0b\x32\x17.validate.SFixed32RulesH\x00R\x08sfixed32\x12\x35\n\x08sfixed64\x18\x0c \x01(\x0b\x32\x17.validate.SFixed64RulesH\x00R\x08sfixed64\x12)\n\x04\x62ool\x18\r \x01(\x0b\x32\x13.validate.BoolRulesH\x00R\x04\x62ool\x12/\n\x06string\x18\x0e \x01(\x0b\x32\x15.validate.StringRulesH\x00R\x06string\x12,\n\x05\x62ytes\x18\x0f \x01(\x0b\x32\x14.validate.BytesRulesH\x00R\x05\x62ytes\x12)\n\x04\x65num\x18\x10 \x01(\x0b\x32\x13.validate.EnumRulesH\x00R\x04\x65num\x12\x35\n\x08repeated\x18\x12 \x01(\x0b\x32\x17.validate.RepeatedRulesH\x00R\x08repeated\x12&\n\x03map\x18\x13 \x01(\x0b\x32\x12.validate.MapRulesH\x00R\x03map\x12&\n\x03\x61ny\x18\x14 \x01(\x0b\x32\x12.validate.AnyRulesH\x00R\x03\x61ny\x12\x35\n\x08\x64uration\x18\x15 \x01(\x0b\x32\x17.validate.DurationRulesH\x00R\x08\x64uration\x12\x38\n\ttimestamp\x18\x16 \x01(\x0b\x32\x18.validate.TimestampRulesH\x00R\ttimestampB\x06\n\x04type\"\xb0\x01\n\nFloatRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x02R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x02R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x02R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x02R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x02R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x02R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x02R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb1\x01\n\x0b\x44oubleRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x01R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x01R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x01R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x01R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x01R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x01R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x01R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb0\x01\n\nInt32Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x05R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x05R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x05R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x05R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x05R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x05R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x05R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb0\x01\n\nInt64Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x03R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x03R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x03R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x03R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x03R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x03R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x03R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb1\x01\n\x0bUInt32Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\rR\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\rR\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\rR\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\rR\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\rR\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\rR\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\rR\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb1\x01\n\x0bUInt64Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x04R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x04R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x04R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x04R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x04R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x04R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x04R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb1\x01\n\x0bSInt32Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x11R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x11R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x11R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x11R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x11R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x11R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x11R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb1\x01\n\x0bSInt64Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x12R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x12R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x12R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x12R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x12R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x12R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x12R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb2\x01\n\x0c\x46ixed32Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x07R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x07R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x07R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x07R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x07R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x07R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x07R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb2\x01\n\x0c\x46ixed64Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x06R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x06R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x06R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x06R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x06R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x06R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x06R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb3\x01\n\rSFixed32Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x0fR\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x0fR\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x0fR\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x0fR\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x0fR\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x0fR\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x0fR\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb3\x01\n\rSFixed64Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x10R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x10R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x10R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x10R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x10R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x10R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x10R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"!\n\tBoolRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x08R\x05\x63onst\"\xd4\x05\n\x0bStringRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\tR\x05\x63onst\x12\x10\n\x03len\x18\x13 \x01(\x04R\x03len\x12\x17\n\x07min_len\x18\x02 \x01(\x04R\x06minLen\x12\x17\n\x07max_len\x18\x03 \x01(\x04R\x06maxLen\x12\x1b\n\tlen_bytes\x18\x14 \x01(\x04R\x08lenBytes\x12\x1b\n\tmin_bytes\x18\x04 \x01(\x04R\x08minBytes\x12\x1b\n\tmax_bytes\x18\x05 \x01(\x04R\x08maxBytes\x12\x18\n\x07pattern\x18\x06 \x01(\tR\x07pattern\x12\x16\n\x06prefix\x18\x07 \x01(\tR\x06prefix\x12\x16\n\x06suffix\x18\x08 \x01(\tR\x06suffix\x12\x1a\n\x08\x63ontains\x18\t \x01(\tR\x08\x63ontains\x12!\n\x0cnot_contains\x18\x17 \x01(\tR\x0bnotContains\x12\x0e\n\x02in\x18\n \x03(\tR\x02in\x12\x15\n\x06not_in\x18\x0b \x03(\tR\x05notIn\x12\x16\n\x05\x65mail\x18\x0c \x01(\x08H\x00R\x05\x65mail\x12\x1c\n\x08hostname\x18\r \x01(\x08H\x00R\x08hostname\x12\x10\n\x02ip\x18\x0e \x01(\x08H\x00R\x02ip\x12\x14\n\x04ipv4\x18\x0f \x01(\x08H\x00R\x04ipv4\x12\x14\n\x04ipv6\x18\x10 \x01(\x08H\x00R\x04ipv6\x12\x12\n\x03uri\x18\x11 \x01(\x08H\x00R\x03uri\x12\x19\n\x07uri_ref\x18\x12 \x01(\x08H\x00R\x06uriRef\x12\x1a\n\x07\x61\x64\x64ress\x18\x15 \x01(\x08H\x00R\x07\x61\x64\x64ress\x12\x14\n\x04uuid\x18\x16 \x01(\x08H\x00R\x04uuid\x12@\n\x10well_known_regex\x18\x18 \x01(\x0e\x32\x14.validate.KnownRegexH\x00R\x0ewellKnownRegex\x12\x1c\n\x06strict\x18\x19 \x01(\x08:\x04trueR\x06strict\x12!\n\x0cignore_empty\x18\x1a \x01(\x08R\x0bignoreEmptyB\x0c\n\nwell_known\"\xe2\x02\n\nBytesRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x0cR\x05\x63onst\x12\x10\n\x03len\x18\r \x01(\x04R\x03len\x12\x17\n\x07min_len\x18\x02 \x01(\x04R\x06minLen\x12\x17\n\x07max_len\x18\x03 \x01(\x04R\x06maxLen\x12\x18\n\x07pattern\x18\x04 \x01(\tR\x07pattern\x12\x16\n\x06prefix\x18\x05 \x01(\x0cR\x06prefix\x12\x16\n\x06suffix\x18\x06 \x01(\x0cR\x06suffix\x12\x1a\n\x08\x63ontains\x18\x07 \x01(\x0cR\x08\x63ontains\x12\x0e\n\x02in\x18\x08 \x03(\x0cR\x02in\x12\x15\n\x06not_in\x18\t \x03(\x0cR\x05notIn\x12\x10\n\x02ip\x18\n \x01(\x08H\x00R\x02ip\x12\x14\n\x04ipv4\x18\x0b \x01(\x08H\x00R\x04ipv4\x12\x14\n\x04ipv6\x18\x0c \x01(\x08H\x00R\x04ipv6\x12!\n\x0cignore_empty\x18\x0e \x01(\x08R\x0bignoreEmptyB\x0c\n\nwell_known\"k\n\tEnumRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x05R\x05\x63onst\x12!\n\x0c\x64\x65\x66ined_only\x18\x02 \x01(\x08R\x0b\x64\x65\x66inedOnly\x12\x0e\n\x02in\x18\x03 \x03(\x05R\x02in\x12\x15\n\x06not_in\x18\x04 \x03(\x05R\x05notIn\">\n\x0cMessageRules\x12\x12\n\x04skip\x18\x01 \x01(\x08R\x04skip\x12\x1a\n\x08required\x18\x02 \x01(\x08R\x08required\"\xb0\x01\n\rRepeatedRules\x12\x1b\n\tmin_items\x18\x01 \x01(\x04R\x08minItems\x12\x1b\n\tmax_items\x18\x02 \x01(\x04R\x08maxItems\x12\x16\n\x06unique\x18\x03 \x01(\x08R\x06unique\x12*\n\x05items\x18\x04 \x01(\x0b\x32\x14.validate.FieldRulesR\x05items\x12!\n\x0cignore_empty\x18\x05 \x01(\x08R\x0bignoreEmpty\"\xdc\x01\n\x08MapRules\x12\x1b\n\tmin_pairs\x18\x01 \x01(\x04R\x08minPairs\x12\x1b\n\tmax_pairs\x18\x02 \x01(\x04R\x08maxPairs\x12\x1b\n\tno_sparse\x18\x03 \x01(\x08R\x08noSparse\x12(\n\x04keys\x18\x04 \x01(\x0b\x32\x14.validate.FieldRulesR\x04keys\x12,\n\x06values\x18\x05 \x01(\x0b\x32\x14.validate.FieldRulesR\x06values\x12!\n\x0cignore_empty\x18\x06 \x01(\x08R\x0bignoreEmpty\"M\n\x08\x41nyRules\x12\x1a\n\x08required\x18\x01 \x01(\x08R\x08required\x12\x0e\n\x02in\x18\x02 \x03(\tR\x02in\x12\x15\n\x06not_in\x18\x03 \x03(\tR\x05notIn\"\xe9\x02\n\rDurationRules\x12\x1a\n\x08required\x18\x01 \x01(\x08R\x08required\x12/\n\x05\x63onst\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationR\x05\x63onst\x12)\n\x02lt\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationR\x02lt\x12+\n\x03lte\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationR\x03lte\x12)\n\x02gt\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationR\x02gt\x12+\n\x03gte\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationR\x03gte\x12)\n\x02in\x18\x07 \x03(\x0b\x32\x19.google.protobuf.DurationR\x02in\x12\x30\n\x06not_in\x18\x08 \x03(\x0b\x32\x19.google.protobuf.DurationR\x05notIn\"\xf3\x02\n\x0eTimestampRules\x12\x1a\n\x08required\x18\x01 \x01(\x08R\x08required\x12\x30\n\x05\x63onst\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x05\x63onst\x12*\n\x02lt\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x02lt\x12,\n\x03lte\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x03lte\x12*\n\x02gt\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x02gt\x12,\n\x03gte\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x03gte\x12\x15\n\x06lt_now\x18\x07 \x01(\x08R\x05ltNow\x12\x15\n\x06gt_now\x18\x08 \x01(\x08R\x05gtNow\x12\x31\n\x06within\x18\t \x01(\x0b\x32\x19.google.protobuf.DurationR\x06within*F\n\nKnownRegex\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x14\n\x10HTTP_HEADER_NAME\x10\x01\x12\x15\n\x11HTTP_HEADER_VALUE\x10\x02:<\n\x08\x64isabled\x12\x1f.google.protobuf.MessageOptions\x18\xaf\x08 \x01(\x08R\x08\x64isabled::\n\x07ignored\x12\x1f.google.protobuf.MessageOptions\x18\xb0\x08 \x01(\x08R\x07ignored::\n\x08required\x12\x1d.google.protobuf.OneofOptions\x18\xaf\x08 \x01(\x08R\x08required:J\n\x05rules\x12\x1d.google.protobuf.FieldOptions\x18\xaf\x08 \x01(\x0b\x32\x14.validate.FieldRulesR\x05rulesBP\n\x1aio.envoyproxy.pgv.validateZ2github.com/envoyproxy/protoc-gen-validate/validate') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'validate.validate_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\032io.envoyproxy.pgv.validateZ2github.com/envoyproxy/protoc-gen-validate/validate' - _globals['_KNOWNREGEX']._serialized_start=5909 - _globals['_KNOWNREGEX']._serialized_end=5979 - _globals['_FIELDRULES']._serialized_start=137 - _globals['_FIELDRULES']._serialized_end=1233 - _globals['_FLOATRULES']._serialized_start=1236 - _globals['_FLOATRULES']._serialized_end=1412 - _globals['_DOUBLERULES']._serialized_start=1415 - _globals['_DOUBLERULES']._serialized_end=1592 - _globals['_INT32RULES']._serialized_start=1595 - _globals['_INT32RULES']._serialized_end=1771 - _globals['_INT64RULES']._serialized_start=1774 - _globals['_INT64RULES']._serialized_end=1950 - _globals['_UINT32RULES']._serialized_start=1953 - _globals['_UINT32RULES']._serialized_end=2130 - _globals['_UINT64RULES']._serialized_start=2133 - _globals['_UINT64RULES']._serialized_end=2310 - _globals['_SINT32RULES']._serialized_start=2313 - _globals['_SINT32RULES']._serialized_end=2490 - _globals['_SINT64RULES']._serialized_start=2493 - _globals['_SINT64RULES']._serialized_end=2670 - _globals['_FIXED32RULES']._serialized_start=2673 - _globals['_FIXED32RULES']._serialized_end=2851 - _globals['_FIXED64RULES']._serialized_start=2854 - _globals['_FIXED64RULES']._serialized_end=3032 - _globals['_SFIXED32RULES']._serialized_start=3035 - _globals['_SFIXED32RULES']._serialized_end=3214 - _globals['_SFIXED64RULES']._serialized_start=3217 - _globals['_SFIXED64RULES']._serialized_end=3396 - _globals['_BOOLRULES']._serialized_start=3398 - _globals['_BOOLRULES']._serialized_end=3431 - _globals['_STRINGRULES']._serialized_start=3434 - _globals['_STRINGRULES']._serialized_end=4158 - _globals['_BYTESRULES']._serialized_start=4161 - _globals['_BYTESRULES']._serialized_end=4515 - _globals['_ENUMRULES']._serialized_start=4517 - _globals['_ENUMRULES']._serialized_end=4624 - _globals['_MESSAGERULES']._serialized_start=4626 - _globals['_MESSAGERULES']._serialized_end=4688 - _globals['_REPEATEDRULES']._serialized_start=4691 - _globals['_REPEATEDRULES']._serialized_end=4867 - _globals['_MAPRULES']._serialized_start=4870 - _globals['_MAPRULES']._serialized_end=5090 - _globals['_ANYRULES']._serialized_start=5092 - _globals['_ANYRULES']._serialized_end=5169 - _globals['_DURATIONRULES']._serialized_start=5172 - _globals['_DURATIONRULES']._serialized_end=5533 - _globals['_TIMESTAMPRULES']._serialized_start=5536 - _globals['_TIMESTAMPRULES']._serialized_end=5907 -# @@protoc_insertion_point(module_scope) diff --git a/netbox_diode_plugin/reconciler/sdk/validate/validate_pb2.pyi b/netbox_diode_plugin/reconciler/sdk/validate/validate_pb2.pyi deleted file mode 100644 index 2286693..0000000 --- a/netbox_diode_plugin/reconciler/sdk/validate/validate_pb2.pyi +++ /dev/null @@ -1,494 +0,0 @@ -from google.protobuf import descriptor_pb2 as _descriptor_pb2 -from google.protobuf import duration_pb2 as _duration_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class KnownRegex(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - UNKNOWN: _ClassVar[KnownRegex] - HTTP_HEADER_NAME: _ClassVar[KnownRegex] - HTTP_HEADER_VALUE: _ClassVar[KnownRegex] -UNKNOWN: KnownRegex -HTTP_HEADER_NAME: KnownRegex -HTTP_HEADER_VALUE: KnownRegex -DISABLED_FIELD_NUMBER: _ClassVar[int] -disabled: _descriptor.FieldDescriptor -IGNORED_FIELD_NUMBER: _ClassVar[int] -ignored: _descriptor.FieldDescriptor -REQUIRED_FIELD_NUMBER: _ClassVar[int] -required: _descriptor.FieldDescriptor -RULES_FIELD_NUMBER: _ClassVar[int] -rules: _descriptor.FieldDescriptor - -class FieldRules(_message.Message): - __slots__ = ("message", "float", "double", "int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64", "bool", "string", "bytes", "enum", "repeated", "map", "any", "duration", "timestamp") - MESSAGE_FIELD_NUMBER: _ClassVar[int] - FLOAT_FIELD_NUMBER: _ClassVar[int] - DOUBLE_FIELD_NUMBER: _ClassVar[int] - INT32_FIELD_NUMBER: _ClassVar[int] - INT64_FIELD_NUMBER: _ClassVar[int] - UINT32_FIELD_NUMBER: _ClassVar[int] - UINT64_FIELD_NUMBER: _ClassVar[int] - SINT32_FIELD_NUMBER: _ClassVar[int] - SINT64_FIELD_NUMBER: _ClassVar[int] - FIXED32_FIELD_NUMBER: _ClassVar[int] - FIXED64_FIELD_NUMBER: _ClassVar[int] - SFIXED32_FIELD_NUMBER: _ClassVar[int] - SFIXED64_FIELD_NUMBER: _ClassVar[int] - BOOL_FIELD_NUMBER: _ClassVar[int] - STRING_FIELD_NUMBER: _ClassVar[int] - BYTES_FIELD_NUMBER: _ClassVar[int] - ENUM_FIELD_NUMBER: _ClassVar[int] - REPEATED_FIELD_NUMBER: _ClassVar[int] - MAP_FIELD_NUMBER: _ClassVar[int] - ANY_FIELD_NUMBER: _ClassVar[int] - DURATION_FIELD_NUMBER: _ClassVar[int] - TIMESTAMP_FIELD_NUMBER: _ClassVar[int] - message: MessageRules - float: FloatRules - double: DoubleRules - int32: Int32Rules - int64: Int64Rules - uint32: UInt32Rules - uint64: UInt64Rules - sint32: SInt32Rules - sint64: SInt64Rules - fixed32: Fixed32Rules - fixed64: Fixed64Rules - sfixed32: SFixed32Rules - sfixed64: SFixed64Rules - bool: BoolRules - string: StringRules - bytes: BytesRules - enum: EnumRules - repeated: RepeatedRules - map: MapRules - any: AnyRules - duration: DurationRules - timestamp: TimestampRules - def __init__(self, message: _Optional[_Union[MessageRules, _Mapping]] = ..., float: _Optional[_Union[FloatRules, _Mapping]] = ..., double: _Optional[_Union[DoubleRules, _Mapping]] = ..., int32: _Optional[_Union[Int32Rules, _Mapping]] = ..., int64: _Optional[_Union[Int64Rules, _Mapping]] = ..., uint32: _Optional[_Union[UInt32Rules, _Mapping]] = ..., uint64: _Optional[_Union[UInt64Rules, _Mapping]] = ..., sint32: _Optional[_Union[SInt32Rules, _Mapping]] = ..., sint64: _Optional[_Union[SInt64Rules, _Mapping]] = ..., fixed32: _Optional[_Union[Fixed32Rules, _Mapping]] = ..., fixed64: _Optional[_Union[Fixed64Rules, _Mapping]] = ..., sfixed32: _Optional[_Union[SFixed32Rules, _Mapping]] = ..., sfixed64: _Optional[_Union[SFixed64Rules, _Mapping]] = ..., bool: _Optional[_Union[BoolRules, _Mapping]] = ..., string: _Optional[_Union[StringRules, _Mapping]] = ..., bytes: _Optional[_Union[BytesRules, _Mapping]] = ..., enum: _Optional[_Union[EnumRules, _Mapping]] = ..., repeated: _Optional[_Union[RepeatedRules, _Mapping]] = ..., map: _Optional[_Union[MapRules, _Mapping]] = ..., any: _Optional[_Union[AnyRules, _Mapping]] = ..., duration: _Optional[_Union[DurationRules, _Mapping]] = ..., timestamp: _Optional[_Union[TimestampRules, _Mapping]] = ...) -> None: ... - -class FloatRules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: float - lt: float - lte: float - gt: float - gte: float - not_in: _containers.RepeatedScalarFieldContainer[float] - ignore_empty: bool - def __init__(self, const: _Optional[float] = ..., lt: _Optional[float] = ..., lte: _Optional[float] = ..., gt: _Optional[float] = ..., gte: _Optional[float] = ..., not_in: _Optional[_Iterable[float]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class DoubleRules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: float - lt: float - lte: float - gt: float - gte: float - not_in: _containers.RepeatedScalarFieldContainer[float] - ignore_empty: bool - def __init__(self, const: _Optional[float] = ..., lt: _Optional[float] = ..., lte: _Optional[float] = ..., gt: _Optional[float] = ..., gte: _Optional[float] = ..., not_in: _Optional[_Iterable[float]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class Int32Rules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: int - lt: int - lte: int - gt: int - gte: int - not_in: _containers.RepeatedScalarFieldContainer[int] - ignore_empty: bool - def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class Int64Rules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: int - lt: int - lte: int - gt: int - gte: int - not_in: _containers.RepeatedScalarFieldContainer[int] - ignore_empty: bool - def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class UInt32Rules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: int - lt: int - lte: int - gt: int - gte: int - not_in: _containers.RepeatedScalarFieldContainer[int] - ignore_empty: bool - def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class UInt64Rules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: int - lt: int - lte: int - gt: int - gte: int - not_in: _containers.RepeatedScalarFieldContainer[int] - ignore_empty: bool - def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class SInt32Rules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: int - lt: int - lte: int - gt: int - gte: int - not_in: _containers.RepeatedScalarFieldContainer[int] - ignore_empty: bool - def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class SInt64Rules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: int - lt: int - lte: int - gt: int - gte: int - not_in: _containers.RepeatedScalarFieldContainer[int] - ignore_empty: bool - def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class Fixed32Rules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: int - lt: int - lte: int - gt: int - gte: int - not_in: _containers.RepeatedScalarFieldContainer[int] - ignore_empty: bool - def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class Fixed64Rules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: int - lt: int - lte: int - gt: int - gte: int - not_in: _containers.RepeatedScalarFieldContainer[int] - ignore_empty: bool - def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class SFixed32Rules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: int - lt: int - lte: int - gt: int - gte: int - not_in: _containers.RepeatedScalarFieldContainer[int] - ignore_empty: bool - def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class SFixed64Rules(_message.Message): - __slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: int - lt: int - lte: int - gt: int - gte: int - not_in: _containers.RepeatedScalarFieldContainer[int] - ignore_empty: bool - def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class BoolRules(_message.Message): - __slots__ = ("const",) - CONST_FIELD_NUMBER: _ClassVar[int] - const: bool - def __init__(self, const: bool = ...) -> None: ... - -class StringRules(_message.Message): - __slots__ = ("const", "len", "min_len", "max_len", "len_bytes", "min_bytes", "max_bytes", "pattern", "prefix", "suffix", "contains", "not_contains", "not_in", "email", "hostname", "ip", "ipv4", "ipv6", "uri", "uri_ref", "address", "uuid", "well_known_regex", "strict", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LEN_FIELD_NUMBER: _ClassVar[int] - MIN_LEN_FIELD_NUMBER: _ClassVar[int] - MAX_LEN_FIELD_NUMBER: _ClassVar[int] - LEN_BYTES_FIELD_NUMBER: _ClassVar[int] - MIN_BYTES_FIELD_NUMBER: _ClassVar[int] - MAX_BYTES_FIELD_NUMBER: _ClassVar[int] - PATTERN_FIELD_NUMBER: _ClassVar[int] - PREFIX_FIELD_NUMBER: _ClassVar[int] - SUFFIX_FIELD_NUMBER: _ClassVar[int] - CONTAINS_FIELD_NUMBER: _ClassVar[int] - NOT_CONTAINS_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - EMAIL_FIELD_NUMBER: _ClassVar[int] - HOSTNAME_FIELD_NUMBER: _ClassVar[int] - IP_FIELD_NUMBER: _ClassVar[int] - IPV4_FIELD_NUMBER: _ClassVar[int] - IPV6_FIELD_NUMBER: _ClassVar[int] - URI_FIELD_NUMBER: _ClassVar[int] - URI_REF_FIELD_NUMBER: _ClassVar[int] - ADDRESS_FIELD_NUMBER: _ClassVar[int] - UUID_FIELD_NUMBER: _ClassVar[int] - WELL_KNOWN_REGEX_FIELD_NUMBER: _ClassVar[int] - STRICT_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: str - len: int - min_len: int - max_len: int - len_bytes: int - min_bytes: int - max_bytes: int - pattern: str - prefix: str - suffix: str - contains: str - not_contains: str - not_in: _containers.RepeatedScalarFieldContainer[str] - email: bool - hostname: bool - ip: bool - ipv4: bool - ipv6: bool - uri: bool - uri_ref: bool - address: bool - uuid: bool - well_known_regex: KnownRegex - strict: bool - ignore_empty: bool - def __init__(self, const: _Optional[str] = ..., len: _Optional[int] = ..., min_len: _Optional[int] = ..., max_len: _Optional[int] = ..., len_bytes: _Optional[int] = ..., min_bytes: _Optional[int] = ..., max_bytes: _Optional[int] = ..., pattern: _Optional[str] = ..., prefix: _Optional[str] = ..., suffix: _Optional[str] = ..., contains: _Optional[str] = ..., not_contains: _Optional[str] = ..., not_in: _Optional[_Iterable[str]] = ..., email: bool = ..., hostname: bool = ..., ip: bool = ..., ipv4: bool = ..., ipv6: bool = ..., uri: bool = ..., uri_ref: bool = ..., address: bool = ..., uuid: bool = ..., well_known_regex: _Optional[_Union[KnownRegex, str]] = ..., strict: bool = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class BytesRules(_message.Message): - __slots__ = ("const", "len", "min_len", "max_len", "pattern", "prefix", "suffix", "contains", "not_in", "ip", "ipv4", "ipv6", "ignore_empty") - CONST_FIELD_NUMBER: _ClassVar[int] - LEN_FIELD_NUMBER: _ClassVar[int] - MIN_LEN_FIELD_NUMBER: _ClassVar[int] - MAX_LEN_FIELD_NUMBER: _ClassVar[int] - PATTERN_FIELD_NUMBER: _ClassVar[int] - PREFIX_FIELD_NUMBER: _ClassVar[int] - SUFFIX_FIELD_NUMBER: _ClassVar[int] - CONTAINS_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - IP_FIELD_NUMBER: _ClassVar[int] - IPV4_FIELD_NUMBER: _ClassVar[int] - IPV6_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - const: bytes - len: int - min_len: int - max_len: int - pattern: str - prefix: bytes - suffix: bytes - contains: bytes - not_in: _containers.RepeatedScalarFieldContainer[bytes] - ip: bool - ipv4: bool - ipv6: bool - ignore_empty: bool - def __init__(self, const: _Optional[bytes] = ..., len: _Optional[int] = ..., min_len: _Optional[int] = ..., max_len: _Optional[int] = ..., pattern: _Optional[str] = ..., prefix: _Optional[bytes] = ..., suffix: _Optional[bytes] = ..., contains: _Optional[bytes] = ..., not_in: _Optional[_Iterable[bytes]] = ..., ip: bool = ..., ipv4: bool = ..., ipv6: bool = ..., ignore_empty: bool = ..., **kwargs) -> None: ... - -class EnumRules(_message.Message): - __slots__ = ("const", "defined_only", "not_in") - CONST_FIELD_NUMBER: _ClassVar[int] - DEFINED_ONLY_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - const: int - defined_only: bool - not_in: _containers.RepeatedScalarFieldContainer[int] - def __init__(self, const: _Optional[int] = ..., defined_only: bool = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ... - -class MessageRules(_message.Message): - __slots__ = ("skip", "required") - SKIP_FIELD_NUMBER: _ClassVar[int] - REQUIRED_FIELD_NUMBER: _ClassVar[int] - skip: bool - required: bool - def __init__(self, skip: bool = ..., required: bool = ...) -> None: ... - -class RepeatedRules(_message.Message): - __slots__ = ("min_items", "max_items", "unique", "items", "ignore_empty") - MIN_ITEMS_FIELD_NUMBER: _ClassVar[int] - MAX_ITEMS_FIELD_NUMBER: _ClassVar[int] - UNIQUE_FIELD_NUMBER: _ClassVar[int] - ITEMS_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - min_items: int - max_items: int - unique: bool - items: FieldRules - ignore_empty: bool - def __init__(self, min_items: _Optional[int] = ..., max_items: _Optional[int] = ..., unique: bool = ..., items: _Optional[_Union[FieldRules, _Mapping]] = ..., ignore_empty: bool = ...) -> None: ... - -class MapRules(_message.Message): - __slots__ = ("min_pairs", "max_pairs", "no_sparse", "keys", "values", "ignore_empty") - MIN_PAIRS_FIELD_NUMBER: _ClassVar[int] - MAX_PAIRS_FIELD_NUMBER: _ClassVar[int] - NO_SPARSE_FIELD_NUMBER: _ClassVar[int] - KEYS_FIELD_NUMBER: _ClassVar[int] - VALUES_FIELD_NUMBER: _ClassVar[int] - IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int] - min_pairs: int - max_pairs: int - no_sparse: bool - keys: FieldRules - values: FieldRules - ignore_empty: bool - def __init__(self, min_pairs: _Optional[int] = ..., max_pairs: _Optional[int] = ..., no_sparse: bool = ..., keys: _Optional[_Union[FieldRules, _Mapping]] = ..., values: _Optional[_Union[FieldRules, _Mapping]] = ..., ignore_empty: bool = ...) -> None: ... - -class AnyRules(_message.Message): - __slots__ = ("required", "not_in") - REQUIRED_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - required: bool - not_in: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, required: bool = ..., not_in: _Optional[_Iterable[str]] = ..., **kwargs) -> None: ... - -class DurationRules(_message.Message): - __slots__ = ("required", "const", "lt", "lte", "gt", "gte", "not_in") - REQUIRED_FIELD_NUMBER: _ClassVar[int] - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - IN_FIELD_NUMBER: _ClassVar[int] - NOT_IN_FIELD_NUMBER: _ClassVar[int] - required: bool - const: _duration_pb2.Duration - lt: _duration_pb2.Duration - lte: _duration_pb2.Duration - gt: _duration_pb2.Duration - gte: _duration_pb2.Duration - not_in: _containers.RepeatedCompositeFieldContainer[_duration_pb2.Duration] - def __init__(self, required: bool = ..., const: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., lt: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., lte: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., gt: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., gte: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., not_in: _Optional[_Iterable[_Union[_duration_pb2.Duration, _Mapping]]] = ..., **kwargs) -> None: ... - -class TimestampRules(_message.Message): - __slots__ = ("required", "const", "lt", "lte", "gt", "gte", "lt_now", "gt_now", "within") - REQUIRED_FIELD_NUMBER: _ClassVar[int] - CONST_FIELD_NUMBER: _ClassVar[int] - LT_FIELD_NUMBER: _ClassVar[int] - LTE_FIELD_NUMBER: _ClassVar[int] - GT_FIELD_NUMBER: _ClassVar[int] - GTE_FIELD_NUMBER: _ClassVar[int] - LT_NOW_FIELD_NUMBER: _ClassVar[int] - GT_NOW_FIELD_NUMBER: _ClassVar[int] - WITHIN_FIELD_NUMBER: _ClassVar[int] - required: bool - const: _timestamp_pb2.Timestamp - lt: _timestamp_pb2.Timestamp - lte: _timestamp_pb2.Timestamp - gt: _timestamp_pb2.Timestamp - gte: _timestamp_pb2.Timestamp - lt_now: bool - gt_now: bool - within: _duration_pb2.Duration - def __init__(self, required: bool = ..., const: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., lt: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., lte: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., gt: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., gte: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., lt_now: bool = ..., gt_now: bool = ..., within: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ...) -> None: ... diff --git a/netbox_diode_plugin/reconciler/sdk/validate/validate_pb2_grpc.py b/netbox_diode_plugin/reconciler/sdk/validate/validate_pb2_grpc.py deleted file mode 100644 index 2daafff..0000000 --- a/netbox_diode_plugin/reconciler/sdk/validate/validate_pb2_grpc.py +++ /dev/null @@ -1,4 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - diff --git a/netbox_diode_plugin/templatetags/__init__.py b/netbox_diode_plugin/templatetags/__init__.py deleted file mode 100644 index 794a126..0000000 --- a/netbox_diode_plugin/templatetags/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""Diode NetBox Plugin - Template Tags.""" From 1c26dff49ca57d3d327d35779813d4927c0a1d93 Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Thu, 6 Feb 2025 20:44:15 +0100 Subject: [PATCH 2/4] fix: docker setup with netbox 4.1.11 for netbox-branching plugin Signed-off-by: Michal Fiedorowicz --- docker/Dockerfile-diode-netbox-plugin | 2 +- docker/docker-compose.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile-diode-netbox-plugin b/docker/Dockerfile-diode-netbox-plugin index 2453ef7..ec3f9c6 100644 --- a/docker/Dockerfile-diode-netbox-plugin +++ b/docker/Dockerfile-diode-netbox-plugin @@ -1,4 +1,4 @@ -FROM netboxcommunity/netbox:v4.1-3.0.1 +FROM netboxcommunity/netbox:v4.1.11-3.0.2 COPY ./netbox/configuration/ /etc/netbox/config/ RUN chmod 755 /etc/netbox/config/* && \ diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 81dd163..c092668 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -1,7 +1,7 @@ name: diode-netbox-plugin services: netbox: &netbox - image: netboxcommunity/netbox:v4.1-3.0.1-diode-netbox-plugin + image: netboxcommunity/netbox:v4.1.11-3.0.2-diode-netbox-plugin build: context: . dockerfile: Dockerfile-diode-netbox-plugin From 228853e195359575ab15fee230e9b4bae80c89bd Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Thu, 6 Feb 2025 20:45:16 +0100 Subject: [PATCH 3/4] feat: remove ingestion logs view Signed-off-by: Michal Fiedorowicz --- netbox_diode_plugin/models.py | 8 +- netbox_diode_plugin/navigation.py | 7 - netbox_diode_plugin/tables.py | 142 -------- .../templates/diode/ingestion_logs.html | 141 -------- .../diode/ingestion_logs_paginator.html | 17 - .../templates/diode/ingestion_logs_table.html | 109 ------ .../templatetags/diode_filters.py | 35 -- .../tests/test_reconciler_sdk_client.py | 331 ------------------ netbox_diode_plugin/tests/test_tables.py | 84 ----- .../tests/test_templatetags.py | 62 ---- netbox_diode_plugin/tests/test_views.py | 189 +--------- netbox_diode_plugin/urls.py | 1 - netbox_diode_plugin/views.py | 90 +---- 13 files changed, 7 insertions(+), 1209 deletions(-) delete mode 100644 netbox_diode_plugin/tables.py delete mode 100644 netbox_diode_plugin/templates/diode/ingestion_logs.html delete mode 100644 netbox_diode_plugin/templates/diode/ingestion_logs_paginator.html delete mode 100644 netbox_diode_plugin/templates/diode/ingestion_logs_table.html delete mode 100644 netbox_diode_plugin/templatetags/diode_filters.py delete mode 100644 netbox_diode_plugin/tests/test_reconciler_sdk_client.py delete mode 100644 netbox_diode_plugin/tests/test_tables.py delete mode 100644 netbox_diode_plugin/tests/test_templatetags.py diff --git a/netbox_diode_plugin/models.py b/netbox_diode_plugin/models.py index fe0796b..a928ed1 100644 --- a/netbox_diode_plugin/models.py +++ b/netbox_diode_plugin/models.py @@ -1,19 +1,21 @@ # !/usr/bin/env python # Copyright 2024 NetBox Labs Inc """Diode NetBox Plugin - Models.""" +from urllib.parse import urlparse from django.core.exceptions import ValidationError from django.db import models from django.urls import reverse from netbox.models import NetBoxModel -from netbox_diode_plugin.reconciler.sdk.client import parse_target - def diode_target_validator(target): """Diode target validator.""" try: - _, _, _ = parse_target(target) + parsed_target = urlparse(target) + + if parsed_target.scheme not in ["grpc", "grpcs"]: + raise ValueError("target should start with grpc:// or grpcs://") except ValueError as exc: raise ValidationError(exc) diff --git a/netbox_diode_plugin/navigation.py b/netbox_diode_plugin/navigation.py index d5ba204..dc70888 100644 --- a/netbox_diode_plugin/navigation.py +++ b/netbox_diode_plugin/navigation.py @@ -4,12 +4,6 @@ from netbox.plugins import PluginMenu, PluginMenuItem -ingestion_logs = { - "link": "plugins:netbox_diode_plugin:ingestion_logs", - "link_text": "Ingestion Logs", - "staff_only": True, -} - settings = { "link": "plugins:netbox_diode_plugin:settings", "link_text": "Settings", @@ -23,7 +17,6 @@ ( "Diode", ( - PluginMenuItem(**ingestion_logs), PluginMenuItem(**settings), ), ), diff --git a/netbox_diode_plugin/tables.py b/netbox_diode_plugin/tables.py deleted file mode 100644 index 0d8869d..0000000 --- a/netbox_diode_plugin/tables.py +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""Diode NetBox Plugin - Tables.""" -import datetime - -import django_tables2 as tables -import zoneinfo -from django.conf import settings -from packaging import version - -if version.parse(settings.VERSION).major >= 4: - from core.models import ObjectType as NetBoxType -else: - from django.contrib.contenttypes.models import ContentType as NetBoxType - -from netbox.tables import BaseTable, columns -from utilities.object_types import object_type_identifier, object_type_name - -from netbox_diode_plugin.reconciler.sdk.v1 import reconciler_pb2 - -INGESTION_LOGS_TABLE_ACTIONS_TEMPLATE = """ - -""" - - -class IngestionStateColumn(tables.Column): - """Renders the ingestion state as a human-readable string.""" - - def render(self, value): - """Renders the ingestion state as a human-readable string.""" - if value: - try: - state_name = reconciler_pb2.State.Name(value) - except ValueError: - state_name = reconciler_pb2.State.Name(reconciler_pb2.State.UNSPECIFIED) - return " ".join(state_name.title().split("_")) - return None - - -class TimestampColumn(columns.DateTimeColumn): - """Custom implementation of Timestamp to render an epoch timestamp as a human-readable date.""" - - def render(self, value): - """Renders an epoch timestamp as a human-readable date.""" - if value: - current_tz = zoneinfo.ZoneInfo(settings.TIME_ZONE) - value = datetime.datetime.fromtimestamp(value / 1_000_000_000).astimezone( - current_tz - ) - return f"{value.date().isoformat()} {value.time().isoformat(timespec=self.timespec)}" - return None - - -class DataTypeColumn(columns.ContentTypeColumn): - """Custom implementation of ContentTypeColumn to render a data type based on app_label and model.""" - - def render(self, value): - """Renders a data type based on app_label and model.""" - app_label, model_name = value.split(".") - object_content_type = NetBoxType.objects.get_by_natural_key( - app_label, model_name - ) - return object_type_name(object_content_type, include_app=False) - - def value(self, value): - """Returns the value.""" - return value - - -class IngestionLogsTable(BaseTable): - """Ingestion logs table.""" - - ingestion_ts = TimestampColumn( - verbose_name="Ingestion Timestamp", - accessor="ingestion_ts", - orderable=False, - ) - - state = IngestionStateColumn( - verbose_name="State", - accessor="state", - orderable=False, - ) - - object_type = DataTypeColumn( - verbose_name="Data Type", - accessor="data_type", - orderable=False, - ) - - request_id = tables.Column( - verbose_name="Request ID", - accessor="request_id", - orderable=False, - ) - - producer = tables.Column( - verbose_name="Producer", - empty_values=(), - orderable=False, - ) - - sdk = tables.Column( - verbose_name="SDK", - empty_values=(), - orderable=False, - ) - - actions = tables.TemplateColumn( - template_code=INGESTION_LOGS_TABLE_ACTIONS_TEMPLATE, - verbose_name="", - orderable=False, - ) - - class Meta: - """Meta class.""" - - attrs = { - "class": "table table-hover table-striped table-condensed", - "td": {"class": "align-middle"}, - } - fields = ( - "ingestion_ts", - "object_type", - "state", - "producer", - "sdk", - "request_id", - "actions", - ) - empty_text = "No ingestion logs to display" - footer = False - - def render_producer(self, record): - """Renders the producer.""" - return f"{record.producer_app_name}/{record.producer_app_version}" - - def render_sdk(self, record): - """Renders the SDK.""" - return f"{record.sdk_name}/{record.sdk_version}" diff --git a/netbox_diode_plugin/templates/diode/ingestion_logs.html b/netbox_diode_plugin/templates/diode/ingestion_logs.html deleted file mode 100644 index 8b076a3..0000000 --- a/netbox_diode_plugin/templates/diode/ingestion_logs.html +++ /dev/null @@ -1,141 +0,0 @@ -{% extends 'generic/_base.html' %} -{% load buttons %} -{% load helpers %} -{% load render_table from django_tables2 %} -{% load i18n %} - -{% block title %}{% trans "Ingestion Logs" %}{% endblock %} - -{% block content %} - -{% if netbox_to_diode_user_error %} - -{% elif ingestion_logs_error %} - -{% else %} -
-
-
-
-
-
- -
Queued
-
-
- -
Changes
-
-
- -
Failed
-
-
- -
No Changes
-
-
- -
Total
-
-
-
-
-
-
-
-
-
- {% render_table ingestion_logs_table 'diode/ingestion_logs_table.html' %} - {% if ingestion_logs_table.data %} - {% include 'diode/ingestion_logs_paginator.html' with next_page_token=next_page_token total_count=total_count %} - {% endif %} -
-
-
-
-
- -{% endif %} - -{% endblock content %} diff --git a/netbox_diode_plugin/templates/diode/ingestion_logs_paginator.html b/netbox_diode_plugin/templates/diode/ingestion_logs_paginator.html deleted file mode 100644 index 99d9379..0000000 --- a/netbox_diode_plugin/templates/diode/ingestion_logs_paginator.html +++ /dev/null @@ -1,17 +0,0 @@ -{% load helpers %} -{% load i18n %} - -{% if next_page_token %} -
- Total: {{ total_count }} - - {% trans "Next Page" %} - -
-{% else %} -
-{% if total_count > 0 %} - Total: {{ total_count }} -{% endif %} -
-{% endif %} diff --git a/netbox_diode_plugin/templates/diode/ingestion_logs_table.html b/netbox_diode_plugin/templates/diode/ingestion_logs_table.html deleted file mode 100644 index b6d9fdf..0000000 --- a/netbox_diode_plugin/templates/diode/ingestion_logs_table.html +++ /dev/null @@ -1,109 +0,0 @@ -{% load django_tables2 %} -{% load i18n %} -{% load diode_filters %} - - -{% if table.show_header %} - - - {% for column in table.columns %} - {% if column.orderable %} - {{ column.header }} - {% else %} - {{ column.header }} - {% endif %} - {% endfor %} - - -{% endif %} - -{% for row in table.page.object_list|default:table.rows %} - - {% for column, cell in row.items %} - {{ cell }} - {% endfor %} - - - -
-
- {% block tabs %} - - {% endblock tabs %} -
-
-
-
-
-
{{ row.record.entity|proto_to_json }}
-
-
-
-
-
-
-
-
- {% if row.record.change_set.data != "" and row.record.change_set.data|length > 0 %} -
{{ row.record.change_set|proto_to_json }}
- {% else %} -
None
- {% endif %} -
-
-
-
-
-
-
-
- {% if row.record.error.message != "" %} -
{{ row.record.error|proto_to_json }}
- {% else %} -
None
- {% endif %} -
-
-
-
-
-
-
- - -{% empty %} -{% if table.empty_text %} - - — {{ table.empty_text }} — - -{% endif %} -{% endfor %} - -{% if table.has_footer %} - - - {% for column in table.columns %} - {{ column.footer }} - {% endfor %} - - -{% endif %} - diff --git a/netbox_diode_plugin/templatetags/diode_filters.py b/netbox_diode_plugin/templatetags/diode_filters.py deleted file mode 100644 index 466107f..0000000 --- a/netbox_diode_plugin/templatetags/diode_filters.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""Diode NetBox Plugin - Template Tags.""" - -import json - -import brotli -from django import template -from google.protobuf.json_format import MessageToJson - -from netbox_diode_plugin.reconciler.sdk.v1 import ingester_pb2, reconciler_pb2 - -register = template.Library() - - -@register.filter("proto_to_json") -def proto_to_json(value): - """Converts a protobuf message to a JSON string.""" - indent = 4 - if isinstance(value, reconciler_pb2.IngestionError) and value.message != "": - return MessageToJson(value, indent=indent) - - if isinstance(value, ingester_pb2.Entity): - return MessageToJson(value, indent=indent) - - if isinstance(value, reconciler_pb2.ChangeSet): - try: - decompressed_data = brotli.decompress(value.data) - decompressed_string = decompressed_data.decode("utf-8") - json_data = json.loads(decompressed_string) - return json.dumps(json_data, indent=indent) - except Exception: - return None - - return None diff --git a/netbox_diode_plugin/tests/test_reconciler_sdk_client.py b/netbox_diode_plugin/tests/test_reconciler_sdk_client.py deleted file mode 100644 index 3820bac..0000000 --- a/netbox_diode_plugin/tests/test_reconciler_sdk_client.py +++ /dev/null @@ -1,331 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""NetBox Labs - Tests.""" -from unittest import mock - -import grpc -import pytest -from django.test import TestCase - -import netbox_diode_plugin -from netbox_diode_plugin.reconciler.sdk.client import ( - ReconcilerClient, - ReconcilerMethodClientInterceptor, - _ClientCallDetails, - _load_certs, - parse_target, -) -from netbox_diode_plugin.reconciler.sdk.exceptions import ReconcilerClientError - - -class ReconcilerSDKClientTestCase(TestCase): - """Test case for the Reconciler SDK client.""" - - def test_init(self): - """Check we can initiate a client configuration.""" - client = ReconcilerClient( - target="grpc://localhost:8081", - api_key="foobar", - ) - - plugin_config = netbox_diode_plugin.config - - assert client.target == "localhost:8081" - assert client.name == "reconciler-sdk-python" - assert client.version == "0.0.1" - assert client.app_name == plugin_config.name - assert client.app_version == plugin_config.version - assert client.tls_verify is False - assert client.path == "" - - - def test_client_error(self): - """Check we can raise a client error.""" - with pytest.raises(ReconcilerClientError) as err: - client = ReconcilerClient( - target="grpc://invalid:8089", - api_key="foobar", - ) - client.retrieve_ingestion_logs() - - assert err.value.status_code == grpc.StatusCode.UNAVAILABLE.name - assert "DNS resolution failed for invalid:8089" in err.value.details - - - def test_client_error_non_grpc_status_code(self): - """Check we can raise a client error.""" - with pytest.raises(ReconcilerClientError) as err: - rpc_error = grpc.RpcError() - rpc_error.code = lambda: "NON_GRPC_STATUS_CODE" - rpc_error.details = lambda: "Some details about the error" - raise ReconcilerClientError(rpc_error) - - assert not isinstance(err.value.status_code, grpc.StatusCode) - assert err.value.status_code == "NON_GRPC_STATUS_CODE" - assert err.value.details == "Some details about the error" - - - def test_client_error_repr_returns_correct_string(self): - """Check we can return the correct string representation of the error.""" - grpc_error = grpc.RpcError() - grpc_error.code = lambda: grpc.StatusCode.UNAVAILABLE - grpc_error.details = lambda: "Some details about the error" - error = ReconcilerClientError(grpc_error) - error._status_code = grpc.StatusCode.UNAVAILABLE - error._details = "Some details about the error" - assert ( - repr(error) - == "" - ) - - - def test_load_certs_returns_bytes(self): - """Check that _load_certs returns bytes.""" - assert isinstance(_load_certs(), bytes) - - - def test_parse_target_handles_http_prefix(self): - """Check that parse_target raises an error when the target contains http://.""" - with pytest.raises(ValueError): - parse_target("http://localhost:8081") - - - def test_parse_target_handles_https_prefix(self): - """Check that parse_target raises an error when the target contains https://.""" - with pytest.raises(ValueError): - parse_target("https://localhost:8081") - - - def test_parse_target_parses_authority_correctly(self): - """Check that parse_target parses the authority correctly.""" - authority, path, tls_verify = parse_target("grpc://localhost:8081") - assert authority == "localhost:8081" - assert path == "" - assert tls_verify is False - - - def test_parse_target_adds_default_port_if_missing(self): - """Check that parse_target adds the default port if missing.""" - authority, _, _ = parse_target("grpc://localhost") - assert authority == "localhost:443" - - - def test_parse_target_parses_path_correctly(self): - """Check that parse_target parses the path correctly.""" - _, path, _ = parse_target("grpc://localhost:8081/my/path") - assert path == "/my/path" - - - def test_parse_target_handles_no_path(self): - """Check that parse_target handles no path.""" - _, path, _ = parse_target("grpc://localhost:8081") - assert path == "" - - - def test_parse_target_parses_tls_verify_correctly(self): - """Check that parse_target parses tls_verify correctly.""" - _, _, tls_verify = parse_target("grpcs://localhost:8081") - assert tls_verify is True - - - def test_client_sets_up_secure_channel_when_grpcs_scheme_is_found_in_target(self): - """Check that ReconcilerClient.__init__() sets up the gRPC secure channel when grpcs:// scheme is found in the target.""" - with ( - mock.patch("grpc.secure_channel") as mock_secure_channel, - mock.patch("logging.Logger.debug") as mock_debug, - ): - _ = ReconcilerClient( - target="grpcs://localhost:8081", - api_key="foobar", - ) - - mock_debug.assert_called_once_with("Setting up gRPC secure channel") - mock_secure_channel.assert_called_once() - - - def test_client_sets_up_insecure_channel_when_grpc_scheme_is_found_in_target(self): - """Check that ReconcilerClient.__init__() sets up the gRPC insecure channel when grpc:// scheme is found in the target.""" - with ( - mock.patch("grpc.insecure_channel") as mock_insecure_channel, - mock.patch("logging.Logger.debug") as mock_debug, - ): - _ = ReconcilerClient( - target="grpc://localhost:8081", - api_key="foobar", - ) - - mock_debug.assert_called_with( - "Setting up gRPC insecure channel", - ) - mock_insecure_channel.assert_called_once() - - - def test_insecure_channel_options_with_primary_user_agent(self): - """Check that ReconcilerClient.__init__() sets the gRPC primary_user_agent option for insecure channel.""" - with mock.patch("grpc.insecure_channel") as mock_insecure_channel: - client = ReconcilerClient( - target="grpc://localhost:8081", - api_key="abcde", - ) - - mock_insecure_channel.assert_called_once() - _, kwargs = mock_insecure_channel.call_args - assert kwargs["options"] == ( - ( - "grpc.primary_user_agent", - f"{client.name}/{client.version} {client.app_name}/{client.app_version}", - ), - ) - - - def test_secure_channel_options_with_primary_user_agent(self): - """Check that ReconcilerClient.__init__() sets the gRPC primary_user_agent option for secure channel.""" - with mock.patch("grpc.secure_channel") as mock_secure_channel: - client = ReconcilerClient( - target="grpcs://localhost:8081", - api_key="abcde", - ) - - mock_secure_channel.assert_called_once() - _, kwargs = mock_secure_channel.call_args - assert kwargs["options"] == ( - ( - "grpc.primary_user_agent", - f"{client.name}/{client.version} {client.app_name}/{client.app_version}", - ), - ) - - def test_client_interceptor_setup_with_path(self): - """Check that ReconcilerClient.__init__() sets up the gRPC interceptor when a path is provided.""" - with ( - mock.patch("grpc.intercept_channel") as mock_intercept_channel, - mock.patch("logging.Logger.debug") as mock_debug, - ): - _ = ReconcilerClient( - target="grpcs://localhost:8081/my-path", - api_key="foobar", - ) - - mock_debug.assert_called_with( - "Setting up gRPC interceptor for path: /my-path", - ) - mock_intercept_channel.assert_called_once() - - - def test_client_interceptor_not_setup_without_path(self): - """Check that ReconcilerClient.__init__() does not set up the gRPC interceptor when no path is provided.""" - with ( - mock.patch("grpc.intercept_channel") as mock_intercept_channel, - mock.patch("logging.Logger.debug") as mock_debug, - ): - _ = ReconcilerClient( - target="grpc://localhost:8081", - api_key="foobar", - ) - - mock_debug.assert_called_with( - "Setting up gRPC insecure channel", - ) - mock_intercept_channel.assert_not_called() - - - def test_client_properties_return_expected_values(self): - """Check that ReconcilerClient properties return the expected values.""" - client = ReconcilerClient( - target="grpc://localhost:8081", - api_key="foobar", - ) - - plugin_config = netbox_diode_plugin.config - - assert client.target == "localhost:8081" - assert client.name == "reconciler-sdk-python" - assert client.version == "0.0.1" - assert client.app_name == plugin_config.name - assert client.app_version == plugin_config.version - assert client.tls_verify is False - assert client.path == "" - assert isinstance(client.channel, grpc.Channel) - - - def test_client_enter_returns_self(self): - """Check that ReconcilerClient.__enter__() returns self.""" - client = ReconcilerClient( - target="grpc://localhost:8081", - api_key="foobar", - ) - assert client.__enter__() is client - - - def test_client_exit_closes_channel(self): - """Check that ReconcilerClient.__exit__() closes the channel.""" - client = ReconcilerClient( - target="grpc://localhost:8081", - api_key="foobar", - ) - with mock.patch.object(client._channel, "close") as mock_close: - client.__exit__(None, None, None) - mock_close.assert_called_once() - - - def test_client_close_closes_channel(self): - """Check that ReconcilerClient.close() closes the channel.""" - client = ReconcilerClient( - target="grpc://localhost:8081", - api_key="foobar", - ) - with mock.patch.object(client._channel, "close") as mock_close: - client.close() - mock_close.assert_called_once() - - - def test_interceptor_init_sets_subpath(self): - """Check that ReconcilerMethodClientInterceptor.__init__() sets the subpath.""" - interceptor = ReconcilerMethodClientInterceptor("/my/path") - assert interceptor._subpath == "/my/path" - - - def test_interceptor_intercepts_unary_unary_calls(self): - """Check that the interceptor intercepts unary unary calls.""" - interceptor = ReconcilerMethodClientInterceptor("/my/path") - - def continuation(x, _): - return x.method - - client_call_details = _ClientCallDetails( - "/diode.v1.ReconcilerService/RetrieveIngestionLogs", - None, - None, - None, - None, - None, - ) - request = None - assert ( - interceptor.intercept_unary_unary(continuation, client_call_details, request) - == "/my/path/diode.v1.ReconcilerService/RetrieveIngestionLogs" - ) - - - def test_interceptor_intercepts_stream_unary_calls(self): - """Check that ReconcilerMethodClientInterceptor.intercept_stream_unary() intercepts stream unary calls.""" - interceptor = ReconcilerMethodClientInterceptor("/my/path") - - def continuation(x, _): - return x.method - - client_call_details = _ClientCallDetails( - "/diode.v1.ReconcilerService/RetrieveIngestionLogs", - None, - None, - None, - None, - None, - ) - request_iterator = None - assert ( - interceptor.intercept_stream_unary( - continuation, client_call_details, request_iterator - ) - == "/my/path/diode.v1.ReconcilerService/RetrieveIngestionLogs" - ) diff --git a/netbox_diode_plugin/tests/test_tables.py b/netbox_diode_plugin/tests/test_tables.py deleted file mode 100644 index 38dd93e..0000000 --- a/netbox_diode_plugin/tests/test_tables.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""Diode NetBox Plugin - Tests.""" - -import datetime - -import zoneinfo -from django.conf import settings -from django.test import TestCase - -from netbox_diode_plugin.reconciler.sdk.v1 import reconciler_pb2 -from netbox_diode_plugin.tables import IngestionLogsTable - - -class IngestionLogsTableTestCase(TestCase): - """Test case for the IngestionLogsTable.""" - - def setUp(self): - """Set up mock data for the table.""" - self.mock_data = [ - reconciler_pb2.IngestionLog( - ingestion_ts=1638316800000000000, # Example timestamp in nanoseconds - state=reconciler_pb2.State.APPLIED, - data_type="dcim.site", - request_id="12345", - producer_app_name="TestApp", - producer_app_version="1.0.0", - sdk_name="TestSDK", - sdk_version="1.0.0", - ), - reconciler_pb2.IngestionLog(), - ] - - def test_ingestion_ts_rendering(self): - """Test rendering of the ingestion_ts column.""" - table = IngestionLogsTable(self.mock_data) - current_tz = zoneinfo.ZoneInfo(settings.TIME_ZONE) - expected_date = ( - datetime.datetime.fromtimestamp( - self.mock_data[0].ingestion_ts / 1_000_000_000 - ) - .astimezone(current_tz) - .date() - .isoformat() - ) - expected_time = ( - datetime.datetime.fromtimestamp( - self.mock_data[0].ingestion_ts / 1_000_000_000 - ) - .astimezone(current_tz) - .time() - .isoformat(timespec="seconds") - ) - self.assertEqual( - table.rows[0].get_cell("ingestion_ts"), f"{expected_date} {expected_time}" - ) - self.assertEqual(table.rows[1].get_cell("ingestion_ts"), None) - - def test_state_rendering(self): - """Test rendering of the state column.""" - table = IngestionLogsTable(self.mock_data) - self.assertEqual(table.rows[0].get_cell("state"), "Applied") - self.assertEqual(table.rows[1].get_cell("state"), None) - - def test_data_type_rendering(self): - """Test rendering of the data_type column.""" - table = IngestionLogsTable(self.mock_data) - self.assertEqual(table.rows[0].get_cell("object_type"), "Site") - self.assertEqual(table.rows[1].get_cell("object_type"), table.default) - - def test_producer_rendering(self): - """Test rendering of the producer column.""" - table = IngestionLogsTable(self.mock_data) - self.assertEqual(table.rows[0].get_cell("producer"), "TestApp/1.0.0") - - def test_sdk_rendering(self): - """Test rendering of the sdk column.""" - table = IngestionLogsTable(self.mock_data) - self.assertEqual(table.rows[0].get_cell("sdk"), "TestSDK/1.0.0") - - def test_request_id_rendering(self): - """Test rendering of the request_id column.""" - table = IngestionLogsTable(self.mock_data) - self.assertEqual(table.rows[0].get_cell("request_id"), "12345") diff --git a/netbox_diode_plugin/tests/test_templatetags.py b/netbox_diode_plugin/tests/test_templatetags.py deleted file mode 100644 index c500f4a..0000000 --- a/netbox_diode_plugin/tests/test_templatetags.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# Copyright 2024 NetBox Labs Inc -"""Diode NetBox Plugin - Tests.""" - -from django.test import TestCase -from google.protobuf.json_format import MessageToJson - -from netbox_diode_plugin.reconciler.sdk.v1 import ingester_pb2, reconciler_pb2 -from netbox_diode_plugin.templatetags.diode_filters import proto_to_json - - -class TestProtoToJsonTestCase(TestCase): - """Test case for the proto_to_json template filter.""" - - def test_ingestion_error_with_message(self): - """Create a mock IngestionError with a message.""" - error = reconciler_pb2.IngestionError(message="Test error") - expected_json = MessageToJson(error, indent=4) - self.assertEqual(proto_to_json(error), expected_json) - - def test_ingestion_error_without_message(self): - """Create a mock IngestionError without a message.""" - error = reconciler_pb2.IngestionError(message="") - self.assertIsNone(proto_to_json(error)) - - def test_entity(self): - """Create a mock Entity.""" - entity = ingester_pb2.Entity( - site=ingester_pb2.Site( - name="Test Site", - ) - ) - expected_json = MessageToJson(entity, indent=4) - self.assertEqual(proto_to_json(entity), expected_json) - - def test_changeset(self): - """Create a mock ChangeSet.""" - changeset = reconciler_pb2.ChangeSet( - id="ac6481de-2351-49b6-9095-75a69fe47b1f", - data=( - b'\x1b\x92\x04\x00dq-\x95\x8fnV\xc0\x9c\xdbX"\\)\xfd1N\xdd\x04\x0e,\xc0\x00\xf8\x17\xb6\x17\x96\x05' - b"4\xa6f\x0b8\x90\xa8\x0b\xc3P\xf3.z\x8e0\xd5\xb9r\xf0\x18?Y\xc4n\xb6\xe7\x82\xfa\x0b\xcb\x9f\x9f_\xf9" - b"m\xbe\xee0Ai\xc1%\xdd\x19\x8d\xf5\x1a\x1d\xd5\x80\xa4\xc8c\xf4%\xd0`\x17\xab\x1e ^\r`:\xdb\t\xeer\xec" - b"\xa9\xea\xa0MA6Dx\xc3c\xe5\xd0\xb0\xb1J\x8aUg\xed+`\xaf\x8d\x07\x13\x9cM\xe0\x81\x80\xa3\nH(\xe9\xed" - b"\xfa~\x89\xb2\x03\x02\x9an\xb20\xfd\xc2C\xb9\x0f\x9fl\xed\x80\x80\xd7\xbb\xf7\x05Lp\xf5\xfc\x9c\xbe" - b"\x95\xb7\xf7\xd746\xbc]\x7f0\xfc\xff\x0br\\\xc5-\xf8\x90\xd8a\xaa\xa6\xc2H\r\x8b\xd6\x84\xb6\x902\xb1" - b"\xda`,\nJ\xab \t;7\x80_z\x9dkn\xb9\x9c\xe0\xb1\x19\x81|\xac\x16\xabO\x16\xa6\xc3:\x1e\xcec3\xddF\xd5" - b"t\xf4-\x0c\xa4*x\xe5\xeeU\xf7\x8f\x9d\xef\xe6P@r\xeddU:\xf7\xadN\xc3\x0e\x1f\xd0\x96VA\xd7\xa44R\xd2" - b"\x8cIyK\xa5G\x1a\xad\x018\xb0\xa2\xe2\xf1\xd1\xf5\x0b\x9bk4/o3\xe4?\x03Ly\x82~Y\x80\t~\xc0\xbe\x8bCW" - b'_\x18=+\x03\xba6\xaa"1+\x8c\x81\x88\xaaM6ZB\x05\xd3k\xab\x8f\x0f\x83_\xf8\xa1\xf1\xbc\xfb\xf8x?/o\xcf' - b"\xcap\x062oM\xdf\x8a\x80RtQ\x03U\x00I\xcc\xfb\xcf\xda\xc8\nx\xe5\x97\xeb\xf2\x8d\xdb\xb7wv\x9d\x0f1" - b"\x91\xd2\xc6\xb6\xf2\xc5?" - ), - ) - - decompress = proto_to_json(changeset) - self.assertIsNotNone(decompress) - self.assertIn("ac6481de-2351-49b6-9095-75a69fe47b1f", decompress) - - def test_invalid_type(self): - """Test an invalid type.""" - self.assertIsNone(proto_to_json("invalid")) diff --git a/netbox_diode_plugin/tests/test_views.py b/netbox_diode_plugin/tests/test_views.py index 5c28ce2..aaf54ab 100644 --- a/netbox_diode_plugin/tests/test_views.py +++ b/netbox_diode_plugin/tests/test_views.py @@ -8,204 +8,17 @@ from django.contrib.messages.middleware import MessageMiddleware from django.contrib.messages.storage.fallback import FallbackStorage from django.contrib.sessions.middleware import SessionMiddleware -from django.core.cache import cache from django.test import RequestFactory, TestCase from django.urls import reverse from rest_framework import status from users.models import Token from netbox_diode_plugin.models import Setting -from netbox_diode_plugin.reconciler.sdk.v1 import ingester_pb2, reconciler_pb2 -from netbox_diode_plugin.views import IngestionLogsView, SettingsEditView, SettingsView, SetupView +from netbox_diode_plugin.views import SettingsEditView, SettingsView, SetupView User = get_user_model() -class IngestionLogsViewTestCase(TestCase): - """Test case for the IngestionLogsView.""" - - def setUp(self): - """Setup the test case.""" - self.path = reverse("plugins:netbox_diode_plugin:ingestion_logs") - self.request = RequestFactory().get(self.path) - self.view = IngestionLogsView() - self.view.setup(self.request) - cache.delete("ingestion_metrics") - - def test_returns_200_for_authenticated(self): - """Test that the view returns 200 for an authenticated user.""" - self.request.user = User.objects.create_user("foo", password="pass") - self.request.user.is_staff = True - - response = self.view.get(self.request) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - def test_redirects_to_login_page_for_unauthenticated_user(self): - """Test that the view returns 200 for an authenticated user.""" - self.request.user = AnonymousUser() - self.view.setup(self.request) - - response = IngestionLogsView.as_view()(self.request) - - self.assertEqual(response.status_code, status.HTTP_302_FOUND) - self.assertEqual(response.url, f"/netbox/login/?next={self.path}") - - def test_ingestion_logs_failed_to_retrieve(self): - """Test that the ingestion logs failed to retrieve throw an error.""" - self.request.user = User.objects.create_user("foo", password="pass") - self.request.user.is_staff = True - - response = self.view.get(self.request) - self.assertEqual(response.status_code, status.HTTP_200_OK) - self.assertIn( - "UNAVAILABLE: failed to connect to all addresses;", str(response.content) - ) - - def test_ingestion_logs_retrieve_logs(self): - """Test that the retrieved ingestion logs are rendered.""" - self.request.user = User.objects.create_user("foo", password="pass") - self.request.user.is_staff = True - - with mock.patch( - "netbox_diode_plugin.reconciler.sdk.client.ReconcilerClient.retrieve_ingestion_logs" - ) as mock_retrieve_ingestion_logs: - mock_retrieve_ingestion_logs.side_effect = ( - reconciler_pb2.RetrieveIngestionLogsResponse( - logs=[ - reconciler_pb2.IngestionLog( - data_type="dcim.site", - state=reconciler_pb2.State.APPLIED, - request_id="c6ecd1ea-b23b-4f98-8593-d01d5a0da012", - ingestion_ts=1725617988, - producer_app_name="diode-test-app", - producer_app_version="0.1.0", - sdk_name="diode-sdk-python", - sdk_version="0.1.0", - entity=ingester_pb2.Entity( - site=ingester_pb2.Site( - name="Test Site", - ), - ), - ) - ], - next_page_token="AAAAMg==", - metrics=reconciler_pb2.IngestionMetrics( - total=1, - ), - ), - reconciler_pb2.RetrieveIngestionLogsResponse( - metrics=reconciler_pb2.IngestionMetrics( - total=1, - ), - ), - ) - - response = self.view.get(self.request) - mock_retrieve_ingestion_logs.assert_called() - self.assertEqual(mock_retrieve_ingestion_logs.call_count, 2) - self.assertEqual(response.status_code, status.HTTP_200_OK) - self.assertNotIn("Server Error", str(response.content)) - - def test_cached_metrics(self): - """Test that the cached metrics are used.""" - self.request.user = User.objects.create_user("foo", password="pass") - self.request.user.is_staff = True - - with mock.patch( - "netbox_diode_plugin.reconciler.sdk.client.ReconcilerClient.retrieve_ingestion_logs" - ) as mock_retrieve_ingestion_logs: - mock_retrieve_ingestion_logs.side_effect = ( - reconciler_pb2.RetrieveIngestionLogsResponse( - logs=[ - reconciler_pb2.IngestionLog( - data_type="dcim.site", - state=reconciler_pb2.State.APPLIED, - request_id="c6ecd1ea-b23b-4f98-8593-d01d5a0da012", - ingestion_ts=1725617988, - producer_app_name="diode-test-app", - producer_app_version="0.1.0", - sdk_name="diode-sdk-python", - sdk_version="0.1.0", - entity=ingester_pb2.Entity( - site=ingester_pb2.Site( - name="Test Site", - ), - ), - ) - ], - next_page_token="AAAAMg==", - metrics=reconciler_pb2.IngestionMetrics( - total=1, - ), - ), - ) - - # Set up the cache - cache.set( - "ingestion_metrics", - { - "queued": 10, - "applied": 20, - "failed": 5, - "no_changes": 65, - "total": 1, - }, - timeout=300, - ) - - response = self.view.get(self.request) - mock_retrieve_ingestion_logs.assert_called() - self.assertEqual(mock_retrieve_ingestion_logs.call_count, 1) - self.assertEqual(response.status_code, status.HTTP_200_OK) - self.assertNotIn("Server Error", str(response.content)) - - def test_redirects_to_setup_view_on_missing_diode_user(self): - """Test that we redirect to plugin setup view if the Diode user is missing.""" - self.request.user = User.objects.create_user("foo", password="pass") - self.request.user.is_staff = True - - with ( - mock.patch( - "netbox_diode_plugin.views.get_diode_username_for_user_type" - ) as mock_get_diode_username_for_user_type, - mock.patch( - "netbox_diode_plugin.views.get_user_model" - ) as mock_get_user_model, - ): - mock_get_diode_username_for_user_type.return_value = ( - "fake-netbox-to-diode" - ) - mock_get_user_model.return_value.objects.get.side_effect = User.DoesNotExist - - response = self.view.get(self.request) - - self.assertEqual(response.status_code, status.HTTP_302_FOUND) - self.assertEqual(response.url, reverse("plugins:netbox_diode_plugin:setup")) - - def test_redirects_to_setup_view_on_missing_diode_user_token(self): - """Test that we redirect to plugin setup view if the Diode user token is missing.""" - self.request.user = User.objects.create_user("foo", password="pass") - self.request.user.is_staff = True - - with ( - mock.patch( - "netbox_diode_plugin.views.get_diode_username_for_user_type" - ) as mock_get_diode_username_for_user_type, - mock.patch( - "netbox_diode_plugin.views.Token.objects.filter" - ) as mock_token_objects_filter, - ): - mock_get_diode_username_for_user_type.return_value = ( - "netbox-to-diode" - ) - mock_token_objects_filter.return_value.exists.return_value = False - - response = self.view.get(self.request) - - self.assertEqual(response.status_code, status.HTTP_302_FOUND) - self.assertEqual(response.url, reverse("plugins:netbox_diode_plugin:setup")) - - class SettingsViewTestCase(TestCase): """Test case for the SettingsView.""" diff --git a/netbox_diode_plugin/urls.py b/netbox_diode_plugin/urls.py index 881ffd4..613c231 100644 --- a/netbox_diode_plugin/urls.py +++ b/netbox_diode_plugin/urls.py @@ -7,7 +7,6 @@ from . import views urlpatterns = ( - path("ingestion-logs/", views.IngestionLogsView.as_view(), name="ingestion_logs"), path("setup/", views.SetupView.as_view(), name="setup"), path("settings/", views.SettingsView.as_view(), name="settings"), path("settings/edit/", views.SettingsEditView.as_view(), name="settings_edit"), diff --git a/netbox_diode_plugin/views.py b/netbox_diode_plugin/views.py index 75f884b..99403d6 100644 --- a/netbox_diode_plugin/views.py +++ b/netbox_diode_plugin/views.py @@ -5,8 +5,7 @@ from django.conf import settings as netbox_settings from django.contrib import messages -from django.contrib.auth import get_user, get_user_model -from django.core.cache import cache +from django.contrib.auth import get_user_model from django.http import HttpResponseRedirect from django.shortcuts import redirect, render from django.utils.http import url_has_allowed_host_and_scheme @@ -23,9 +22,6 @@ get_diode_username_for_user_type, get_diode_usernames, ) -from netbox_diode_plugin.reconciler.sdk.client import ReconcilerClient -from netbox_diode_plugin.reconciler.sdk.exceptions import ReconcilerClientError -from netbox_diode_plugin.tables import IngestionLogsTable User = get_user_model() @@ -41,90 +37,6 @@ def redirect_to_login(request): return HttpResponseRedirect(redirect_url) -class IngestionLogsView(View): - """Ingestion logs view.""" - - INGESTION_METRICS_CACHE_KEY = "ingestion_metrics" - - def get(self, request): - """Render ingestion logs template.""" - if not request.user.is_authenticated or not request.user.is_staff: - return redirect_to_login(request) - - netbox_to_diode_username = get_diode_username_for_user_type("netbox_to_diode") - try: - user = get_user_model().objects.get(username=netbox_to_diode_username) - except User.DoesNotExist: - return redirect("plugins:netbox_diode_plugin:setup") - - if not Token.objects.filter(user=user).exists(): - return redirect("plugins:netbox_diode_plugin:setup") - - token = Token.objects.get(user=user) - - settings = Setting.objects.get() - - diode_target_override = get_plugin_config( - "netbox_diode_plugin", "diode_target_override" - ) - diode_target = diode_target_override or settings.diode_target - - reconciler_client = ReconcilerClient( - target=diode_target, - api_key=token.key, - ) - - page_size = 50 - - try: - ingestion_logs_filters = { - "page_size": page_size, - } - request_page_token = request.GET.get("page_token") - if request_page_token is not None: - ingestion_logs_filters["page_token"] = request_page_token - - resp = reconciler_client.retrieve_ingestion_logs(**ingestion_logs_filters) - table = IngestionLogsTable(resp.logs) - - cached_ingestion_metrics = cache.get(self.INGESTION_METRICS_CACHE_KEY) - if ( - cached_ingestion_metrics is not None - and cached_ingestion_metrics["total"] == resp.metrics.total - ): - metrics = cached_ingestion_metrics - else: - ingestion_metrics = reconciler_client.retrieve_ingestion_logs( - only_metrics=True - ) - metrics = { - "queued": ingestion_metrics.metrics.queued or 0, - "reconciled": ingestion_metrics.metrics.reconciled or 0, - "failed": ingestion_metrics.metrics.failed or 0, - "no_changes": ingestion_metrics.metrics.no_changes or 0, - "total": ingestion_metrics.metrics.total or 0, - } - cache.set( - self.INGESTION_METRICS_CACHE_KEY, - metrics, - timeout=300, - ) - - context = { - "next_page_token": resp.next_page_token, - "ingestion_logs_table": table, - "total_count": resp.metrics.total, - "ingestion_metrics": metrics, - } - - except ReconcilerClientError as error: - context = { - "ingestion_logs_error": error, - } - - return render(request, "diode/ingestion_logs.html", context) - - class SettingsView(View): """Settings view.""" From 79a518585119027f46c37fb88e417d4629d88abf Mon Sep 17 00:00:00 2001 From: Michal Fiedorowicz Date: Thu, 6 Feb 2025 20:52:09 +0100 Subject: [PATCH 4/4] chore: update CODEOWNERS Signed-off-by: Michal Fiedorowicz --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 47b6708..ab07f99 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @leoparente @mfiedorowicz +* @leoparente @ltucker @mfiedorowicz