diff --git a/.gitignore b/.gitignore index 0bae168..a9e6d3c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ aos_api_client.egg-info build dist -*/.pytest_cache \ No newline at end of file +*/.pytest_cache +*/__pycache__ diff --git a/aos/client.py b/aos/client.py index fba2613..cb273a0 100644 --- a/aos/client.py +++ b/aos/client.py @@ -4,12 +4,14 @@ # LICENSE file at http://www.apstra.com/eula import logging import requests + from .aos import AosRestAPI, AosAuth from .blueprint import AosBlueprint from .devices import AosDevices from .design import AosDesign from .resources import AosResources from .external_systems import AosExternalSystems +from .telemetry import AosTelemetryManager logger = logging.getLogger(__name__) @@ -53,3 +55,4 @@ def __init__( self.design = AosDesign(self.rest) self.resources = AosResources(self.rest) self.external_systems = AosExternalSystems(self.rest) + self.telemetry_mgr = AosTelemetryManager(self.rest) diff --git a/aos/devices.py b/aos/devices.py index 08577c6..8245558 100644 --- a/aos/devices.py +++ b/aos/devices.py @@ -211,8 +211,8 @@ def iter_all(self) -> Generator[SystemAgent, None, None]: for s in system_agents.get("items", []): yield SystemAgent.from_json(s) - def get_agent_by_id(self, system_id: str) -> Optional[System]: - return System.from_json( + def get_agent_by_id(self, system_id: str) -> Optional[SystemAgent]: + return SystemAgent.from_json( self.rest.json_resp_get(f"/api/system-agents/{system_id}") ) diff --git a/aos/telemetry.py b/aos/telemetry.py new file mode 100644 index 0000000..8404d0e --- /dev/null +++ b/aos/telemetry.py @@ -0,0 +1,131 @@ +# Copyright 2020-present, Apstra, Inc. All rights reserved. +# +# This source code is licensed under End User License Agreement found in the +# LICENSE file at http://www.apstra.com/eula +from dataclasses import dataclass +from typing import List + +from requests import Response +from aos.aos import AosSubsystem + + +@dataclass +class AosTelemetryEndpointStatus: + """ + Represent the AosTelemetry Endpoint. + This is used to build out the Endpoint structure + """ + + connected: bool + connection_log: List[dict] + connection_time: str + last_tx_time: str + epoch: str + connection_reset_count: int + dns_log: List[dict] + disconnection_time: str + + @classmethod + def from_json(cls, d: dict) -> "AosTelemetryEndpointStatus": + return AosTelemetryEndpointStatus( + connected=d.get("connected"), + connection_log=d.get("connectionLog"), + connection_time=d.get("connectionTime"), + last_tx_time=d.get("lastTransmitedTime"), + epoch=d.get("epoch"), + connection_reset_count=d.get("connectionResetCount"), + dns_log=d.get("dnsLog"), + disconnection_time=d.get("disconnectionTime"), + ) + + +@dataclass +class AosTelemetryEndpoint: + """ + Represents the AosTelemetryEndpoint + """ + + id: str + host: str + port: int + streaming_type: str + protocol: str + sequencing_mode: str + ep_status: AosTelemetryEndpointStatus + + @classmethod + def from_json(cls, d: dict) -> "AosTelemetryEndpoint": + return AosTelemetryEndpoint( + id=d.get("id"), + host=d.get("host"), + port=d.get("port"), + streaming_type=d.get("streaming_type"), + protocol=d.get("protocol"), + sequencing_mode=d.get("sequencing_mode"), + ep_status=AosTelemetryEndpointStatus.from_json(d.get("status")), + ) + + +class AosTelemetryManager(AosSubsystem): + """ + Telemetry manager class used to manage the telemetry endpoints + """ + + def add_endpoint( + self, + host: str, + port: int, + streaming_type: str, + protocol: str = "protoBufOverTcp", + mode: str = "sequenced", + ) -> Response: + """ + Parameters + ---------- + host + (str) AOS server url or ip address + port + (int) AOS server port (ex 80, 443) + streaming_type + (str) Type of telemetry to stream (alerts/events/perfmon) + protocol + (str) Protocol for data default is protoBufOverTcp + mode + (str) sequenced/unsequenced. default is sequenced + + """ + body = { + "hostname": host, + "port": port, + "streaming_type": streaming_type, + "sequencing_mode": mode, + "protocol": protocol, + } + return self.rest.json_resp_post(uri="/api/streaming-config", data=body) + + def get_endpoints(self) -> List[AosTelemetryEndpoint]: + """ + Get the existing streaming endpoints as AosTelemetryEndpoint objects + """ + r = self.rest.json_resp_get(uri="/api/streaming-config") + return [AosTelemetryEndpoint.from_json(i) for i in r.get("items")] + + def delete_endpoint(self, id: str) -> Response: + """ + Delete a single endpoint + Parameters + ---------- + id + (str) id of the endpoint + """ + return self.rest.delete(uri="/api/streaming-config/" + id) + + def delete_all_endpoints(self) -> List[bool]: + """ + Cycle through and delete all the streaming endpoints. + """ + eps = self.get_endpoints() + ret = [] + for ep in eps: + ret.append(self.delete_endpoint(ep.id)) + return True diff --git a/scripts/telemetry/aosstream_pb2.py b/scripts/telemetry/aosstream_pb2.py new file mode 100644 index 0000000..e22f389 --- /dev/null +++ b/scripts/telemetry/aosstream_pb2.py @@ -0,0 +1,755 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: aosstream.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0f\x61osstream.proto\x12\raos.streaming\"=\n\x10\x44\x65viceStateEvent\x12)\n\x05state\x18\x01 \x02(\x0e\x32\x1a.aos.streaming.DeviceState\"\xd3\x02\n\x0cTrafficEvent\x12+\n\tnode_role\x18\x01 \x01(\x0e\x32\x16.aos.streaming.FeatureH\x00\x12+\n\tport_role\x18\x02 \x01(\x0e\x32\x16.aos.streaming.FeatureH\x00\x12\x0e\n\x04port\x18\x03 \x01(\tH\x00\x12\x0e\n\x04node\x18\x04 \x01(\tH\x00\x12\r\n\x03pod\x18\x05 \x01(\x08H\x00\x12\x18\n\x10interval_seconds\x18\x06 \x02(\r\x12\x18\n\x10measurement_name\x18\x07 \x02(\t\x12\x38\n\x10\x61ggregation_type\x18\x08 \x02(\x0e\x32\x1e.aos.streaming.AggregationType\x12\x1a\n\x10\x64\x65lta_percentage\x18\t \x01(\x05H\x01\x12\x1d\n\x13\x64\x65lta_nonnormalized\x18\n \x01(\x03H\x01\x42\x08\n\x06sourceB\x07\n\x05\x64\x65lta\"\xff\x01\n\x0eStreamingEvent\x12\x12\n\naos_server\x18\x01 \x02(\t\x12\x34\n\x0estreaming_type\x18\x02 \x02(\x0e\x32\x1c.aos.streaming.StreamingType\x12\x32\n\x08protocol\x18\x03 \x02(\x0e\x32 .aos.streaming.StreamingProtocol\x12.\n\x06status\x18\x04 \x02(\x0e\x32\x1e.aos.streaming.StreamingStatus\x12?\n\x0fsequencing_mode\x18\x05 \x01(\x0e\x32&.aos.streaming.StreamingSequencingMode\"\x91\x01\n\x0e\x43\x61\x62lePeerEvent\x12\x15\n\rlcl_device_id\x18\x01 \x02(\t\x12\x14\n\x0clcl_hostname\x18\x02 \x02(\t\x12\x12\n\nlcl_ifname\x18\x03 \x02(\t\x12\x14\n\x0crmt_hostname\x18\x04 \x02(\t\x12\x12\n\nrmt_ifname\x18\x05 \x02(\t\x12\x14\n\x0crmt_sysdescr\x18\x06 \x02(\t\"\xf0\x01\n\x10\x42GPNeighborEvent\x12\x14\n\x0clcl_hostname\x18\x01 \x02(\t\x12\x12\n\nlcl_ipaddr\x18\x02 \x02(\t\x12\x0f\n\x07lcl_asn\x18\x03 \x02(\r\x12-\n\x05state\x18\x04 \x02(\x0e\x32\x1e.aos.streaming.BgpSessionState\x12\x12\n\nrmt_ipaddr\x18\x05 \x02(\t\x12\x0f\n\x07rmt_asn\x18\x06 \x02(\r\x12\x10\n\x08vrf_name\x18\x07 \x02(\t\x12;\n\x0b\x61\x64\x64r_family\x18\x08 \x02(\x0e\x32&.aos.streaming.BgpSessionAddressFamily\"]\n\x0fLinkStatusEvent\x12\x10\n\x08hostname\x18\x01 \x02(\t\x12\x0e\n\x06ifname\x18\x02 \x02(\t\x12(\n\x05state\x18\x03 \x02(\x0e\x32\x19.aos.streaming.LinkStatus\"f\n\x08MacEvent\x12\x12\n\nmacaddress\x18\x01 \x02(\t\x12\x10\n\x08intfname\x18\x02 \x02(\t\x12\x0c\n\x04vlan\x18\x03 \x02(\r\x12&\n\x05state\x18\x04 \x02(\x0e\x32\x17.aos.streaming.MacState\"u\n\x08\x41rpEvent\x12\x11\n\tipaddress\x18\x01 \x02(\t\x12\x0b\n\x03mac\x18\x02 \x02(\t\x12\x10\n\x08intfname\x18\x03 \x02(\t\x12&\n\x05state\x18\x04 \x02(\x0e\x32\x17.aos.streaming.ArpState\x12\x0f\n\x07vrfname\x18\x05 \x02(\t\"^\n\x08LagEvent\x12\x10\n\x08hostname\x18\x01 \x02(\t\x12\x0f\n\x07lagname\x18\x02 \x02(\t\x12\x19\n\x11interfacesupcount\x18\x03 \x02(\r\x12\x14\n\x0cinterfacesup\x18\x04 \x03(\t\"\x98\x01\n\tMlagEvent\x12\x11\n\tdomain_id\x18\x01 \x02(\t\x12\x34\n\x0c\x64omain_state\x18\x02 \x02(\x0e\x32\x1e.aos.streaming.MlagDomainState\x12\x10\n\x08intfname\x18\x03 \x02(\t\x12\x30\n\nintf_state\x18\x04 \x02(\x0e\x32\x1c.aos.streaming.MlagIntfState\"4\n\x16\x45xtensibleServiceEvent\x12\x0b\n\x03key\x18\x01 \x02(\t\x12\r\n\x05value\x18\x02 \x02(\t\"e\n\nRouteEvent\x12\x14\n\x0c\x64\x65st_network\x18\x01 \x02(\t\x12/\n\x06status\x18\x02 \x02(\x0e\x32\x1f.aos.streaming.RouteEntryStatus\x12\x10\n\x08hostname\x18\x03 \x02(\t\"\x89\x01\n\x13\x45vpnType3RouteEvent\x12(\n\x05state\x18\x01 \x02(\x0e\x32\x19.aos.streaming.RouteState\x12\x11\n\tsystem_id\x18\x02 \x02(\t\x12\x0b\n\x03vni\x18\x03 \x02(\r\x12\x10\n\x08next_hop\x18\x04 \x02(\t\x12\n\n\x02rd\x18\x05 \x02(\t\x12\n\n\x02rt\x18\x06 \x02(\t\"n\n\x14\x41\x63tiveFloodlistEvent\x12(\n\x05state\x18\x01 \x02(\x0e\x32\x19.aos.streaming.RouteState\x12\x11\n\tsystem_id\x18\x02 \x02(\t\x12\x0b\n\x03vni\x18\x03 \x02(\r\x12\x0c\n\x04vtep\x18\x04 \x02(\t\"\x98\x01\n\x13\x45vpnType5RouteEvent\x12(\n\x05state\x18\x01 \x02(\x0e\x32\x19.aos.streaming.RouteState\x12\x11\n\tsystem_id\x18\x02 \x02(\t\x12\n\n\x02\x61\x66\x18\x03 \x02(\t\x12\x0e\n\x06subnet\x18\x04 \x02(\t\x12\x10\n\x08next_hop\x18\x05 \x02(\t\x12\n\n\x02rd\x18\x06 \x02(\t\x12\n\n\x02rt\x18\x07 \x02(\t\"\x8c\x05\n\x05\x45vent\x12\n\n\x02id\x18\x01 \x02(\t\x12\x37\n\x0c\x64\x65vice_state\x18\x02 \x01(\x0b\x32\x1f.aos.streaming.DeviceStateEventH\x00\x12\x32\n\tstreaming\x18\x03 \x01(\x0b\x32\x1d.aos.streaming.StreamingEventH\x00\x12\x33\n\ncable_peer\x18\x04 \x01(\x0b\x32\x1d.aos.streaming.CablePeerEventH\x00\x12\x37\n\x0c\x62gp_neighbor\x18\x05 \x01(\x0b\x32\x1f.aos.streaming.BGPNeighborEventH\x00\x12\x35\n\x0blink_status\x18\x06 \x01(\x0b\x32\x1e.aos.streaming.LinkStatusEventH\x00\x12.\n\x07traffic\x18\x07 \x01(\x0b\x32\x1b.aos.streaming.TrafficEventH\x00\x12,\n\tmac_state\x18\x08 \x01(\x0b\x32\x17.aos.streaming.MacEventH\x00\x12,\n\tarp_state\x18\t \x01(\x0b\x32\x17.aos.streaming.ArpEventH\x00\x12,\n\tlag_state\x18\n \x01(\x0b\x32\x17.aos.streaming.LagEventH\x00\x12.\n\nmlag_state\x18\x0b \x01(\x0b\x32\x18.aos.streaming.MlagEventH\x00\x12\x41\n\x10\x65xtensible_event\x18\x0c \x01(\x0b\x32%.aos.streaming.ExtensibleServiceEventH\x00\x12\x30\n\x0broute_state\x18\r \x01(\x0b\x32\x19.aos.streaming.RouteEventH\x00\x42\x06\n\x04\x64\x61ta\"C\n\rHostnameAlert\x12\x19\n\x11\x65xpected_hostname\x18\x01 \x02(\t\x12\x17\n\x0f\x61\x63tual_hostname\x18\x02 \x02(\t\"\x16\n\x14\x43onfigDeviationAlert\"N\n\rLivenessAlert\x12\x17\n\x0f\x65xpected_agents\x18\x01 \x03(\t\x12\x15\n\ractual_agents\x18\x02 \x03(\t\x12\r\n\x05\x61live\x18\x03 \x02(\x08\"@\n\x0f\x45xtensibleAlert\x12\x0b\n\x03key\x18\x01 \x02(\t\x12\x10\n\x08\x65xpected\x18\x02 \x02(\t\x12\x0e\n\x06\x61\x63tual\x18\x03 \x02(\t\"\x99\x01\n\x0f\x44\x65ploymentAlert\x12\x43\n\x1a\x65xpected_deployment_status\x18\x01 \x02(\x0e\x32\x1f.aos.streaming.DeploymentStatus\x12\x41\n\x18\x61\x63tual_deployment_status\x18\x02 \x02(\x0e\x32\x1f.aos.streaming.DeploymentStatus\"1\n\x17\x42lueprintRenderingAlert\x12\x16\n\x0e\x66\x61iled_systems\x18\x01 \x03(\t\"\x94\x01\n\nRouteAlert\x12\n\n\x02ip\x18\x01 \x02(\t\x12=\n\x14\x65xpected_dest_status\x18\x02 \x02(\x0e\x32\x1f.aos.streaming.RouteEntryStatus\x12;\n\x12\x61\x63tual_dest_status\x18\x03 \x02(\x0e\x32\x1f.aos.streaming.RouteEntryStatus\"\xa3\x01\n\x08LagAlert\x12\x10\n\x08hostname\x18\x01 \x02(\t\x12\x0f\n\x07lagname\x18\x02 \x02(\t\x12\x1b\n\x13\x65xpected_ifup_count\x18\x05 \x02(\r\x12\x19\n\x11\x61\x63tual_ifup_count\x18\x06 \x02(\r\x12\x1e\n\x16\x65xpected_interfaces_up\x18\x07 \x03(\t\x12\x1c\n\x14\x61\x63tual_interfaces_up\x18\x08 \x03(\t\"\x84\x02\n\x0eStreamingAlert\x12\x12\n\naos_server\x18\x01 \x02(\t\x12\x34\n\x0estreaming_type\x18\x02 \x02(\x0e\x32\x1c.aos.streaming.StreamingType\x12\x32\n\x08protocol\x18\x03 \x02(\x0e\x32 .aos.streaming.StreamingProtocol\x12\x33\n\x06reason\x18\x04 \x02(\x0e\x32#.aos.streaming.StreamingAlertReason\x12?\n\x0fsequencing_mode\x18\x05 \x01(\x0e\x32&.aos.streaming.StreamingSequencingMode\"\xac\x01\n\x16\x43\x61\x62lePeerMismatchAlert\x12\x14\n\x0clcl_hostname\x18\x01 \x02(\t\x12\x12\n\nlcl_ifname\x18\x02 \x02(\t\x12\x14\n\x0c\x65xp_hostname\x18\x04 \x02(\t\x12\x12\n\nexp_ifname\x18\x05 \x02(\t\x12\x14\n\x0crmt_hostname\x18\x06 \x02(\t\x12\x12\n\nrmt_ifname\x18\x07 \x02(\t\x12\x14\n\x0crmt_sysdescr\x18\x08 \x02(\t\"\xc9\x02\n\x18\x42GPNeighborMismatchAlert\x12\x14\n\x0clcl_hostname\x18\x01 \x02(\t\x12\x12\n\nlcl_ipaddr\x18\x02 \x02(\t\x12\x0f\n\x07lcl_asn\x18\x03 \x02(\r\x12\x12\n\nrmt_ipaddr\x18\x04 \x02(\t\x12\x0f\n\x07rmt_asn\x18\x05 \x02(\r\x12\x36\n\x0e\x65xpected_state\x18\x06 \x02(\x0e\x32\x1e.aos.streaming.BgpSessionState\x12\x34\n\x0c\x61\x63tual_state\x18\x07 \x02(\x0e\x32\x1e.aos.streaming.BgpSessionState\x12\x10\n\x08rmt_name\x18\x08 \x02(\t\x12\x10\n\x08vrf_name\x18\t \x02(\t\x12;\n\x0b\x61\x64\x64r_family\x18\n \x02(\x0e\x32&.aos.streaming.BgpSessionAddressFamily\"\xae\x01\n InterfaceLinkStatusMismatchAlert\x12\x10\n\x08hostname\x18\x01 \x02(\t\x12\x0e\n\x06ifname\x18\x02 \x02(\t\x12\x34\n\x11\x65xpected_ifstatus\x18\x03 \x02(\x0e\x32\x19.aos.streaming.LinkStatus\x12\x32\n\x0f\x61\x63tual_ifstatus\x18\x04 \x02(\x0e\x32\x19.aos.streaming.LinkStatus\"\x8c\x02\n\rCountersAlert\x12+\n\tnode_role\x18\x01 \x01(\x0e\x32\x16.aos.streaming.FeatureH\x00\x12+\n\tport_role\x18\x02 \x01(\x0e\x32\x16.aos.streaming.FeatureH\x00\x12\x0e\n\x04port\x18\x03 \x01(\tH\x00\x12\x0e\n\x04node\x18\x04 \x01(\tH\x00\x12\r\n\x03pod\x18\x05 \x01(\x08H\x00\x12\x18\n\x10measurement_name\x18\x06 \x02(\t\x12\x18\n\x10interval_seconds\x18\x07 \x02(\r\x12\x38\n\x10\x61ggregation_type\x18\x08 \x02(\x0e\x32\x1e.aos.streaming.AggregationTypeB\x04\n\x02id\"*\n\x0cKeyValuePair\x12\x0b\n\x03key\x18\x01 \x02(\t\x12\r\n\x05value\x18\x02 \x02(\t\"\x88\x03\n\nProbeAlert\x12\x14\n\x0c\x65xpected_int\x18\x02 \x01(\x03\x12\x12\n\nactual_int\x18\x03 \x01(\x03\x12\x16\n\x0e\x65xpected_float\x18\x04 \x01(\x01\x12\x14\n\x0c\x61\x63tual_float\x18\x05 \x01(\x01\x12\x1f\n\x17\x65xpected_discrete_state\x18\x06 \x01(\t\x12\x1d\n\x15\x61\x63tual_discrete_state\x18\x07 \x01(\t\x12\x10\n\x08probe_id\x18\x08 \x02(\t\x12\x12\n\nstage_name\x18\t \x02(\t\x12\x34\n\x0fkey_value_pairs\x18\n \x03(\x0b\x32\x1b.aos.streaming.KeyValuePair\x12\x0f\n\x07item_id\x18\x0b \x02(\t\x12\x15\n\rexpected_text\x18\x0c \x01(\t\x12\x13\n\x0b\x61\x63tual_text\x18\r \x01(\t\x12\x13\n\x0bprobe_label\x18\x0e \x01(\t\x12\x18\n\x10\x65xpected_int_max\x18\x0f \x01(\x03\x12\x1a\n\x12\x65xpected_float_max\x18\x10 \x01(\x01\"A\n\x13\x43onfigMismatchAlert\x12\x14\n\x0c\x62lueprint_id\x18\x01 \x02(\t\x12\x14\n\x0c\x63ollector_id\x18\x02 \x02(\t\"}\n\rHeadroomAlert\x12\x0e\n\x06node_a\x18\x01 \x02(\t\x12\x0e\n\x06node_b\x18\x02 \x02(\t\x12\x18\n\x10interval_seconds\x18\x03 \x02(\r\x12\x32\n\rheadroom_type\x18\x04 \x02(\x0e\x32\x1b.aos.streaming.HeadroomType\"\x8e\x01\n\x08MacAlert\x12\x12\n\nmacaddress\x18\x01 \x02(\t\x12\x10\n\x08intfname\x18\x02 \x02(\t\x12\x0c\n\x04vlan\x18\x03 \x02(\r\x12\x11\n\tmovecount\x18\x04 \x02(\r\x12\x1c\n\x14\x61\x63tual_move_interval\x18\x05 \x02(\x01\x12\x1d\n\x15\x65xpected_max_interval\x18\x06 \x02(\x01\"<\n\x08\x41rpAlert\x12\x11\n\tipaddress\x18\x01 \x02(\t\x12\x0b\n\x03mac\x18\x02 \x02(\t\x12\x10\n\x08intfname\x18\x03 \x02(\t\"\x91\x03\n\tMlagAlert\x12\x10\n\x08hostname\x18\x01 \x02(\t\x12\x11\n\tdomain_id\x18\x02 \x02(\t\x12\x0f\n\x07mlag_id\x18\x03 \x02(\r\x12=\n\x15\x65xpected_domain_state\x18\x04 \x02(\x0e\x32\x1e.aos.streaming.MlagDomainState\x12;\n\x13\x61\x63tual_domain_state\x18\x05 \x02(\x0e\x32\x1e.aos.streaming.MlagDomainState\x12\x0e\n\x06ifname\x18\x06 \x02(\t\x12\x39\n\x13\x65xpected_intf_state\x18\x07 \x02(\x0e\x32\x1c.aos.streaming.MlagIntfState\x12\x37\n\x11\x61\x63tual_intf_state\x18\x08 \x02(\x0e\x32\x1c.aos.streaming.MlagIntfState\x12\x11\n\tpeer_link\x18\t \x02(\t\x12\x18\n\x10peer_link_status\x18\n \x02(\t\x12!\n\x19\x65xpected_peer_link_status\x18\x0b \x02(\t\"\x1d\n\tTestAlert\x12\x10\n\x08test_int\x18\x01 \x02(\x04\"\xd1\x03\n\x11InterfaceCounters\x12\x1a\n\x12tx_unicast_packets\x18\x01 \x02(\x04\x12\x1c\n\x14tx_broadcast_packets\x18\x02 \x02(\x04\x12\x1c\n\x14tx_multicast_packets\x18\x03 \x02(\x04\x12\x10\n\x08tx_bytes\x18\x04 \x02(\x04\x12\x1a\n\x12rx_unicast_packets\x18\x05 \x02(\x04\x12\x1c\n\x14rx_broadcast_packets\x18\x06 \x02(\x04\x12\x1c\n\x14rx_multicast_packets\x18\x07 \x02(\x04\x12\x10\n\x08rx_bytes\x18\x08 \x02(\x04\x12\x18\n\x10tx_error_packets\x18\t \x02(\x04\x12\x1a\n\x12tx_discard_packets\x18\n \x02(\x04\x12\x18\n\x10rx_error_packets\x18\x0b \x02(\x04\x12\x1a\n\x12rx_discard_packets\x18\x0c \x02(\x04\x12\x18\n\x10\x61lignment_errors\x18\r \x02(\x04\x12\x12\n\nfcs_errors\x18\x0e \x02(\x04\x12\x15\n\rsymbol_errors\x18\x0f \x02(\x04\x12\r\n\x05runts\x18\x10 \x02(\x04\x12\x0e\n\x06giants\x18\x11 \x02(\x04\x12\x18\n\rdelta_seconds\x18\x12 \x01(\x04:\x01\x35\"o\n\nSystemInfo\x12\x10\n\x08\x63pu_user\x18\x01 \x02(\x02\x12\x12\n\ncpu_system\x18\x02 \x02(\x02\x12\x10\n\x08\x63pu_idle\x18\x03 \x02(\x02\x12\x13\n\x0bmemory_used\x18\x04 \x02(\x04\x12\x14\n\x0cmemory_total\x18\x05 \x02(\x04\"^\n\x0bProcessInfo\x12\x14\n\x0cprocess_name\x18\x01 \x02(\t\x12\x10\n\x08\x63pu_user\x18\x02 \x02(\x02\x12\x12\n\ncpu_system\x18\x03 \x02(\x02\x12\x13\n\x0bmemory_used\x18\x04 \x02(\x04\"0\n\x08\x46ileInfo\x12\x11\n\tfile_name\x18\x01 \x02(\t\x12\x11\n\tfile_size\x18\x02 \x02(\x04\"\xa3\x01\n\x13SysResourceCounters\x12.\n\x0bsystem_info\x18\x01 \x01(\x0b\x32\x19.aos.streaming.SystemInfo\x12\x30\n\x0cprocess_info\x18\x02 \x03(\x0b\x32\x1a.aos.streaming.ProcessInfo\x12*\n\tfile_info\x18\x03 \x03(\x0b\x32\x17.aos.streaming.FileInfo\"b\n\x03Tag\x12\x0c\n\x04name\x18\x05 \x02(\t\x12\x15\n\x0bint64_value\x18\x01 \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\x02 \x01(\x02H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x42\x07\n\x05value\"d\n\x05\x46ield\x12\x0c\n\x04name\x18\x05 \x02(\t\x12\x15\n\x0bint64_value\x18\x01 \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\x02 \x01(\x02H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x42\x07\n\x05value\",\n\rProbeProperty\x12\x0c\n\x04name\x18\x05 \x02(\t\x12\r\n\x05value\x18\x06 \x02(\t\"\xfd\x03\n\x1cInterfaceCountersUtilization\x12\x16\n\x0etx_utilization\x18\x01 \x02(\x04\x12\x16\n\x0erx_utilization\x18\x02 \x02(\x04\x12\x16\n\x0etx_unicast_pps\x18\x03 \x02(\x04\x12\x18\n\x10tx_broadcast_pps\x18\x04 \x02(\x04\x12\x18\n\x10tx_multicast_pps\x18\x05 \x02(\x04\x12\x0e\n\x06tx_bps\x18\x06 \x02(\x04\x12\x14\n\x0ctx_error_pps\x18\x07 \x02(\x04\x12\x16\n\x0etx_discard_pps\x18\x08 \x02(\x04\x12\x16\n\x0erx_unicast_pps\x18\t \x02(\x04\x12\x18\n\x10rx_broadcast_pps\x18\n \x02(\x04\x12\x18\n\x10rx_multicast_pps\x18\x0b \x02(\x04\x12\x0e\n\x06rx_bps\x18\x0c \x02(\x04\x12\x14\n\x0crx_error_pps\x18\r \x02(\x04\x12\x16\n\x0erx_discard_pps\x18\x0e \x02(\x04\x12#\n\x1b\x61lignment_errors_per_second\x18\x0f \x02(\x04\x12\x1d\n\x15\x66\x63s_errors_per_second\x18\x10 \x02(\x04\x12 \n\x18symbol_errors_per_second\x18\x11 \x02(\x04\x12\x18\n\x10runts_per_second\x18\x12 \x02(\x04\x12\x19\n\x11giants_per_second\x18\x13 \x02(\x04\"\xd4\x01\n\x1aSystemInterfaceUtilization\x12\x18\n\x10\x61ggregate_tx_bps\x18\x01 \x02(\r\x12\x18\n\x10\x61ggregate_rx_bps\x18\x02 \x02(\r\x12\x1e\n\x16max_ifc_tx_utilization\x18\x03 \x02(\r\x12\x1e\n\x16max_ifc_rx_utilization\x18\x04 \x02(\r\x12 \n\x18\x61ggregate_tx_utilization\x18\x05 \x02(\r\x12 \n\x18\x61ggregate_rx_utilization\x18\x06 \x02(\r\"\xe6\x04\n\x0cProbeMessage\x12.\n\x08property\x18\x01 \x03(\x0b\x32\x1c.aos.streaming.ProbeProperty\x12\x15\n\x0bint64_value\x18\x02 \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\x03 \x01(\x02H\x00\x12\x16\n\x0cstring_value\x18\x04 \x01(\tH\x00\x12\x44\n\x16\x65vpn_type3_route_state\x18\t \x01(\x0b\x32\".aos.streaming.EvpnType3RouteEventH\x00\x12\x44\n\x16\x65vpn_type5_route_state\x18\n \x01(\x0b\x32\".aos.streaming.EvpnType5RouteEventH\x00\x12U\n\x1einterface_counters_utilization\x18\x0b \x01(\x0b\x32+.aos.streaming.InterfaceCountersUtilizationH\x00\x12Q\n\x1csystem_interface_utilization\x18\x0c \x01(\x0b\x32).aos.streaming.SystemInterfaceUtilizationH\x00\x12?\n\x10\x61\x63tive_floodlist\x18\r \x01(\x0b\x32#.aos.streaming.ActiveFloodlistEventH\x00\x12\x10\n\x08probe_id\x18\x05 \x02(\t\x12\x12\n\nstage_name\x18\x06 \x02(\t\x12\x14\n\x0c\x62lueprint_id\x18\x07 \x02(\t\x12\x0f\n\x07item_id\x18\x08 \x02(\t\x12\x13\n\x0bprobe_label\x18\x0e \x01(\tB\x07\n\x05value\"_\n\x15GenericPerfmonMessage\x12 \n\x04tags\x18\x01 \x03(\x0b\x32\x12.aos.streaming.Tag\x12$\n\x06\x66ields\x18\x02 \x03(\x0b\x32\x14.aos.streaming.Field\"S\n\tProbeData\x12 \n\x04tags\x18\x01 \x03(\x0b\x32\x12.aos.streaming.Tag\x12$\n\x06\x66ields\x18\x02 \x03(\x0b\x32\x14.aos.streaming.Field\"\x9c\x02\n\x07PerfMon\x12>\n\x12interface_counters\x18\x01 \x01(\x0b\x32 .aos.streaming.InterfaceCountersH\x00\x12\x46\n\x18system_resource_counters\x18\x02 \x01(\x0b\x32\".aos.streaming.SysResourceCountersH\x00\x12\x37\n\x07generic\x18\x04 \x01(\x0b\x32$.aos.streaming.GenericPerfmonMessageH\x00\x12\x34\n\rprobe_message\x18\x05 \x01(\x0b\x32\x1b.aos.streaming.ProbeMessageH\x00\x12\x12\n\ntime_delta\x18\x03 \x01(\x02\x42\x06\n\x04\x64\x61ta\"\xa6\n\n\x05\x41lert\x12.\n\x08severity\x18\x01 \x02(\x0e\x32\x1c.aos.streaming.AlertSeverity\x12\x12\n\nfirst_seen\x18\x02 \x02(\x04\x12\n\n\x02id\x18\x03 \x02(\t\x12\x0e\n\x06raised\x18\x04 \x02(\x08\x12\x45\n\x16\x63onfig_deviation_alert\x18\x05 \x01(\x0b\x32#.aos.streaming.ConfigDeviationAlertH\x00\x12\x38\n\x0fstreaming_alert\x18\x06 \x01(\x0b\x32\x1d.aos.streaming.StreamingAlertH\x00\x12J\n\x19\x63\x61\x62le_peer_mismatch_alert\x18\x07 \x01(\x0b\x32%.aos.streaming.CablePeerMismatchAlertH\x00\x12N\n\x1b\x62gp_neighbor_mismatch_alert\x18\x08 \x01(\x0b\x32\'.aos.streaming.BGPNeighborMismatchAlertH\x00\x12_\n$interface_link_status_mismatch_alert\x18\t \x01(\x0b\x32/.aos.streaming.InterfaceLinkStatusMismatchAlertH\x00\x12\x36\n\x0ehostname_alert\x18\n \x01(\x0b\x32\x1c.aos.streaming.HostnameAlertH\x00\x12\x30\n\x0broute_alert\x18\x0b \x01(\x0b\x32\x19.aos.streaming.RouteAlertH\x00\x12\x36\n\x0eliveness_alert\x18\x0c \x01(\x0b\x32\x1c.aos.streaming.LivenessAlertH\x00\x12:\n\x10\x64\x65ployment_alert\x18\r \x01(\x0b\x32\x1e.aos.streaming.DeploymentAlertH\x00\x12K\n\x19\x62lueprint_rendering_alert\x18\x0e \x01(\x0b\x32&.aos.streaming.BlueprintRenderingAlertH\x00\x12\x36\n\x0e\x63ounters_alert\x18\x0f \x01(\x0b\x32\x1c.aos.streaming.CountersAlertH\x00\x12,\n\tmac_alert\x18\x10 \x01(\x0b\x32\x17.aos.streaming.MacAlertH\x00\x12,\n\tarp_alert\x18\x11 \x01(\x0b\x32\x17.aos.streaming.ArpAlertH\x00\x12\x36\n\x0eheadroom_alert\x18\x12 \x01(\x0b\x32\x1c.aos.streaming.HeadroomAlertH\x00\x12,\n\tlag_alert\x18\x13 \x01(\x0b\x32\x17.aos.streaming.LagAlertH\x00\x12.\n\nmlag_alert\x18\x14 \x01(\x0b\x32\x18.aos.streaming.MlagAlertH\x00\x12\x30\n\x0bprobe_alert\x18\x15 \x01(\x0b\x32\x19.aos.streaming.ProbeAlertH\x00\x12\x43\n\x15\x63onfig_mismatch_alert\x18\x16 \x01(\x0b\x32\".aos.streaming.ConfigMismatchAlertH\x00\x12:\n\x10\x65xtensible_alert\x18\x17 \x01(\x0b\x32\x1e.aos.streaming.ExtensibleAlertH\x00\x12/\n\ntest_alert\x18\xe8\x07 \x01(\x0b\x32\x18.aos.streaming.TestAlertH\x00\x42\x06\n\x04\x64\x61ta\"\xfd\x01\n\nAosMessage\x12\x11\n\ttimestamp\x18\x01 \x02(\x04\x12\x13\n\x0borigin_name\x18\x02 \x02(\t\x12\x17\n\x0forigin_hostname\x18\x06 \x01(\t\x12\x13\n\x0borigin_role\x18\x07 \x01(\t\x12\x17\n\x0f\x62lueprint_label\x18\x08 \x01(\t\x12%\n\x05\x61lert\x18\x03 \x01(\x0b\x32\x14.aos.streaming.AlertH\x00\x12%\n\x05\x65vent\x18\x04 \x01(\x0b\x32\x14.aos.streaming.EventH\x00\x12*\n\x08perf_mon\x18\x05 \x01(\x0b\x32\x16.aos.streaming.PerfMonH\x00\x42\x06\n\x04\x64\x61ta\"9\n\x13\x41osSequencedMessage\x12\x0f\n\x07seq_num\x18\x01 \x01(\x04\x12\x11\n\taos_proto\x18\x0f \x01(\x0c*\x86\x03\n\x0b\x44\x65viceState\x12\x1a\n\x16\x44\x45VICE_STATE_IS_ACTIVE\x10\x01\x12\x19\n\x15\x44\x45VICE_STATE_IS_READY\x10\x02\x12\x1b\n\x17\x44\x45VICE_STATE_IS_NOCOMMS\x10\x03\x12\x19\n\x15\x44\x45VICE_STATE_IS_MAINT\x10\x04\x12\x1d\n\x19\x44\x45VICE_STATE_IS_REBOOTING\x10\x05\x12\x1c\n\x18\x44\x45VICE_STATE_OOS_STOCKED\x10\x06\x12 \n\x1c\x44\x45VICE_STATE_OOS_QUARANTINED\x10\x07\x12\x1a\n\x16\x44\x45VICE_STATE_OOS_READY\x10\x08\x12\x1c\n\x18\x44\x45VICE_STATE_OOS_NOCOMMS\x10\t\x12\x1b\n\x17\x44\x45VICE_STATE_OOS_DECOMM\x10\n\x12\x1a\n\x16\x44\x45VICE_STATE_OOS_MAINT\x10\x0b\x12\x1e\n\x1a\x44\x45VICE_STATE_OOS_REBOOTING\x10\x0c\x12\x16\n\x12\x44\x45VICE_STATE_ERROR\x10\r*\x8c\x04\n\x07\x46\x65\x61ture\x12\x13\n\x0f\x46\x45\x41TURE_UNKNOWN\x10\x00\x12\x0f\n\x0b\x46\x45\x41TURE_LO0\x10\x01\x12\x12\n\x0e\x46\x45\x41TURE_FABRIC\x10\x02\x12\x17\n\x13\x46\x45\x41TURE_LEAF_SERVER\x10\x03\x12\x12\n\x0e\x46\x45\x41TURE_L3EDGE\x10\x04\x12\x12\n\x0e\x46\x45\x41TURE_L2EDGE\x10\x05\x12\x16\n\x12\x46\x45\x41TURE_SPINE_LEAF\x10\x06\x12\x18\n\x14\x46\x45\x41TURE_FABRIC_SPINE\x10\x07\x12\x1b\n\x17\x46\x45\x41TURE_EXTERNAL_ROUTER\x10\x08\x12\x1e\n\x1a\x46\x45\x41TURE_TO_EXTERNAL_ROUTER\x10\t\x12\x1a\n\x16\x46\x45\x41TURE_LEAF_L3_SERVER\x10\n\x12\x1a\n\x16\x46\x45\x41TURE_LEAF_L2_SERVER\x10\x0b\x12\x10\n\x0c\x46\x45\x41TURE_LEAF\x10\x0c\x12\x11\n\rFEATURE_SPINE\x10\r\x12\x15\n\x11\x46\x45\x41TURE_L3_SERVER\x10\x0e\x12\x15\n\x11\x46\x45\x41TURE_L2_SERVER\x10\x0f\x12\x12\n\x0e\x46\x45\x41TURE_SERVER\x10\x10\x12\x10\n\x0c\x46\x45\x41TURE_PEER\x10\x11\x12\x1a\n\x16\x46\x45\x41TURE_LEAF_PEER_LINK\x10\x12\x12\x15\n\x11\x46\x45\x41TURE_LEAF_PAIR\x10\x13\x12\x1f\n\x1b\x46\x45\x41TURE_LEAF_PAIR_L2_SERVER\x10\x14\x12\x12\n\x0e\x46\x45\x41TURE_UNUSED\x10\x15*a\n\rStreamingType\x12\x1a\n\x16STREAMING_TYPE_PERFMON\x10\x00\x12\x19\n\x15STREAMING_TYPE_EVENTS\x10\x01\x12\x19\n\x15STREAMING_TYPE_ALERTS\x10\x02*=\n\x11StreamingProtocol\x12(\n$STREAMING_PROTOCOL_PROTOBUF_OVER_TCP\x10\x00*E\n\x0fStreamingStatus\x12\x17\n\x13STREAMING_STATUS_UP\x10\x00\x12\x19\n\x15STREAMING_STATUS_DOWN\x10\x01*M\n\x17StreamingSequencingMode\x12\x19\n\x15STREAMING_UNSEQUENCED\x10\x00\x12\x17\n\x13STREAMING_SEQUENCED\x10\x01*7\n\x17\x42gpSessionAddressFamily\x12\x08\n\x04IPV4\x10\x00\x12\x08\n\x04IPV6\x10\x01\x12\x08\n\x04\x45VPN\x10\x02*L\n\nLinkStatus\x12\x0b\n\x07LINK_UP\x10\x00\x12\r\n\tLINK_DOWN\x10\x01\x12\x10\n\x0cLINK_UNKNOWN\x10\x02\x12\x10\n\x0cLINK_MISSING\x10\x03*5\n\x08MacState\x12\x0b\n\x07MAC_ADD\x10\x00\x12\x0e\n\nMAC_DELETE\x10\x01\x12\x0c\n\x08MAC_MOVE\x10\x02*\'\n\x08\x41rpState\x12\x0b\n\x07\x41RP_ADD\x10\x00\x12\x0e\n\nARP_DELETE\x10\x01*l\n\x0fMlagDomainState\x12\x10\n\x0cMLAG_UNKNOWN\x10\x00\x12\x10\n\x0cMLAG_MISSING\x10\x01\x12\x11\n\rMLAG_DISABLED\x10\x02\x12\x11\n\rMLAG_INACTIVE\x10\x03\x12\x0f\n\x0bMLAG_ACTIVE\x10\x04*\xc0\x01\n\rMlagIntfState\x12\x15\n\x11MLAG_INTF_UNKNOWN\x10\x00\x12\x15\n\x11MLAG_INTF_MISSING\x10\x01\x12\x16\n\x12MLAG_INTF_DISABLED\x10\x02\x12\x18\n\x14MLAG_INTF_CONFIGURED\x10\x03\x12\x16\n\x12MLAG_INTF_INACTIVE\x10\x04\x12\x1c\n\x18MLAG_INTF_ACTIVE_PARTIAL\x10\x05\x12\x19\n\x15MLAG_INTF_ACTIVE_FULL\x10\x06*-\n\nRouteState\x12\r\n\tROUTE_ADD\x10\x00\x12\x10\n\x0cROUTE_DELETE\x10\x01*T\n\rAlertSeverity\x12\r\n\tALERT_LOW\x10\x00\x12\x10\n\x0c\x41LERT_MEDIUM\x10\x01\x12\x0e\n\nALERT_HIGH\x10\x02\x12\x12\n\x0e\x41LERT_CRITICAL\x10\x03*\x8d\x01\n\x10RouteEntryStatus\x12\x1e\n\x1aROUTE_ENTRY_STATUS_UNKNOWN\x10\x00\x12\x19\n\x15ROUTE_ENTRY_STATUS_UP\x10\x01\x12\x1e\n\x1aROUTE_ENTRY_STATUS_PARTIAL\x10\x02\x12\x1e\n\x1aROUTE_ENTRY_STATUS_MISSING\x10\x03*a\n\rNextHopStatus\x12\x1b\n\x17NEXT_HOP_STATUS_UNKNOWN\x10\x00\x12\x16\n\x12NEXT_HOP_STATUS_UP\x10\x01\x12\x1b\n\x17NEXT_HOP_STATUS_MISSING\x10\x02*c\n\tRouteType\x12\x16\n\x12ROUTE_TYPE_UNKNOWN\x10\x00\x12\x15\n\x11ROUTE_TYPE_DIRECT\x10\x01\x12\x12\n\x0eROUTE_TYPE_BGP\x10\x02\x12\x13\n\x0fROUTE_TYPE_STAT\x10\x03*s\n\x10\x44\x65ploymentStatus\x12 \n\x1c\x44\x45PLOYMENT_STATUS_INPROGRESS\x10\x00\x12\x1f\n\x1b\x44\x45PLOYMENT_STATUS_SUCCEEDED\x10\x01\x12\x1c\n\x18\x44\x45PLOYMENT_STATUS_FAILED\x10\x02*\xba\x01\n\x14StreamingAlertReason\x12,\n(STREAMING_ALERT_REASON_FAILED_CONNECTION\x10\x00\x12\"\n\x1eSTREAMING_ALERT_REASON_TIMEOUT\x10\x01\x12&\n\"STREAMING_ALERT_REASON_DNS_FAILURE\x10\x02\x12(\n$STREAMING_ALERT_REASON_WRITE_TIMEOUT\x10\x03*m\n\x0f\x42gpSessionState\x12\x12\n\x0e\x42GP_SESSION_UP\x10\x00\x12\x14\n\x10\x42GP_SESSION_DOWN\x10\x01\x12\x17\n\x13\x42GP_SESSION_MISSING\x10\x02\x12\x17\n\x13\x42GP_SESSION_UNKNOWN\x10\x03*\x93\x01\n\x0f\x41ggregationType\x12\x18\n\x14\x41GGREGATION_TYPE_MAX\x10\x01\x12\x18\n\x14\x41GGREGATION_TYPE_MIN\x10\x02\x12\x18\n\x14\x41GGREGATION_TYPE_SUM\x10\x03\x12\x18\n\x14\x41GGREGATION_TYPE_AVG\x10\x04\x12\x18\n\x14\x41GGREGATION_TYPE_STD\x10\x05*<\n\x0cHeadroomType\x12\x15\n\x11HEADROOM_TYPE_MAX\x10\x01\x12\x15\n\x11HEADROOM_TYPE_MIN\x10\x02') + +_DEVICESTATE = DESCRIPTOR.enum_types_by_name['DeviceState'] +DeviceState = enum_type_wrapper.EnumTypeWrapper(_DEVICESTATE) +_FEATURE = DESCRIPTOR.enum_types_by_name['Feature'] +Feature = enum_type_wrapper.EnumTypeWrapper(_FEATURE) +_STREAMINGTYPE = DESCRIPTOR.enum_types_by_name['StreamingType'] +StreamingType = enum_type_wrapper.EnumTypeWrapper(_STREAMINGTYPE) +_STREAMINGPROTOCOL = DESCRIPTOR.enum_types_by_name['StreamingProtocol'] +StreamingProtocol = enum_type_wrapper.EnumTypeWrapper(_STREAMINGPROTOCOL) +_STREAMINGSTATUS = DESCRIPTOR.enum_types_by_name['StreamingStatus'] +StreamingStatus = enum_type_wrapper.EnumTypeWrapper(_STREAMINGSTATUS) +_STREAMINGSEQUENCINGMODE = DESCRIPTOR.enum_types_by_name['StreamingSequencingMode'] +StreamingSequencingMode = enum_type_wrapper.EnumTypeWrapper(_STREAMINGSEQUENCINGMODE) +_BGPSESSIONADDRESSFAMILY = DESCRIPTOR.enum_types_by_name['BgpSessionAddressFamily'] +BgpSessionAddressFamily = enum_type_wrapper.EnumTypeWrapper(_BGPSESSIONADDRESSFAMILY) +_LINKSTATUS = DESCRIPTOR.enum_types_by_name['LinkStatus'] +LinkStatus = enum_type_wrapper.EnumTypeWrapper(_LINKSTATUS) +_MACSTATE = DESCRIPTOR.enum_types_by_name['MacState'] +MacState = enum_type_wrapper.EnumTypeWrapper(_MACSTATE) +_ARPSTATE = DESCRIPTOR.enum_types_by_name['ArpState'] +ArpState = enum_type_wrapper.EnumTypeWrapper(_ARPSTATE) +_MLAGDOMAINSTATE = DESCRIPTOR.enum_types_by_name['MlagDomainState'] +MlagDomainState = enum_type_wrapper.EnumTypeWrapper(_MLAGDOMAINSTATE) +_MLAGINTFSTATE = DESCRIPTOR.enum_types_by_name['MlagIntfState'] +MlagIntfState = enum_type_wrapper.EnumTypeWrapper(_MLAGINTFSTATE) +_ROUTESTATE = DESCRIPTOR.enum_types_by_name['RouteState'] +RouteState = enum_type_wrapper.EnumTypeWrapper(_ROUTESTATE) +_ALERTSEVERITY = DESCRIPTOR.enum_types_by_name['AlertSeverity'] +AlertSeverity = enum_type_wrapper.EnumTypeWrapper(_ALERTSEVERITY) +_ROUTEENTRYSTATUS = DESCRIPTOR.enum_types_by_name['RouteEntryStatus'] +RouteEntryStatus = enum_type_wrapper.EnumTypeWrapper(_ROUTEENTRYSTATUS) +_NEXTHOPSTATUS = DESCRIPTOR.enum_types_by_name['NextHopStatus'] +NextHopStatus = enum_type_wrapper.EnumTypeWrapper(_NEXTHOPSTATUS) +_ROUTETYPE = DESCRIPTOR.enum_types_by_name['RouteType'] +RouteType = enum_type_wrapper.EnumTypeWrapper(_ROUTETYPE) +_DEPLOYMENTSTATUS = DESCRIPTOR.enum_types_by_name['DeploymentStatus'] +DeploymentStatus = enum_type_wrapper.EnumTypeWrapper(_DEPLOYMENTSTATUS) +_STREAMINGALERTREASON = DESCRIPTOR.enum_types_by_name['StreamingAlertReason'] +StreamingAlertReason = enum_type_wrapper.EnumTypeWrapper(_STREAMINGALERTREASON) +_BGPSESSIONSTATE = DESCRIPTOR.enum_types_by_name['BgpSessionState'] +BgpSessionState = enum_type_wrapper.EnumTypeWrapper(_BGPSESSIONSTATE) +_AGGREGATIONTYPE = DESCRIPTOR.enum_types_by_name['AggregationType'] +AggregationType = enum_type_wrapper.EnumTypeWrapper(_AGGREGATIONTYPE) +_HEADROOMTYPE = DESCRIPTOR.enum_types_by_name['HeadroomType'] +HeadroomType = enum_type_wrapper.EnumTypeWrapper(_HEADROOMTYPE) +DEVICE_STATE_IS_ACTIVE = 1 +DEVICE_STATE_IS_READY = 2 +DEVICE_STATE_IS_NOCOMMS = 3 +DEVICE_STATE_IS_MAINT = 4 +DEVICE_STATE_IS_REBOOTING = 5 +DEVICE_STATE_OOS_STOCKED = 6 +DEVICE_STATE_OOS_QUARANTINED = 7 +DEVICE_STATE_OOS_READY = 8 +DEVICE_STATE_OOS_NOCOMMS = 9 +DEVICE_STATE_OOS_DECOMM = 10 +DEVICE_STATE_OOS_MAINT = 11 +DEVICE_STATE_OOS_REBOOTING = 12 +DEVICE_STATE_ERROR = 13 +FEATURE_UNKNOWN = 0 +FEATURE_LO0 = 1 +FEATURE_FABRIC = 2 +FEATURE_LEAF_SERVER = 3 +FEATURE_L3EDGE = 4 +FEATURE_L2EDGE = 5 +FEATURE_SPINE_LEAF = 6 +FEATURE_FABRIC_SPINE = 7 +FEATURE_EXTERNAL_ROUTER = 8 +FEATURE_TO_EXTERNAL_ROUTER = 9 +FEATURE_LEAF_L3_SERVER = 10 +FEATURE_LEAF_L2_SERVER = 11 +FEATURE_LEAF = 12 +FEATURE_SPINE = 13 +FEATURE_L3_SERVER = 14 +FEATURE_L2_SERVER = 15 +FEATURE_SERVER = 16 +FEATURE_PEER = 17 +FEATURE_LEAF_PEER_LINK = 18 +FEATURE_LEAF_PAIR = 19 +FEATURE_LEAF_PAIR_L2_SERVER = 20 +FEATURE_UNUSED = 21 +STREAMING_TYPE_PERFMON = 0 +STREAMING_TYPE_EVENTS = 1 +STREAMING_TYPE_ALERTS = 2 +STREAMING_PROTOCOL_PROTOBUF_OVER_TCP = 0 +STREAMING_STATUS_UP = 0 +STREAMING_STATUS_DOWN = 1 +STREAMING_UNSEQUENCED = 0 +STREAMING_SEQUENCED = 1 +IPV4 = 0 +IPV6 = 1 +EVPN = 2 +LINK_UP = 0 +LINK_DOWN = 1 +LINK_UNKNOWN = 2 +LINK_MISSING = 3 +MAC_ADD = 0 +MAC_DELETE = 1 +MAC_MOVE = 2 +ARP_ADD = 0 +ARP_DELETE = 1 +MLAG_UNKNOWN = 0 +MLAG_MISSING = 1 +MLAG_DISABLED = 2 +MLAG_INACTIVE = 3 +MLAG_ACTIVE = 4 +MLAG_INTF_UNKNOWN = 0 +MLAG_INTF_MISSING = 1 +MLAG_INTF_DISABLED = 2 +MLAG_INTF_CONFIGURED = 3 +MLAG_INTF_INACTIVE = 4 +MLAG_INTF_ACTIVE_PARTIAL = 5 +MLAG_INTF_ACTIVE_FULL = 6 +ROUTE_ADD = 0 +ROUTE_DELETE = 1 +ALERT_LOW = 0 +ALERT_MEDIUM = 1 +ALERT_HIGH = 2 +ALERT_CRITICAL = 3 +ROUTE_ENTRY_STATUS_UNKNOWN = 0 +ROUTE_ENTRY_STATUS_UP = 1 +ROUTE_ENTRY_STATUS_PARTIAL = 2 +ROUTE_ENTRY_STATUS_MISSING = 3 +NEXT_HOP_STATUS_UNKNOWN = 0 +NEXT_HOP_STATUS_UP = 1 +NEXT_HOP_STATUS_MISSING = 2 +ROUTE_TYPE_UNKNOWN = 0 +ROUTE_TYPE_DIRECT = 1 +ROUTE_TYPE_BGP = 2 +ROUTE_TYPE_STAT = 3 +DEPLOYMENT_STATUS_INPROGRESS = 0 +DEPLOYMENT_STATUS_SUCCEEDED = 1 +DEPLOYMENT_STATUS_FAILED = 2 +STREAMING_ALERT_REASON_FAILED_CONNECTION = 0 +STREAMING_ALERT_REASON_TIMEOUT = 1 +STREAMING_ALERT_REASON_DNS_FAILURE = 2 +STREAMING_ALERT_REASON_WRITE_TIMEOUT = 3 +BGP_SESSION_UP = 0 +BGP_SESSION_DOWN = 1 +BGP_SESSION_MISSING = 2 +BGP_SESSION_UNKNOWN = 3 +AGGREGATION_TYPE_MAX = 1 +AGGREGATION_TYPE_MIN = 2 +AGGREGATION_TYPE_SUM = 3 +AGGREGATION_TYPE_AVG = 4 +AGGREGATION_TYPE_STD = 5 +HEADROOM_TYPE_MAX = 1 +HEADROOM_TYPE_MIN = 2 + + +_DEVICESTATEEVENT = DESCRIPTOR.message_types_by_name['DeviceStateEvent'] +_TRAFFICEVENT = DESCRIPTOR.message_types_by_name['TrafficEvent'] +_STREAMINGEVENT = DESCRIPTOR.message_types_by_name['StreamingEvent'] +_CABLEPEEREVENT = DESCRIPTOR.message_types_by_name['CablePeerEvent'] +_BGPNEIGHBOREVENT = DESCRIPTOR.message_types_by_name['BGPNeighborEvent'] +_LINKSTATUSEVENT = DESCRIPTOR.message_types_by_name['LinkStatusEvent'] +_MACEVENT = DESCRIPTOR.message_types_by_name['MacEvent'] +_ARPEVENT = DESCRIPTOR.message_types_by_name['ArpEvent'] +_LAGEVENT = DESCRIPTOR.message_types_by_name['LagEvent'] +_MLAGEVENT = DESCRIPTOR.message_types_by_name['MlagEvent'] +_EXTENSIBLESERVICEEVENT = DESCRIPTOR.message_types_by_name['ExtensibleServiceEvent'] +_ROUTEEVENT = DESCRIPTOR.message_types_by_name['RouteEvent'] +_EVPNTYPE3ROUTEEVENT = DESCRIPTOR.message_types_by_name['EvpnType3RouteEvent'] +_ACTIVEFLOODLISTEVENT = DESCRIPTOR.message_types_by_name['ActiveFloodlistEvent'] +_EVPNTYPE5ROUTEEVENT = DESCRIPTOR.message_types_by_name['EvpnType5RouteEvent'] +_EVENT = DESCRIPTOR.message_types_by_name['Event'] +_HOSTNAMEALERT = DESCRIPTOR.message_types_by_name['HostnameAlert'] +_CONFIGDEVIATIONALERT = DESCRIPTOR.message_types_by_name['ConfigDeviationAlert'] +_LIVENESSALERT = DESCRIPTOR.message_types_by_name['LivenessAlert'] +_EXTENSIBLEALERT = DESCRIPTOR.message_types_by_name['ExtensibleAlert'] +_DEPLOYMENTALERT = DESCRIPTOR.message_types_by_name['DeploymentAlert'] +_BLUEPRINTRENDERINGALERT = DESCRIPTOR.message_types_by_name['BlueprintRenderingAlert'] +_ROUTEALERT = DESCRIPTOR.message_types_by_name['RouteAlert'] +_LAGALERT = DESCRIPTOR.message_types_by_name['LagAlert'] +_STREAMINGALERT = DESCRIPTOR.message_types_by_name['StreamingAlert'] +_CABLEPEERMISMATCHALERT = DESCRIPTOR.message_types_by_name['CablePeerMismatchAlert'] +_BGPNEIGHBORMISMATCHALERT = DESCRIPTOR.message_types_by_name['BGPNeighborMismatchAlert'] +_INTERFACELINKSTATUSMISMATCHALERT = DESCRIPTOR.message_types_by_name['InterfaceLinkStatusMismatchAlert'] +_COUNTERSALERT = DESCRIPTOR.message_types_by_name['CountersAlert'] +_KEYVALUEPAIR = DESCRIPTOR.message_types_by_name['KeyValuePair'] +_PROBEALERT = DESCRIPTOR.message_types_by_name['ProbeAlert'] +_CONFIGMISMATCHALERT = DESCRIPTOR.message_types_by_name['ConfigMismatchAlert'] +_HEADROOMALERT = DESCRIPTOR.message_types_by_name['HeadroomAlert'] +_MACALERT = DESCRIPTOR.message_types_by_name['MacAlert'] +_ARPALERT = DESCRIPTOR.message_types_by_name['ArpAlert'] +_MLAGALERT = DESCRIPTOR.message_types_by_name['MlagAlert'] +_TESTALERT = DESCRIPTOR.message_types_by_name['TestAlert'] +_INTERFACECOUNTERS = DESCRIPTOR.message_types_by_name['InterfaceCounters'] +_SYSTEMINFO = DESCRIPTOR.message_types_by_name['SystemInfo'] +_PROCESSINFO = DESCRIPTOR.message_types_by_name['ProcessInfo'] +_FILEINFO = DESCRIPTOR.message_types_by_name['FileInfo'] +_SYSRESOURCECOUNTERS = DESCRIPTOR.message_types_by_name['SysResourceCounters'] +_TAG = DESCRIPTOR.message_types_by_name['Tag'] +_FIELD = DESCRIPTOR.message_types_by_name['Field'] +_PROBEPROPERTY = DESCRIPTOR.message_types_by_name['ProbeProperty'] +_INTERFACECOUNTERSUTILIZATION = DESCRIPTOR.message_types_by_name['InterfaceCountersUtilization'] +_SYSTEMINTERFACEUTILIZATION = DESCRIPTOR.message_types_by_name['SystemInterfaceUtilization'] +_PROBEMESSAGE = DESCRIPTOR.message_types_by_name['ProbeMessage'] +_GENERICPERFMONMESSAGE = DESCRIPTOR.message_types_by_name['GenericPerfmonMessage'] +_PROBEDATA = DESCRIPTOR.message_types_by_name['ProbeData'] +_PERFMON = DESCRIPTOR.message_types_by_name['PerfMon'] +_ALERT = DESCRIPTOR.message_types_by_name['Alert'] +_AOSMESSAGE = DESCRIPTOR.message_types_by_name['AosMessage'] +_AOSSEQUENCEDMESSAGE = DESCRIPTOR.message_types_by_name['AosSequencedMessage'] +DeviceStateEvent = _reflection.GeneratedProtocolMessageType('DeviceStateEvent', (_message.Message,), { + 'DESCRIPTOR' : _DEVICESTATEEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.DeviceStateEvent) + }) +_sym_db.RegisterMessage(DeviceStateEvent) + +TrafficEvent = _reflection.GeneratedProtocolMessageType('TrafficEvent', (_message.Message,), { + 'DESCRIPTOR' : _TRAFFICEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.TrafficEvent) + }) +_sym_db.RegisterMessage(TrafficEvent) + +StreamingEvent = _reflection.GeneratedProtocolMessageType('StreamingEvent', (_message.Message,), { + 'DESCRIPTOR' : _STREAMINGEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.StreamingEvent) + }) +_sym_db.RegisterMessage(StreamingEvent) + +CablePeerEvent = _reflection.GeneratedProtocolMessageType('CablePeerEvent', (_message.Message,), { + 'DESCRIPTOR' : _CABLEPEEREVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.CablePeerEvent) + }) +_sym_db.RegisterMessage(CablePeerEvent) + +BGPNeighborEvent = _reflection.GeneratedProtocolMessageType('BGPNeighborEvent', (_message.Message,), { + 'DESCRIPTOR' : _BGPNEIGHBOREVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.BGPNeighborEvent) + }) +_sym_db.RegisterMessage(BGPNeighborEvent) + +LinkStatusEvent = _reflection.GeneratedProtocolMessageType('LinkStatusEvent', (_message.Message,), { + 'DESCRIPTOR' : _LINKSTATUSEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.LinkStatusEvent) + }) +_sym_db.RegisterMessage(LinkStatusEvent) + +MacEvent = _reflection.GeneratedProtocolMessageType('MacEvent', (_message.Message,), { + 'DESCRIPTOR' : _MACEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.MacEvent) + }) +_sym_db.RegisterMessage(MacEvent) + +ArpEvent = _reflection.GeneratedProtocolMessageType('ArpEvent', (_message.Message,), { + 'DESCRIPTOR' : _ARPEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ArpEvent) + }) +_sym_db.RegisterMessage(ArpEvent) + +LagEvent = _reflection.GeneratedProtocolMessageType('LagEvent', (_message.Message,), { + 'DESCRIPTOR' : _LAGEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.LagEvent) + }) +_sym_db.RegisterMessage(LagEvent) + +MlagEvent = _reflection.GeneratedProtocolMessageType('MlagEvent', (_message.Message,), { + 'DESCRIPTOR' : _MLAGEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.MlagEvent) + }) +_sym_db.RegisterMessage(MlagEvent) + +ExtensibleServiceEvent = _reflection.GeneratedProtocolMessageType('ExtensibleServiceEvent', (_message.Message,), { + 'DESCRIPTOR' : _EXTENSIBLESERVICEEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ExtensibleServiceEvent) + }) +_sym_db.RegisterMessage(ExtensibleServiceEvent) + +RouteEvent = _reflection.GeneratedProtocolMessageType('RouteEvent', (_message.Message,), { + 'DESCRIPTOR' : _ROUTEEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.RouteEvent) + }) +_sym_db.RegisterMessage(RouteEvent) + +EvpnType3RouteEvent = _reflection.GeneratedProtocolMessageType('EvpnType3RouteEvent', (_message.Message,), { + 'DESCRIPTOR' : _EVPNTYPE3ROUTEEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.EvpnType3RouteEvent) + }) +_sym_db.RegisterMessage(EvpnType3RouteEvent) + +ActiveFloodlistEvent = _reflection.GeneratedProtocolMessageType('ActiveFloodlistEvent', (_message.Message,), { + 'DESCRIPTOR' : _ACTIVEFLOODLISTEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ActiveFloodlistEvent) + }) +_sym_db.RegisterMessage(ActiveFloodlistEvent) + +EvpnType5RouteEvent = _reflection.GeneratedProtocolMessageType('EvpnType5RouteEvent', (_message.Message,), { + 'DESCRIPTOR' : _EVPNTYPE5ROUTEEVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.EvpnType5RouteEvent) + }) +_sym_db.RegisterMessage(EvpnType5RouteEvent) + +Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { + 'DESCRIPTOR' : _EVENT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.Event) + }) +_sym_db.RegisterMessage(Event) + +HostnameAlert = _reflection.GeneratedProtocolMessageType('HostnameAlert', (_message.Message,), { + 'DESCRIPTOR' : _HOSTNAMEALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.HostnameAlert) + }) +_sym_db.RegisterMessage(HostnameAlert) + +ConfigDeviationAlert = _reflection.GeneratedProtocolMessageType('ConfigDeviationAlert', (_message.Message,), { + 'DESCRIPTOR' : _CONFIGDEVIATIONALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ConfigDeviationAlert) + }) +_sym_db.RegisterMessage(ConfigDeviationAlert) + +LivenessAlert = _reflection.GeneratedProtocolMessageType('LivenessAlert', (_message.Message,), { + 'DESCRIPTOR' : _LIVENESSALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.LivenessAlert) + }) +_sym_db.RegisterMessage(LivenessAlert) + +ExtensibleAlert = _reflection.GeneratedProtocolMessageType('ExtensibleAlert', (_message.Message,), { + 'DESCRIPTOR' : _EXTENSIBLEALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ExtensibleAlert) + }) +_sym_db.RegisterMessage(ExtensibleAlert) + +DeploymentAlert = _reflection.GeneratedProtocolMessageType('DeploymentAlert', (_message.Message,), { + 'DESCRIPTOR' : _DEPLOYMENTALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.DeploymentAlert) + }) +_sym_db.RegisterMessage(DeploymentAlert) + +BlueprintRenderingAlert = _reflection.GeneratedProtocolMessageType('BlueprintRenderingAlert', (_message.Message,), { + 'DESCRIPTOR' : _BLUEPRINTRENDERINGALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.BlueprintRenderingAlert) + }) +_sym_db.RegisterMessage(BlueprintRenderingAlert) + +RouteAlert = _reflection.GeneratedProtocolMessageType('RouteAlert', (_message.Message,), { + 'DESCRIPTOR' : _ROUTEALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.RouteAlert) + }) +_sym_db.RegisterMessage(RouteAlert) + +LagAlert = _reflection.GeneratedProtocolMessageType('LagAlert', (_message.Message,), { + 'DESCRIPTOR' : _LAGALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.LagAlert) + }) +_sym_db.RegisterMessage(LagAlert) + +StreamingAlert = _reflection.GeneratedProtocolMessageType('StreamingAlert', (_message.Message,), { + 'DESCRIPTOR' : _STREAMINGALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.StreamingAlert) + }) +_sym_db.RegisterMessage(StreamingAlert) + +CablePeerMismatchAlert = _reflection.GeneratedProtocolMessageType('CablePeerMismatchAlert', (_message.Message,), { + 'DESCRIPTOR' : _CABLEPEERMISMATCHALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.CablePeerMismatchAlert) + }) +_sym_db.RegisterMessage(CablePeerMismatchAlert) + +BGPNeighborMismatchAlert = _reflection.GeneratedProtocolMessageType('BGPNeighborMismatchAlert', (_message.Message,), { + 'DESCRIPTOR' : _BGPNEIGHBORMISMATCHALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.BGPNeighborMismatchAlert) + }) +_sym_db.RegisterMessage(BGPNeighborMismatchAlert) + +InterfaceLinkStatusMismatchAlert = _reflection.GeneratedProtocolMessageType('InterfaceLinkStatusMismatchAlert', (_message.Message,), { + 'DESCRIPTOR' : _INTERFACELINKSTATUSMISMATCHALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.InterfaceLinkStatusMismatchAlert) + }) +_sym_db.RegisterMessage(InterfaceLinkStatusMismatchAlert) + +CountersAlert = _reflection.GeneratedProtocolMessageType('CountersAlert', (_message.Message,), { + 'DESCRIPTOR' : _COUNTERSALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.CountersAlert) + }) +_sym_db.RegisterMessage(CountersAlert) + +KeyValuePair = _reflection.GeneratedProtocolMessageType('KeyValuePair', (_message.Message,), { + 'DESCRIPTOR' : _KEYVALUEPAIR, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.KeyValuePair) + }) +_sym_db.RegisterMessage(KeyValuePair) + +ProbeAlert = _reflection.GeneratedProtocolMessageType('ProbeAlert', (_message.Message,), { + 'DESCRIPTOR' : _PROBEALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ProbeAlert) + }) +_sym_db.RegisterMessage(ProbeAlert) + +ConfigMismatchAlert = _reflection.GeneratedProtocolMessageType('ConfigMismatchAlert', (_message.Message,), { + 'DESCRIPTOR' : _CONFIGMISMATCHALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ConfigMismatchAlert) + }) +_sym_db.RegisterMessage(ConfigMismatchAlert) + +HeadroomAlert = _reflection.GeneratedProtocolMessageType('HeadroomAlert', (_message.Message,), { + 'DESCRIPTOR' : _HEADROOMALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.HeadroomAlert) + }) +_sym_db.RegisterMessage(HeadroomAlert) + +MacAlert = _reflection.GeneratedProtocolMessageType('MacAlert', (_message.Message,), { + 'DESCRIPTOR' : _MACALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.MacAlert) + }) +_sym_db.RegisterMessage(MacAlert) + +ArpAlert = _reflection.GeneratedProtocolMessageType('ArpAlert', (_message.Message,), { + 'DESCRIPTOR' : _ARPALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ArpAlert) + }) +_sym_db.RegisterMessage(ArpAlert) + +MlagAlert = _reflection.GeneratedProtocolMessageType('MlagAlert', (_message.Message,), { + 'DESCRIPTOR' : _MLAGALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.MlagAlert) + }) +_sym_db.RegisterMessage(MlagAlert) + +TestAlert = _reflection.GeneratedProtocolMessageType('TestAlert', (_message.Message,), { + 'DESCRIPTOR' : _TESTALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.TestAlert) + }) +_sym_db.RegisterMessage(TestAlert) + +InterfaceCounters = _reflection.GeneratedProtocolMessageType('InterfaceCounters', (_message.Message,), { + 'DESCRIPTOR' : _INTERFACECOUNTERS, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.InterfaceCounters) + }) +_sym_db.RegisterMessage(InterfaceCounters) + +SystemInfo = _reflection.GeneratedProtocolMessageType('SystemInfo', (_message.Message,), { + 'DESCRIPTOR' : _SYSTEMINFO, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.SystemInfo) + }) +_sym_db.RegisterMessage(SystemInfo) + +ProcessInfo = _reflection.GeneratedProtocolMessageType('ProcessInfo', (_message.Message,), { + 'DESCRIPTOR' : _PROCESSINFO, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ProcessInfo) + }) +_sym_db.RegisterMessage(ProcessInfo) + +FileInfo = _reflection.GeneratedProtocolMessageType('FileInfo', (_message.Message,), { + 'DESCRIPTOR' : _FILEINFO, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.FileInfo) + }) +_sym_db.RegisterMessage(FileInfo) + +SysResourceCounters = _reflection.GeneratedProtocolMessageType('SysResourceCounters', (_message.Message,), { + 'DESCRIPTOR' : _SYSRESOURCECOUNTERS, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.SysResourceCounters) + }) +_sym_db.RegisterMessage(SysResourceCounters) + +Tag = _reflection.GeneratedProtocolMessageType('Tag', (_message.Message,), { + 'DESCRIPTOR' : _TAG, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.Tag) + }) +_sym_db.RegisterMessage(Tag) + +Field = _reflection.GeneratedProtocolMessageType('Field', (_message.Message,), { + 'DESCRIPTOR' : _FIELD, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.Field) + }) +_sym_db.RegisterMessage(Field) + +ProbeProperty = _reflection.GeneratedProtocolMessageType('ProbeProperty', (_message.Message,), { + 'DESCRIPTOR' : _PROBEPROPERTY, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ProbeProperty) + }) +_sym_db.RegisterMessage(ProbeProperty) + +InterfaceCountersUtilization = _reflection.GeneratedProtocolMessageType('InterfaceCountersUtilization', (_message.Message,), { + 'DESCRIPTOR' : _INTERFACECOUNTERSUTILIZATION, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.InterfaceCountersUtilization) + }) +_sym_db.RegisterMessage(InterfaceCountersUtilization) + +SystemInterfaceUtilization = _reflection.GeneratedProtocolMessageType('SystemInterfaceUtilization', (_message.Message,), { + 'DESCRIPTOR' : _SYSTEMINTERFACEUTILIZATION, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.SystemInterfaceUtilization) + }) +_sym_db.RegisterMessage(SystemInterfaceUtilization) + +ProbeMessage = _reflection.GeneratedProtocolMessageType('ProbeMessage', (_message.Message,), { + 'DESCRIPTOR' : _PROBEMESSAGE, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ProbeMessage) + }) +_sym_db.RegisterMessage(ProbeMessage) + +GenericPerfmonMessage = _reflection.GeneratedProtocolMessageType('GenericPerfmonMessage', (_message.Message,), { + 'DESCRIPTOR' : _GENERICPERFMONMESSAGE, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.GenericPerfmonMessage) + }) +_sym_db.RegisterMessage(GenericPerfmonMessage) + +ProbeData = _reflection.GeneratedProtocolMessageType('ProbeData', (_message.Message,), { + 'DESCRIPTOR' : _PROBEDATA, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.ProbeData) + }) +_sym_db.RegisterMessage(ProbeData) + +PerfMon = _reflection.GeneratedProtocolMessageType('PerfMon', (_message.Message,), { + 'DESCRIPTOR' : _PERFMON, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.PerfMon) + }) +_sym_db.RegisterMessage(PerfMon) + +Alert = _reflection.GeneratedProtocolMessageType('Alert', (_message.Message,), { + 'DESCRIPTOR' : _ALERT, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.Alert) + }) +_sym_db.RegisterMessage(Alert) + +AosMessage = _reflection.GeneratedProtocolMessageType('AosMessage', (_message.Message,), { + 'DESCRIPTOR' : _AOSMESSAGE, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.AosMessage) + }) +_sym_db.RegisterMessage(AosMessage) + +AosSequencedMessage = _reflection.GeneratedProtocolMessageType('AosSequencedMessage', (_message.Message,), { + 'DESCRIPTOR' : _AOSSEQUENCEDMESSAGE, + '__module__' : 'aosstream_pb2' + # @@protoc_insertion_point(class_scope:aos.streaming.AosSequencedMessage) + }) +_sym_db.RegisterMessage(AosSequencedMessage) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _DEVICESTATE._serialized_start=10723 + _DEVICESTATE._serialized_end=11113 + _FEATURE._serialized_start=11116 + _FEATURE._serialized_end=11640 + _STREAMINGTYPE._serialized_start=11642 + _STREAMINGTYPE._serialized_end=11739 + _STREAMINGPROTOCOL._serialized_start=11741 + _STREAMINGPROTOCOL._serialized_end=11802 + _STREAMINGSTATUS._serialized_start=11804 + _STREAMINGSTATUS._serialized_end=11873 + _STREAMINGSEQUENCINGMODE._serialized_start=11875 + _STREAMINGSEQUENCINGMODE._serialized_end=11952 + _BGPSESSIONADDRESSFAMILY._serialized_start=11954 + _BGPSESSIONADDRESSFAMILY._serialized_end=12009 + _LINKSTATUS._serialized_start=12011 + _LINKSTATUS._serialized_end=12087 + _MACSTATE._serialized_start=12089 + _MACSTATE._serialized_end=12142 + _ARPSTATE._serialized_start=12144 + _ARPSTATE._serialized_end=12183 + _MLAGDOMAINSTATE._serialized_start=12185 + _MLAGDOMAINSTATE._serialized_end=12293 + _MLAGINTFSTATE._serialized_start=12296 + _MLAGINTFSTATE._serialized_end=12488 + _ROUTESTATE._serialized_start=12490 + _ROUTESTATE._serialized_end=12535 + _ALERTSEVERITY._serialized_start=12537 + _ALERTSEVERITY._serialized_end=12621 + _ROUTEENTRYSTATUS._serialized_start=12624 + _ROUTEENTRYSTATUS._serialized_end=12765 + _NEXTHOPSTATUS._serialized_start=12767 + _NEXTHOPSTATUS._serialized_end=12864 + _ROUTETYPE._serialized_start=12866 + _ROUTETYPE._serialized_end=12965 + _DEPLOYMENTSTATUS._serialized_start=12967 + _DEPLOYMENTSTATUS._serialized_end=13082 + _STREAMINGALERTREASON._serialized_start=13085 + _STREAMINGALERTREASON._serialized_end=13271 + _BGPSESSIONSTATE._serialized_start=13273 + _BGPSESSIONSTATE._serialized_end=13382 + _AGGREGATIONTYPE._serialized_start=13385 + _AGGREGATIONTYPE._serialized_end=13532 + _HEADROOMTYPE._serialized_start=13534 + _HEADROOMTYPE._serialized_end=13594 + _DEVICESTATEEVENT._serialized_start=34 + _DEVICESTATEEVENT._serialized_end=95 + _TRAFFICEVENT._serialized_start=98 + _TRAFFICEVENT._serialized_end=437 + _STREAMINGEVENT._serialized_start=440 + _STREAMINGEVENT._serialized_end=695 + _CABLEPEEREVENT._serialized_start=698 + _CABLEPEEREVENT._serialized_end=843 + _BGPNEIGHBOREVENT._serialized_start=846 + _BGPNEIGHBOREVENT._serialized_end=1086 + _LINKSTATUSEVENT._serialized_start=1088 + _LINKSTATUSEVENT._serialized_end=1181 + _MACEVENT._serialized_start=1183 + _MACEVENT._serialized_end=1285 + _ARPEVENT._serialized_start=1287 + _ARPEVENT._serialized_end=1404 + _LAGEVENT._serialized_start=1406 + _LAGEVENT._serialized_end=1500 + _MLAGEVENT._serialized_start=1503 + _MLAGEVENT._serialized_end=1655 + _EXTENSIBLESERVICEEVENT._serialized_start=1657 + _EXTENSIBLESERVICEEVENT._serialized_end=1709 + _ROUTEEVENT._serialized_start=1711 + _ROUTEEVENT._serialized_end=1812 + _EVPNTYPE3ROUTEEVENT._serialized_start=1815 + _EVPNTYPE3ROUTEEVENT._serialized_end=1952 + _ACTIVEFLOODLISTEVENT._serialized_start=1954 + _ACTIVEFLOODLISTEVENT._serialized_end=2064 + _EVPNTYPE5ROUTEEVENT._serialized_start=2067 + _EVPNTYPE5ROUTEEVENT._serialized_end=2219 + _EVENT._serialized_start=2222 + _EVENT._serialized_end=2874 + _HOSTNAMEALERT._serialized_start=2876 + _HOSTNAMEALERT._serialized_end=2943 + _CONFIGDEVIATIONALERT._serialized_start=2945 + _CONFIGDEVIATIONALERT._serialized_end=2967 + _LIVENESSALERT._serialized_start=2969 + _LIVENESSALERT._serialized_end=3047 + _EXTENSIBLEALERT._serialized_start=3049 + _EXTENSIBLEALERT._serialized_end=3113 + _DEPLOYMENTALERT._serialized_start=3116 + _DEPLOYMENTALERT._serialized_end=3269 + _BLUEPRINTRENDERINGALERT._serialized_start=3271 + _BLUEPRINTRENDERINGALERT._serialized_end=3320 + _ROUTEALERT._serialized_start=3323 + _ROUTEALERT._serialized_end=3471 + _LAGALERT._serialized_start=3474 + _LAGALERT._serialized_end=3637 + _STREAMINGALERT._serialized_start=3640 + _STREAMINGALERT._serialized_end=3900 + _CABLEPEERMISMATCHALERT._serialized_start=3903 + _CABLEPEERMISMATCHALERT._serialized_end=4075 + _BGPNEIGHBORMISMATCHALERT._serialized_start=4078 + _BGPNEIGHBORMISMATCHALERT._serialized_end=4407 + _INTERFACELINKSTATUSMISMATCHALERT._serialized_start=4410 + _INTERFACELINKSTATUSMISMATCHALERT._serialized_end=4584 + _COUNTERSALERT._serialized_start=4587 + _COUNTERSALERT._serialized_end=4855 + _KEYVALUEPAIR._serialized_start=4857 + _KEYVALUEPAIR._serialized_end=4899 + _PROBEALERT._serialized_start=4902 + _PROBEALERT._serialized_end=5294 + _CONFIGMISMATCHALERT._serialized_start=5296 + _CONFIGMISMATCHALERT._serialized_end=5361 + _HEADROOMALERT._serialized_start=5363 + _HEADROOMALERT._serialized_end=5488 + _MACALERT._serialized_start=5491 + _MACALERT._serialized_end=5633 + _ARPALERT._serialized_start=5635 + _ARPALERT._serialized_end=5695 + _MLAGALERT._serialized_start=5698 + _MLAGALERT._serialized_end=6099 + _TESTALERT._serialized_start=6101 + _TESTALERT._serialized_end=6130 + _INTERFACECOUNTERS._serialized_start=6133 + _INTERFACECOUNTERS._serialized_end=6598 + _SYSTEMINFO._serialized_start=6600 + _SYSTEMINFO._serialized_end=6711 + _PROCESSINFO._serialized_start=6713 + _PROCESSINFO._serialized_end=6807 + _FILEINFO._serialized_start=6809 + _FILEINFO._serialized_end=6857 + _SYSRESOURCECOUNTERS._serialized_start=6860 + _SYSRESOURCECOUNTERS._serialized_end=7023 + _TAG._serialized_start=7025 + _TAG._serialized_end=7123 + _FIELD._serialized_start=7125 + _FIELD._serialized_end=7225 + _PROBEPROPERTY._serialized_start=7227 + _PROBEPROPERTY._serialized_end=7271 + _INTERFACECOUNTERSUTILIZATION._serialized_start=7274 + _INTERFACECOUNTERSUTILIZATION._serialized_end=7783 + _SYSTEMINTERFACEUTILIZATION._serialized_start=7786 + _SYSTEMINTERFACEUTILIZATION._serialized_end=7998 + _PROBEMESSAGE._serialized_start=8001 + _PROBEMESSAGE._serialized_end=8615 + _GENERICPERFMONMESSAGE._serialized_start=8617 + _GENERICPERFMONMESSAGE._serialized_end=8712 + _PROBEDATA._serialized_start=8714 + _PROBEDATA._serialized_end=8797 + _PERFMON._serialized_start=8800 + _PERFMON._serialized_end=9084 + _ALERT._serialized_start=9087 + _ALERT._serialized_end=10405 + _AOSMESSAGE._serialized_start=10408 + _AOSMESSAGE._serialized_end=10661 + _AOSSEQUENCEDMESSAGE._serialized_start=10663 + _AOSSEQUENCEDMESSAGE._serialized_end=10720 +# @@protoc_insertion_point(module_scope) diff --git a/scripts/telemetry/listener.py b/scripts/telemetry/listener.py new file mode 100644 index 0000000..b751bc6 --- /dev/null +++ b/scripts/telemetry/listener.py @@ -0,0 +1,47 @@ +import socket +import aosstream_pb2 +import sys + +""" +This is a simple single-threaded listener. +Use 0.0.0.0 to listen on the local host. +pick a port and pick alerts, events or perfmon +""" +l = len(sys.argv) +if l <= 3: + print ("Usage : listener.py host port [alerts|events|perfmon]") + exit() + +if l > 3 : listen_to=sys.argv[3] +if l > 2 : port = int(sys.argv[2]) +if l > 1 : host = sys.argv[1] + + +def parse_message(data): + pos = 0 + sm = aosstream_pb2.AosSequencedMessage() + sm.ParseFromString(data) + m = aosstream_pb2.AosMessage() + m.ParseFromString(sm.aos_proto) + print (m) + +with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + s.bind((host, port)) + print(f"Listening on {host} and {port}") + s.listen() + conn, addr = s.accept() + with conn: + print(f"Connected by {addr}") + print("recompiled") + while (True): + try: + data = conn.recv(2) + l = int.from_bytes(data, "big") + data = conn.recv(l) + print ("DATA RECV") + print (data) + if (not data): + break + parse_message(data) + except Exception as e: + print (e) \ No newline at end of file diff --git a/scripts/telemetry/start_telemetry.py b/scripts/telemetry/start_telemetry.py new file mode 100644 index 0000000..aa5522a --- /dev/null +++ b/scripts/telemetry/start_telemetry.py @@ -0,0 +1,27 @@ +import aos +from aos.client import AosClient +import urllib3 +import json +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + + +# You will need to update the connection details below with your +# specific AOS instance +AOS_IP = "" +AOS_PORT = 0 +AOS_USER = "" +AOS_PW = "" + +# Where is the listener listening? +LISTENER_IP = "" +ALERTS_PORT = 64420 +EVENTS_PORT = 64421 +PERFMON_PORT = 64422 + +# Login +aos = AosClient(protocol="https", host=AOS_IP, port=AOS_PORT) +aos.auth.login(AOS_USER, AOS_PW) +aos.telemetry_mgr.add_endpoint("100.123.0.8", ALERTS_PORT, "alerts") +aos.telemetry_mgr.add_endpoint("100.123.0.8", EVENTS_PORT, "events") +aos.telemetry_mgr.add_endpoint("100.123.0.8", PERFMON_PORT, "perfmon") +print(aos.telemetry_mgr.get_endpoints()) diff --git a/scripts/telemetry/stop_all_telemetry.py b/scripts/telemetry/stop_all_telemetry.py new file mode 100644 index 0000000..4ce8896 --- /dev/null +++ b/scripts/telemetry/stop_all_telemetry.py @@ -0,0 +1,24 @@ +import aos +from aos.client import AosClient +import urllib3 +import json +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + + +# You will need to update the connection details below with your +# specific AOS instance +AOS_IP = "66.129.234.206" +AOS_PORT = 37000 +AOS_USER = "admin" +AOS_PW = "admin" + +# Where is the listener listening? +LISTENER_IP = "100.123.0.8" +ALERTS_PORT = 64429 +EVENTS_PORT = 64428 +PERFMON_PORT = 64427 + +# Login +aos = AosClient(protocol="https", host=AOS_IP, port=AOS_PORT) +aos.auth.login(AOS_USER, AOS_PW) +aos.telemetry_mgr.delete_all_endpoints() diff --git a/tests/fixtures/aos/4.0.0/telemetry/endpoints.json b/tests/fixtures/aos/4.0.0/telemetry/endpoints.json new file mode 100644 index 0000000..0358ea0 --- /dev/null +++ b/tests/fixtures/aos/4.0.0/telemetry/endpoints.json @@ -0,0 +1,113 @@ +{ + "items": [ + { + "status": { + "connectionLog": [ + { + "date": "2022-05-09T15:54:34.909380+00:00", + "message": "Eof encountered" + }, + { + "date": "2022-05-09T15:54:39.910426+00:00", + "message": "Eof encountered" + }, + { + "date": "2022-05-09T15:54:44.911002+00:00", + "message": "Eof encountered" + } + ], + "connectionTime": null, + "lastTransmittedTime": "2022-05-09T15:54:35.121503+00:00", + "epoch": "2022-05-09T15:54:34.909126+00:00", + "connectionResetCount": 3, + "streamingEndpoint": { + "hostname": "100.123.0.8", + "protocol": "protoBufOverTcp", + "port": 64429 + }, + "dnsLog": [], + "connected": false, + "disconnectionTime": "2022-05-09T15:54:44.910995+00:00" + }, + "streaming_type": "alerts", + "sequencing_mode": "sequenced", + "protocol": "protoBufOverTcp", + "hostname": "100.123.0.8", + "port": 64429, + "id": "9ebce4cc-8119-4e2d-b080-789cbbe57d32" + }, + { + "status": { + "connectionLog": [ + { + "date": "2022-05-09T15:54:35.121511+00:00", + "message": "Eof encountered" + }, + { + "date": "2022-05-09T15:54:40.122113+00:00", + "message": "Eof encountered" + }, + { + "date": "2022-05-09T15:54:45.122693+00:00", + "message": "Eof encountered" + } + ], + "connectionTime": null, + "lastTransmittedTime": "2022-05-09T15:54:41.128922+00:00", + "epoch": "2022-05-09T15:54:35.121228+00:00", + "connectionResetCount": 3, + "streamingEndpoint": { + "hostname": "100.123.0.8", + "protocol": "protoBufOverTcp", + "port": 64427 + }, + "dnsLog": [], + "connected": false, + "disconnectionTime": "2022-05-09T15:54:45.122685+00:00" + }, + "streaming_type": "perfmon", + "sequencing_mode": "sequenced", + "protocol": "protoBufOverTcp", + "hostname": "100.123.0.8", + "port": 64427, + "id": "47c455f5-59ad-4582-9608-aa6c09398385" + }, + { + "status": { + "connectionLog": [ + { + "date": "2022-05-09T15:54:35.013046+00:00", + "message": "Eof encountered" + }, + { + "date": "2022-05-09T15:54:40.013578+00:00", + "message": "Eof encountered" + }, + { + "date": "2022-05-09T15:54:45.014154+00:00", + "message": "Eof encountered" + } + ], + "connectionTime": null, + "lastTransmittedTime": "2022-05-09T15:54:45.122669+00:00", + "epoch": "2022-05-09T15:54:35.012796+00:00", + "connectionResetCount": 3, + "streamingEndpoint": { + "hostname": "100.123.0.8", + "protocol": "protoBufOverTcp", + "port": 64428 + }, + "dnsLog": [], + "connected": false, + "disconnectionTime": "2022-05-09T15:54:45.014146+00:00" + }, + "streaming_type": "events", + "sequencing_mode": "sequenced", + "protocol": "protoBufOverTcp", + "hostname": "100.123.0.8", + "port": 64428, + "id": "d8f5a012-232c-4aca-b5c9-637dbba8cb4b" + } + ] +} + diff --git a/tests/test_telemetry.py b/tests/test_telemetry.py new file mode 100644 index 0000000..f4494a6 --- /dev/null +++ b/tests/test_telemetry.py @@ -0,0 +1,42 @@ +import json + +import pytest +from unittest import mock + +from aos.telemetry import AosTelemetryManager +from tests.util import read_fixture + +mock_rest = mock.Mock() +mgr = AosTelemetryManager(mock_rest) + + +@pytest.fixture(params=["4.0.0"]) +def aos_api_version(request): + return request.param + + +def test_add_endpoint(): + mgr.add_endpoint("fakehost", "fakeport", "faketype") + mock_rest.json_resp_post.assert_called_with( + uri="/api/streaming-config", + data={ + "hostname": "fakehost", + "port": "fakeport", + "streaming_type": "faketype", + "sequencing_mode": "sequenced", + "protocol": "protoBufOverTcp", + }, + ) + + +def test_get_endpoints(aos_api_version): + fixture_path = f"aos/{aos_api_version}/telemetry/endpoints.json" + mock_rest.json_resp_get.return_value = json.loads(read_fixture(fixture_path)) + r = mgr.get_endpoints() + assert len(r) == 3 + mock_rest.json_resp_get.assert_called() + + +def test_delete_endpoints(): + mgr.delete_all_endpoints() + mock_rest.delete.assert_called()