Skip to content

Commit

Permalink
cloudvision: Mirror arista and fmp with cloudvision prefix
Browse files Browse the repository at this point in the history
Change-Id: Ieb14238fbc5581c111090de747d3b02e0078f1cd
  • Loading branch information
oumichae1 committed Dec 3, 2024
1 parent 407488c commit 85d266e
Show file tree
Hide file tree
Showing 190 changed files with 59,967 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ dist:
dev-setup:
pip3 install .[dev]

# Including cloudvision/arista in the general check causes mypy to mark cvlib as problematic.
# mypy thinks that context.py's import of `from time import process_time_ns` is for some reason
# pointing to cloudvision/arista/time and so flags an issue as the following:
# `cloudvision/cvlib/context.py:10: error: Module "time" has no attribute "process_time_ns"`
# The mypy check passes fine if both are checked in isolation though
lint:
flake8 .
mypy --exclude build --exclude .venv .
mypy --exclude cloudvision/arista --exclude build --exclude .venv .
mypy cloudvision/arista
./check_copyright.sh
2 changes: 1 addition & 1 deletion check_copyright.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ notice='Copyright \(c\) 20[0-9][0-9] Arista Networks, Inc.'
apacheNotice='Use of this source code is governed by the Apache License 2.0'
apacheNoticeSource='that can be found in the COPYING file.'
confidential='Confidential and Proprietary'
generatedCodePaths='(^arista|^fmp).*'
generatedCodePaths='(^arista|^fmp|^cloudvision/arista|^cloudvision/fmp).*'
copyrightCheck='.*(check_copyright.sh)'

files=`git diff-tree --no-commit-id --name-only --diff-filter=ACMR -r HEAD | \
Expand Down
1 change: 1 addition & 0 deletions cloudvision/arista/alert/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Copyright (c) 2024 Arista Networks, Inc. All rights reserved.
4 changes: 4 additions & 0 deletions cloudvision/arista/alert/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Arista Networks, Inc. All rights reserved.

from cloudvision.arista.alert.v1 import alert_pb2 as models
import cloudvision.arista.alert.v1.services
220 changes: 220 additions & 0 deletions cloudvision/arista/alert/v1/alert_pb2.py

Large diffs are not rendered by default.

2,781 changes: 2,781 additions & 0 deletions cloudvision/arista/alert/v1/alert_pb2.pyi

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions cloudvision/arista/alert/v1/alert_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

6 changes: 6 additions & 0 deletions cloudvision/arista/alert/v1/services/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2024 Arista Networks, Inc. All rights reserved.

# pylint: disable=wildcard-import
from cloudvision.arista.alert.v1.services.gen_pb2 import *
# pylint: disable=wildcard-import
from cloudvision.arista.alert.v1.services.gen_pb2_grpc import *
113 changes: 113 additions & 0 deletions cloudvision/arista/alert/v1/services/gen_pb2.py

Large diffs are not rendered by default.

950 changes: 950 additions & 0 deletions cloudvision/arista/alert/v1/services/gen_pb2.pyi

Large diffs are not rendered by default.

1,107 changes: 1,107 additions & 0 deletions cloudvision/arista/alert/v1/services/gen_pb2_grpc.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cloudvision/arista/bugexposure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Copyright (c) 2024 Arista Networks, Inc. All rights reserved.
4 changes: 4 additions & 0 deletions cloudvision/arista/bugexposure/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2024 Arista Networks, Inc. All rights reserved.

from cloudvision.arista.bugexposure.v1 import bugexposure_pb2 as models
import cloudvision.arista.bugexposure.v1.services
40 changes: 40 additions & 0 deletions cloudvision/arista/bugexposure/v1/bugexposure_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

184 changes: 184 additions & 0 deletions cloudvision/arista/bugexposure/v1/bugexposure_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""
import builtins
import cloudvision.fmp.wrappers_pb2
import google.protobuf.descriptor
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import google.protobuf.wrappers_pb2
import typing
import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

class _Acknowledgement:
ValueType = typing.NewType('ValueType', builtins.int)
V: typing_extensions.TypeAlias = ValueType
class _AcknowledgementEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Acknowledgement.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
ACKNOWLEDGEMENT_UNSPECIFIED: _Acknowledgement.ValueType # 0
"""Unacknowledged and acknowledged bugs will be computed"""

ACKNOWLEDGEMENT_UNACKNOWLEDGED: _Acknowledgement.ValueType # 1
"""Only unacknowledged bugs will be computed"""

ACKNOWLEDGEMENT_ACKNOWLEDGED: _Acknowledgement.ValueType # 2
"""Only acknowledged bugs will be computed"""

class Acknowledgement(_Acknowledgement, metaclass=_AcknowledgementEnumTypeWrapper):
"""Acknowledgement is an enumeration key
for a BugExposure model that defines
the acknowledgement state for the
computed bugs
"""
pass

ACKNOWLEDGEMENT_UNSPECIFIED: Acknowledgement.ValueType # 0
"""Unacknowledged and acknowledged bugs will be computed"""

ACKNOWLEDGEMENT_UNACKNOWLEDGED: Acknowledgement.ValueType # 1
"""Only unacknowledged bugs will be computed"""

ACKNOWLEDGEMENT_ACKNOWLEDGED: Acknowledgement.ValueType # 2
"""Only acknowledged bugs will be computed"""

global___Acknowledgement = Acknowledgement


class _HighestExposure:
ValueType = typing.NewType('ValueType', builtins.int)
V: typing_extensions.TypeAlias = ValueType
class _HighestExposureEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_HighestExposure.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
HIGHEST_EXPOSURE_UNSPECIFIED: _HighestExposure.ValueType # 0
"""If not given this will be the default value
and it will compute devices with
any highest exposure
"""

HIGHEST_EXPOSURE_NONE: _HighestExposure.ValueType # 1
"""Not exposed to bugs"""

HIGHEST_EXPOSURE_LOW: _HighestExposure.ValueType # 2
"""Highest exposure is to a low priority bug"""

HIGHEST_EXPOSURE_HIGH: _HighestExposure.ValueType # 3
"""Highest exposure is to a high priority bug"""

class HighestExposure(_HighestExposure, metaclass=_HighestExposureEnumTypeWrapper):
"""HighestExposure is an enumeration
that defines the options for
highest exposure
"""
pass

HIGHEST_EXPOSURE_UNSPECIFIED: HighestExposure.ValueType # 0
"""If not given this will be the default value
and it will compute devices with
any highest exposure
"""

HIGHEST_EXPOSURE_NONE: HighestExposure.ValueType # 1
"""Not exposed to bugs"""

HIGHEST_EXPOSURE_LOW: HighestExposure.ValueType # 2
"""Highest exposure is to a low priority bug"""

HIGHEST_EXPOSURE_HIGH: HighestExposure.ValueType # 3
"""Highest exposure is to a high priority bug"""

global___HighestExposure = HighestExposure


class BugExposureKey(google.protobuf.message.Message):
"""BugExposureKey is the key type for
BugExposure model
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor
DEVICE_ID_FIELD_NUMBER: builtins.int
ACKNOWLEDGEMENT_FIELD_NUMBER: builtins.int
@property
def device_id(self) -> google.protobuf.wrappers_pb2.StringValue:
"""device_id is the device ID"""
pass
acknowledgement: global___Acknowledgement.ValueType
"""acknowledgement is one of the options for
Acknowledgement enum
"""

def __init__(self,
*,
device_id: typing.Optional[google.protobuf.wrappers_pb2.StringValue] = ...,
acknowledgement: global___Acknowledgement.ValueType = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["device_id",b"device_id"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["acknowledgement",b"acknowledgement","device_id",b"device_id"]) -> None: ...
global___BugExposureKey = BugExposureKey

class BugExposure(google.protobuf.message.Message):
"""BugExposure is the state model that represents
the exposure a device has to bugs
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor
KEY_FIELD_NUMBER: builtins.int
BUG_IDS_FIELD_NUMBER: builtins.int
CVE_IDS_FIELD_NUMBER: builtins.int
BUG_COUNT_FIELD_NUMBER: builtins.int
CVE_COUNT_FIELD_NUMBER: builtins.int
HIGHEST_BUG_EXPOSURE_FIELD_NUMBER: builtins.int
HIGHEST_CVE_EXPOSURE_FIELD_NUMBER: builtins.int
@property
def key(self) -> global___BugExposureKey:
"""BugExposureKey is the key of
BugExposure
"""
pass
@property
def bug_ids(self) -> cloudvision.fmp.wrappers_pb2.RepeatedInt32:
"""bug_ids is a list of bug alerts affecting the device
with type Bug
"""
pass
@property
def cve_ids(self) -> cloudvision.fmp.wrappers_pb2.RepeatedInt32:
"""cve_ids is a list of bug alerts affecting the device
with type CVE
"""
pass
@property
def bug_count(self) -> google.protobuf.wrappers_pb2.Int32Value:
"""bug_count is the number of bug alerts
with type Bug
"""
pass
@property
def cve_count(self) -> google.protobuf.wrappers_pb2.Int32Value:
"""cve_count is the number of bug alerts
with type CVE
"""
pass
highest_bug_exposure: global___HighestExposure.ValueType
"""highest_bug_exposure is the highest exposure
with type Bug
"""

highest_cve_exposure: global___HighestExposure.ValueType
"""highest_cve_exposure is the highest exposure
with type CVE
"""

def __init__(self,
*,
key: typing.Optional[global___BugExposureKey] = ...,
bug_ids: typing.Optional[cloudvision.fmp.wrappers_pb2.RepeatedInt32] = ...,
cve_ids: typing.Optional[cloudvision.fmp.wrappers_pb2.RepeatedInt32] = ...,
bug_count: typing.Optional[google.protobuf.wrappers_pb2.Int32Value] = ...,
cve_count: typing.Optional[google.protobuf.wrappers_pb2.Int32Value] = ...,
highest_bug_exposure: global___HighestExposure.ValueType = ...,
highest_cve_exposure: global___HighestExposure.ValueType = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["bug_count",b"bug_count","bug_ids",b"bug_ids","cve_count",b"cve_count","cve_ids",b"cve_ids","key",b"key"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["bug_count",b"bug_count","bug_ids",b"bug_ids","cve_count",b"cve_count","cve_ids",b"cve_ids","highest_bug_exposure",b"highest_bug_exposure","highest_cve_exposure",b"highest_cve_exposure","key",b"key"]) -> None: ...
global___BugExposure = BugExposure
4 changes: 4 additions & 0 deletions cloudvision/arista/bugexposure/v1/bugexposure_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

6 changes: 6 additions & 0 deletions cloudvision/arista/bugexposure/v1/services/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2024 Arista Networks, Inc. All rights reserved.

# pylint: disable=wildcard-import
from cloudvision.arista.bugexposure.v1.services.gen_pb2 import *
# pylint: disable=wildcard-import
from cloudvision.arista.bugexposure.v1.services.gen_pb2_grpc import *
42 changes: 42 additions & 0 deletions cloudvision/arista/bugexposure/v1/services/gen_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 85d266e

Please sign in to comment.