diff --git a/proto/context.proto b/proto/context.proto index 82487b0376c1c827e6dbcf96772bd001b872b671..ca6b17a92e602a39fe3f1adc6793f71b3c587da0 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -13,20 +13,29 @@ message Empty { } message Context { - Topology topo = 1; - TeraFlowController ctl = 2; + ContextId contextId= 1; + Topology topo = 2; + TeraFlowController ctl = 3; +} + +message ContextId { + Uuid contextUuid = 1; } message Topology { - repeated Device device = 1; - repeated Link link = 2; + TopologyId topoId = 2; + repeated Device device = 3; + repeated Link link = 4; } message Link { repeated EndPointId endpointList = 1; } - +message TopologyId { + ContextId contextId = 1; + Uuid topoId = 2; +} message Constraint { string constraint_type = 1; @@ -51,8 +60,9 @@ message EndPoint { } message EndPointId { - Uuid port_id = 1; + TopologyId topoId = 1; DeviceId dev_id = 2; + Uuid port_id = 3; } message DeviceId { @@ -69,12 +79,12 @@ enum DeviceOperationalStatus { } message TeraFlowController { - context.Uuid ctl_id = 1; + ContextId ctl_id = 1; string ipaddress = 2; } message AuthenticationResult { - context.Uuid ctl_id = 1; + ContextId ctl_id = 1; bool authenticated = 2; } diff --git a/proto/service.proto b/proto/service.proto index 37e39393c587314fc804b1d1e0166b80dd7de05b..33feb28717adf9671b8ebcf6ed5a7ba757ff6c6f 100644 --- a/proto/service.proto +++ b/proto/service.proto @@ -39,7 +39,8 @@ message ServiceConfig { } message ServiceId { - context.Uuid cs_id = 1; + context.ContextId contextId = 1; + context.Uuid cs_id = 2; } message ServiceIdList { diff --git a/proto/slice.proto b/proto/slice.proto index d5e7b67244e0a7accfcf578f63608a04b5e8c894..bdba8e11bf49b4fccf96c3b466e3e612bc47e7c9 100644 --- a/proto/slice.proto +++ b/proto/slice.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package slice; import "context.proto"; +import "service.proto"; service SliceService { rpc CreateUpdateSlice ( TransportSlice ) returns (SliceStatus) {} @@ -19,11 +20,14 @@ message TransportSlice { SliceId slice_id = 1; repeated slice.SliceEndpoint endpoints = 2; repeated context.Constraint constraints = 3; - SliceStatus status = 4; + repeated service.ServiceId services = 4; + repeated SliceId subSlicesId = 5; + SliceStatus status = 6; } message SliceId { - context.Uuid slice_id = 1; + context.ContextId contextId = 1; + context.Uuid slice_id = 2; } message SliceStatus { diff --git a/proto/src/attack_mitigator_pb2.py b/proto/src/attack_mitigator_pb2.py index c011a5beb0fb69aead59c907450f3492b2d513f8..ce1e2d4910eeededdd110d90d80936d0b2cf0533 100644 --- a/proto/src/attack_mitigator_pb2.py +++ b/proto/src/attack_mitigator_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: attack_mitigator.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -19,8 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='attack_mitigator', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x16\x61ttack_mitigator.proto\x12\x10\x61ttack_mitigator\x1a\rcontext.proto\"t\n\x11\x41ttackDescription\x12\x1c\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x11\n\tattack_id\x18\x02 \x01(\x05\x12\x12\n\nconfidence\x18\x03 \x01(\x02\x12\x1a\n\x12\x61ttack_description\x18\x04 \x01(\t\"\xa2\x01\n\x0e\x41ttackResponse\x12\x1c\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x11\n\tattack_id\x18\x02 \x01(\x05\x12\x1a\n\x12\x61ttack_description\x18\x03 \x01(\t\x12\x1c\n\x14response_strategy_id\x18\x04 \x01(\x05\x12%\n\x1dresponse_strategy_description\x18\x05 \x01(\t2j\n\x0f\x41ttackMitigator\x12W\n\x0cNotifyAttack\x12#.attack_mitigator.AttackDescription\x1a .attack_mitigator.AttackResponse\"\x00\x62\x06proto3' + serialized_pb=_b('\n\x16\x61ttack_mitigator.proto\x12\x10\x61ttack_mitigator\x1a\rcontext.proto\"t\n\x11\x41ttackDescription\x12\x1c\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x11\n\tattack_id\x18\x02 \x01(\x05\x12\x12\n\nconfidence\x18\x03 \x01(\x02\x12\x1a\n\x12\x61ttack_description\x18\x04 \x01(\t\"\xa2\x01\n\x0e\x41ttackResponse\x12\x1c\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x11\n\tattack_id\x18\x02 \x01(\x05\x12\x1a\n\x12\x61ttack_description\x18\x03 \x01(\t\x12\x1c\n\x14response_strategy_id\x18\x04 \x01(\x05\x12%\n\x1dresponse_strategy_description\x18\x05 \x01(\t2j\n\x0f\x41ttackMitigator\x12W\n\x0cNotifyAttack\x12#.attack_mitigator.AttackDescription\x1a .attack_mitigator.AttackResponse\"\x00\x62\x06proto3') , dependencies=[context__pb2.DESCRIPTOR,]) @@ -33,7 +34,6 @@ _ATTACKDESCRIPTION = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='cs_id', full_name='attack_mitigator.AttackDescription.cs_id', index=0, @@ -41,28 +41,28 @@ _ATTACKDESCRIPTION = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='attack_id', full_name='attack_mitigator.AttackDescription.attack_id', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='confidence', full_name='attack_mitigator.AttackDescription.confidence', index=2, number=3, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='attack_description', full_name='attack_mitigator.AttackDescription.attack_description', index=3, number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -86,7 +86,6 @@ _ATTACKRESPONSE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='cs_id', full_name='attack_mitigator.AttackResponse.cs_id', index=0, @@ -94,35 +93,35 @@ _ATTACKRESPONSE = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='attack_id', full_name='attack_mitigator.AttackResponse.attack_id', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='attack_description', full_name='attack_mitigator.AttackResponse.attack_description', index=2, number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='response_strategy_id', full_name='attack_mitigator.AttackResponse.response_strategy_id', index=3, number=4, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='response_strategy_description', full_name='attack_mitigator.AttackResponse.response_strategy_description', index=4, number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -167,7 +166,6 @@ _ATTACKMITIGATOR = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, serialized_start=342, serialized_end=448, methods=[ @@ -179,7 +177,6 @@ _ATTACKMITIGATOR = _descriptor.ServiceDescriptor( input_type=_ATTACKDESCRIPTION, output_type=_ATTACKRESPONSE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_ATTACKMITIGATOR) diff --git a/proto/src/attack_mitigator_pb2_grpc.py b/proto/src/attack_mitigator_pb2_grpc.py index e045402c78edb162007e5b7bc45cc9660ee058cc..71518e3952ea5aad2cd5d9885a57b895faab9056 100644 --- a/proto/src/attack_mitigator_pb2_grpc.py +++ b/proto/src/attack_mitigator_pb2_grpc.py @@ -1,66 +1,46 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import attack_mitigator_pb2 as attack__mitigator__pb2 class AttackMitigatorStub(object): - """Missing associated documentation comment in .proto file.""" + # missing associated documentation comment in .proto file + pass - def __init__(self, channel): - """Constructor. + def __init__(self, channel): + """Constructor. - Args: - channel: A grpc.Channel. - """ - self.NotifyAttack = channel.unary_unary( - '/attack_mitigator.AttackMitigator/NotifyAttack', - request_serializer=attack__mitigator__pb2.AttackDescription.SerializeToString, - response_deserializer=attack__mitigator__pb2.AttackResponse.FromString, - ) + Args: + channel: A grpc.Channel. + """ + self.NotifyAttack = channel.unary_unary( + '/attack_mitigator.AttackMitigator/NotifyAttack', + request_serializer=attack__mitigator__pb2.AttackDescription.SerializeToString, + response_deserializer=attack__mitigator__pb2.AttackResponse.FromString, + ) class AttackMitigatorServicer(object): - """Missing associated documentation comment in .proto file.""" + # missing associated documentation comment in .proto file + pass - def NotifyAttack(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + def NotifyAttack(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_AttackMitigatorServicer_to_server(servicer, server): - rpc_method_handlers = { - 'NotifyAttack': grpc.unary_unary_rpc_method_handler( - servicer.NotifyAttack, - request_deserializer=attack__mitigator__pb2.AttackDescription.FromString, - response_serializer=attack__mitigator__pb2.AttackResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'attack_mitigator.AttackMitigator', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class AttackMitigator(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def NotifyAttack(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, '/attack_mitigator.AttackMitigator/NotifyAttack', - attack__mitigator__pb2.AttackDescription.SerializeToString, - attack__mitigator__pb2.AttackResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'NotifyAttack': grpc.unary_unary_rpc_method_handler( + servicer.NotifyAttack, + request_deserializer=attack__mitigator__pb2.AttackDescription.FromString, + response_serializer=attack__mitigator__pb2.AttackResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'attack_mitigator.AttackMitigator', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/automation_pb2.py b/proto/src/automation_pb2.py index ab3119681ca136fee0a7a72739d067dcf77eaf74..5fd11474d4cfdcb5a19ba05fd82bf5bce4f81e96 100644 --- a/proto/src/automation_pb2.py +++ b/proto/src/automation_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: automation.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -20,8 +22,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='automation', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x10\x61utomation.proto\x12\nautomation\x1a\rcontext.proto\"R\n\x0c\x44\x65viceRoleId\x12 \n\tdevRoleId\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12 \n\x05\x64\x65vId\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"j\n\nDeviceRole\x12+\n\tdevRoleId\x18\x01 \x01(\x0b\x32\x18.automation.DeviceRoleId\x12/\n\x0b\x64\x65vRoleType\x18\x02 \x01(\x0e\x32\x1a.automation.DeviceRoleType\"9\n\x0e\x44\x65viceRoleList\x12\'\n\x07\x64\x65vRole\x18\x01 \x03(\x0b\x32\x16.automation.DeviceRole\"p\n\x0f\x44\x65viceRoleState\x12+\n\tdevRoleId\x18\x01 \x01(\x0b\x32\x18.automation.DeviceRoleId\x12\x30\n\x0c\x64\x65vRoleState\x18\x02 \x01(\x0e\x32\x1a.automation.ZtpDeviceState*H\n\x0e\x44\x65viceRoleType\x12\x08\n\x04NONE\x10\x00\x12\x0b\n\x07\x44\x45V_OPS\x10\x01\x12\x0c\n\x08\x44\x45V_CONF\x10\x02\x12\x11\n\rPIPELINE_CONF\x10\x03*n\n\x0eZtpDeviceState\x12\x0b\n\x07PLANNED\x10\x00\x12\x17\n\x13POTENCIAL_AVAILABLE\x10\x01\x12\x12\n\x0ePOTENCIAL_BUSY\x10\x02\x12\r\n\tINSTALLED\x10\x03\x12\x13\n\x0fPENDING_REMOVAL\x10\x04\x32\xc0\x03\n\x11\x41utomationService\x12\x46\n\x10ZtpGetDeviceRole\x12\x18.automation.DeviceRoleId\x1a\x16.automation.DeviceRole\"\x00\x12N\n\x1bZtpGetDeviceRolesByDeviceId\x12\x11.context.DeviceId\x1a\x1a.automation.DeviceRoleList\"\x00\x12?\n\x06ZtpAdd\x12\x16.automation.DeviceRole\x1a\x1b.automation.DeviceRoleState\"\x00\x12\x42\n\tZtpUpdate\x12\x16.automation.DeviceRole\x1a\x1b.automation.DeviceRoleState\"\x00\x12\x42\n\tZtpDelete\x12\x16.automation.DeviceRole\x1a\x1b.automation.DeviceRoleState\"\x00\x12J\n\x16ZtpDeleteAllByDeviceId\x12\x11.context.DeviceId\x1a\x1b.automation.DeviceRoleState\"\x00\x62\x06proto3' + serialized_pb=_b('\n\x10\x61utomation.proto\x12\nautomation\x1a\rcontext.proto\"R\n\x0c\x44\x65viceRoleId\x12 \n\tdevRoleId\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12 \n\x05\x64\x65vId\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"j\n\nDeviceRole\x12+\n\tdevRoleId\x18\x01 \x01(\x0b\x32\x18.automation.DeviceRoleId\x12/\n\x0b\x64\x65vRoleType\x18\x02 \x01(\x0e\x32\x1a.automation.DeviceRoleType\"9\n\x0e\x44\x65viceRoleList\x12\'\n\x07\x64\x65vRole\x18\x01 \x03(\x0b\x32\x16.automation.DeviceRole\"p\n\x0f\x44\x65viceRoleState\x12+\n\tdevRoleId\x18\x01 \x01(\x0b\x32\x18.automation.DeviceRoleId\x12\x30\n\x0c\x64\x65vRoleState\x18\x02 \x01(\x0e\x32\x1a.automation.ZtpDeviceState*H\n\x0e\x44\x65viceRoleType\x12\x08\n\x04NONE\x10\x00\x12\x0b\n\x07\x44\x45V_OPS\x10\x01\x12\x0c\n\x08\x44\x45V_CONF\x10\x02\x12\x11\n\rPIPELINE_CONF\x10\x03*n\n\x0eZtpDeviceState\x12\x0b\n\x07PLANNED\x10\x00\x12\x17\n\x13POTENCIAL_AVAILABLE\x10\x01\x12\x12\n\x0ePOTENCIAL_BUSY\x10\x02\x12\r\n\tINSTALLED\x10\x03\x12\x13\n\x0fPENDING_REMOVAL\x10\x04\x32\xc0\x03\n\x11\x41utomationService\x12\x46\n\x10ZtpGetDeviceRole\x12\x18.automation.DeviceRoleId\x1a\x16.automation.DeviceRole\"\x00\x12N\n\x1bZtpGetDeviceRolesByDeviceId\x12\x11.context.DeviceId\x1a\x1a.automation.DeviceRoleList\"\x00\x12?\n\x06ZtpAdd\x12\x16.automation.DeviceRole\x1a\x1b.automation.DeviceRoleState\"\x00\x12\x42\n\tZtpUpdate\x12\x16.automation.DeviceRole\x1a\x1b.automation.DeviceRoleState\"\x00\x12\x42\n\tZtpDelete\x12\x16.automation.DeviceRole\x1a\x1b.automation.DeviceRoleState\"\x00\x12J\n\x16ZtpDeleteAllByDeviceId\x12\x11.context.DeviceId\x1a\x1b.automation.DeviceRoleState\"\x00\x62\x06proto3') , dependencies=[context__pb2.DESCRIPTOR,]) @@ -30,28 +31,23 @@ _DEVICEROLETYPE = _descriptor.EnumDescriptor( full_name='automation.DeviceRoleType', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='NONE', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='DEV_OPS', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='DEV_CONF', index=2, number=2, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='PIPELINE_CONF', index=3, number=3, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, @@ -66,33 +62,27 @@ _ZTPDEVICESTATE = _descriptor.EnumDescriptor( full_name='automation.ZtpDeviceState', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='PLANNED', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='POTENCIAL_AVAILABLE', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='POTENCIAL_BUSY', index=2, number=2, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='INSTALLED', index=3, number=3, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='PENDING_REMOVAL', index=4, number=4, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, @@ -120,7 +110,6 @@ _DEVICEROLEID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='devRoleId', full_name='automation.DeviceRoleId.devRoleId', index=0, @@ -128,14 +117,14 @@ _DEVICEROLEID = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='devId', full_name='automation.DeviceRoleId.devId', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -159,7 +148,6 @@ _DEVICEROLE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='devRoleId', full_name='automation.DeviceRole.devRoleId', index=0, @@ -167,14 +155,14 @@ _DEVICEROLE = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='devRoleType', full_name='automation.DeviceRole.devRoleType', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -198,7 +186,6 @@ _DEVICEROLELIST = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='devRole', full_name='automation.DeviceRoleList.devRole', index=0, @@ -206,7 +193,7 @@ _DEVICEROLELIST = _descriptor.Descriptor( has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -230,7 +217,6 @@ _DEVICEROLESTATE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='devRoleId', full_name='automation.DeviceRoleState.devRoleId', index=0, @@ -238,14 +224,14 @@ _DEVICEROLESTATE = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='devRoleState', full_name='automation.DeviceRoleState.devRoleState', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -313,7 +299,6 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, serialized_start=599, serialized_end=1047, methods=[ @@ -325,7 +310,6 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( input_type=_DEVICEROLEID, output_type=_DEVICEROLE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ZtpGetDeviceRolesByDeviceId', @@ -335,7 +319,6 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._DEVICEID, output_type=_DEVICEROLELIST, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ZtpAdd', @@ -345,7 +328,6 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( input_type=_DEVICEROLE, output_type=_DEVICEROLESTATE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ZtpUpdate', @@ -355,7 +337,6 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( input_type=_DEVICEROLE, output_type=_DEVICEROLESTATE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ZtpDelete', @@ -365,7 +346,6 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( input_type=_DEVICEROLE, output_type=_DEVICEROLESTATE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ZtpDeleteAllByDeviceId', @@ -375,7 +355,6 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._DEVICEID, output_type=_DEVICEROLESTATE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_AUTOMATIONSERVICE) diff --git a/proto/src/automation_pb2_grpc.py b/proto/src/automation_pb2_grpc.py index 2b5d3f23114f52f7ed700e01928e9162ff8b80e2..8ceb7956b3e7778db9d1c6e88c054238f57d7a61 100644 --- a/proto/src/automation_pb2_grpc.py +++ b/proto/src/automation_pb2_grpc.py @@ -1,5 +1,4 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import automation_pb2 as automation__pb2 @@ -7,226 +6,127 @@ import context_pb2 as context__pb2 class AutomationServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ZtpGetDeviceRole = channel.unary_unary( - '/automation.AutomationService/ZtpGetDeviceRole', - request_serializer=automation__pb2.DeviceRoleId.SerializeToString, - response_deserializer=automation__pb2.DeviceRole.FromString, - ) - self.ZtpGetDeviceRolesByDeviceId = channel.unary_unary( - '/automation.AutomationService/ZtpGetDeviceRolesByDeviceId', - request_serializer=context__pb2.DeviceId.SerializeToString, - response_deserializer=automation__pb2.DeviceRoleList.FromString, - ) - self.ZtpAdd = channel.unary_unary( - '/automation.AutomationService/ZtpAdd', - request_serializer=automation__pb2.DeviceRole.SerializeToString, - response_deserializer=automation__pb2.DeviceRoleState.FromString, - ) - self.ZtpUpdate = channel.unary_unary( - '/automation.AutomationService/ZtpUpdate', - request_serializer=automation__pb2.DeviceRole.SerializeToString, - response_deserializer=automation__pb2.DeviceRoleState.FromString, - ) - self.ZtpDelete = channel.unary_unary( - '/automation.AutomationService/ZtpDelete', - request_serializer=automation__pb2.DeviceRole.SerializeToString, - response_deserializer=automation__pb2.DeviceRoleState.FromString, - ) - self.ZtpDeleteAllByDeviceId = channel.unary_unary( - '/automation.AutomationService/ZtpDeleteAllByDeviceId', - request_serializer=context__pb2.DeviceId.SerializeToString, - response_deserializer=automation__pb2.DeviceRoleState.FromString, - ) + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ZtpGetDeviceRole = channel.unary_unary( + '/automation.AutomationService/ZtpGetDeviceRole', + request_serializer=automation__pb2.DeviceRoleId.SerializeToString, + response_deserializer=automation__pb2.DeviceRole.FromString, + ) + self.ZtpGetDeviceRolesByDeviceId = channel.unary_unary( + '/automation.AutomationService/ZtpGetDeviceRolesByDeviceId', + request_serializer=context__pb2.DeviceId.SerializeToString, + response_deserializer=automation__pb2.DeviceRoleList.FromString, + ) + self.ZtpAdd = channel.unary_unary( + '/automation.AutomationService/ZtpAdd', + request_serializer=automation__pb2.DeviceRole.SerializeToString, + response_deserializer=automation__pb2.DeviceRoleState.FromString, + ) + self.ZtpUpdate = channel.unary_unary( + '/automation.AutomationService/ZtpUpdate', + request_serializer=automation__pb2.DeviceRole.SerializeToString, + response_deserializer=automation__pb2.DeviceRoleState.FromString, + ) + self.ZtpDelete = channel.unary_unary( + '/automation.AutomationService/ZtpDelete', + request_serializer=automation__pb2.DeviceRole.SerializeToString, + response_deserializer=automation__pb2.DeviceRoleState.FromString, + ) + self.ZtpDeleteAllByDeviceId = channel.unary_unary( + '/automation.AutomationService/ZtpDeleteAllByDeviceId', + request_serializer=context__pb2.DeviceId.SerializeToString, + response_deserializer=automation__pb2.DeviceRoleState.FromString, + ) class AutomationServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def ZtpGetDeviceRole(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ZtpGetDeviceRolesByDeviceId(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ZtpAdd(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ZtpUpdate(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ZtpDelete(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ZtpDeleteAllByDeviceId(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + # missing associated documentation comment in .proto file + pass + + def ZtpGetDeviceRole(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ZtpGetDeviceRolesByDeviceId(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ZtpAdd(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ZtpUpdate(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ZtpDelete(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ZtpDeleteAllByDeviceId(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_AutomationServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'ZtpGetDeviceRole': grpc.unary_unary_rpc_method_handler( - servicer.ZtpGetDeviceRole, - request_deserializer=automation__pb2.DeviceRoleId.FromString, - response_serializer=automation__pb2.DeviceRole.SerializeToString, - ), - 'ZtpGetDeviceRolesByDeviceId': grpc.unary_unary_rpc_method_handler( - servicer.ZtpGetDeviceRolesByDeviceId, - request_deserializer=context__pb2.DeviceId.FromString, - response_serializer=automation__pb2.DeviceRoleList.SerializeToString, - ), - 'ZtpAdd': grpc.unary_unary_rpc_method_handler( - servicer.ZtpAdd, - request_deserializer=automation__pb2.DeviceRole.FromString, - response_serializer=automation__pb2.DeviceRoleState.SerializeToString, - ), - 'ZtpUpdate': grpc.unary_unary_rpc_method_handler( - servicer.ZtpUpdate, - request_deserializer=automation__pb2.DeviceRole.FromString, - response_serializer=automation__pb2.DeviceRoleState.SerializeToString, - ), - 'ZtpDelete': grpc.unary_unary_rpc_method_handler( - servicer.ZtpDelete, - request_deserializer=automation__pb2.DeviceRole.FromString, - response_serializer=automation__pb2.DeviceRoleState.SerializeToString, - ), - 'ZtpDeleteAllByDeviceId': grpc.unary_unary_rpc_method_handler( - servicer.ZtpDeleteAllByDeviceId, - request_deserializer=context__pb2.DeviceId.FromString, - response_serializer=automation__pb2.DeviceRoleState.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'automation.AutomationService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class AutomationService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def ZtpGetDeviceRole(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, '/automation.AutomationService/ZtpGetDeviceRole', - automation__pb2.DeviceRoleId.SerializeToString, - automation__pb2.DeviceRole.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ZtpGetDeviceRolesByDeviceId(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, '/automation.AutomationService/ZtpGetDeviceRolesByDeviceId', - context__pb2.DeviceId.SerializeToString, - automation__pb2.DeviceRoleList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ZtpAdd(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, '/automation.AutomationService/ZtpAdd', - automation__pb2.DeviceRole.SerializeToString, - automation__pb2.DeviceRoleState.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ZtpUpdate(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, '/automation.AutomationService/ZtpUpdate', - automation__pb2.DeviceRole.SerializeToString, - automation__pb2.DeviceRoleState.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ZtpDelete(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, '/automation.AutomationService/ZtpDelete', - automation__pb2.DeviceRole.SerializeToString, - automation__pb2.DeviceRoleState.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ZtpDeleteAllByDeviceId(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, '/automation.AutomationService/ZtpDeleteAllByDeviceId', - context__pb2.DeviceId.SerializeToString, - automation__pb2.DeviceRoleState.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'ZtpGetDeviceRole': grpc.unary_unary_rpc_method_handler( + servicer.ZtpGetDeviceRole, + request_deserializer=automation__pb2.DeviceRoleId.FromString, + response_serializer=automation__pb2.DeviceRole.SerializeToString, + ), + 'ZtpGetDeviceRolesByDeviceId': grpc.unary_unary_rpc_method_handler( + servicer.ZtpGetDeviceRolesByDeviceId, + request_deserializer=context__pb2.DeviceId.FromString, + response_serializer=automation__pb2.DeviceRoleList.SerializeToString, + ), + 'ZtpAdd': grpc.unary_unary_rpc_method_handler( + servicer.ZtpAdd, + request_deserializer=automation__pb2.DeviceRole.FromString, + response_serializer=automation__pb2.DeviceRoleState.SerializeToString, + ), + 'ZtpUpdate': grpc.unary_unary_rpc_method_handler( + servicer.ZtpUpdate, + request_deserializer=automation__pb2.DeviceRole.FromString, + response_serializer=automation__pb2.DeviceRoleState.SerializeToString, + ), + 'ZtpDelete': grpc.unary_unary_rpc_method_handler( + servicer.ZtpDelete, + request_deserializer=automation__pb2.DeviceRole.FromString, + response_serializer=automation__pb2.DeviceRoleState.SerializeToString, + ), + 'ZtpDeleteAllByDeviceId': grpc.unary_unary_rpc_method_handler( + servicer.ZtpDeleteAllByDeviceId, + request_deserializer=context__pb2.DeviceId.FromString, + response_serializer=automation__pb2.DeviceRoleState.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'automation.AutomationService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/centralized_cybersecurity_pb2.py b/proto/src/centralized_cybersecurity_pb2.py index 996f3e35fe88374d81c3801d8b5d6e908301f62c..77c8497f8867a796a0fcd07d3777ed273f064d04 100644 --- a/proto/src/centralized_cybersecurity_pb2.py +++ b/proto/src/centralized_cybersecurity_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: centralized_cybersecurity.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -21,8 +23,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='centralized_cybersecurity', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x1f\x63\x65ntralized_cybersecurity.proto\x12\x19\x63\x65ntralized_cybersecurity\x1a\rcontext.proto\x1a\rservice.proto\x1a\x10monitoring.proto2\x80\x02\n\x1f\x43\x65ntralizedCyberSecurityService\x12\x39\n\x13NotifyServiceUpdate\x12\x10.service.Service\x1a\x0e.context.Empty\"\x00\x12\x30\n\x0c\x44\x65tectAttack\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x12<\n\x13ReportSummarizedKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x12\x32\n\tReportKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x62\x06proto3' + serialized_pb=_b('\n\x1f\x63\x65ntralized_cybersecurity.proto\x12\x19\x63\x65ntralized_cybersecurity\x1a\rcontext.proto\x1a\rservice.proto\x1a\x10monitoring.proto2\x80\x02\n\x1f\x43\x65ntralizedCyberSecurityService\x12\x39\n\x13NotifyServiceUpdate\x12\x10.service.Service\x1a\x0e.context.Empty\"\x00\x12\x30\n\x0c\x44\x65tectAttack\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x12<\n\x13ReportSummarizedKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x12\x32\n\tReportKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x62\x06proto3') , dependencies=[context__pb2.DESCRIPTOR,service__pb2.DESCRIPTOR,monitoring__pb2.DESCRIPTOR,]) @@ -38,7 +39,6 @@ _CENTRALIZEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, serialized_start=111, serialized_end=367, methods=[ @@ -50,7 +50,6 @@ _CENTRALIZEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( input_type=service__pb2._SERVICE, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='DetectAttack', @@ -60,7 +59,6 @@ _CENTRALIZEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._EMPTY, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ReportSummarizedKpi', @@ -70,7 +68,6 @@ _CENTRALIZEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( input_type=monitoring__pb2._KPILIST, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ReportKpi', @@ -80,7 +77,6 @@ _CENTRALIZEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( input_type=monitoring__pb2._KPILIST, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_CENTRALIZEDCYBERSECURITYSERVICE) diff --git a/proto/src/centralized_cybersecurity_pb2_grpc.py b/proto/src/centralized_cybersecurity_pb2_grpc.py index ddd7ccd8805e3f7b425a69d428a465c660199406..cfd15633b07082ee168863dea2cb909a9ac1cac4 100644 --- a/proto/src/centralized_cybersecurity_pb2_grpc.py +++ b/proto/src/centralized_cybersecurity_pb2_grpc.py @@ -1,5 +1,4 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 @@ -8,162 +7,93 @@ import service_pb2 as service__pb2 class CentralizedCyberSecurityServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.NotifyServiceUpdate = channel.unary_unary( - '/centralized_cybersecurity.CentralizedCyberSecurityService/NotifyServiceUpdate', - request_serializer=service__pb2.Service.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.DetectAttack = channel.unary_unary( - '/centralized_cybersecurity.CentralizedCyberSecurityService/DetectAttack', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.ReportSummarizedKpi = channel.unary_unary( - '/centralized_cybersecurity.CentralizedCyberSecurityService/ReportSummarizedKpi', - request_serializer=monitoring__pb2.KpiList.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.ReportKpi = channel.unary_unary( - '/centralized_cybersecurity.CentralizedCyberSecurityService/ReportKpi', - request_serializer=monitoring__pb2.KpiList.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.NotifyServiceUpdate = channel.unary_unary( + '/centralized_cybersecurity.CentralizedCyberSecurityService/NotifyServiceUpdate', + request_serializer=service__pb2.Service.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) + self.DetectAttack = channel.unary_unary( + '/centralized_cybersecurity.CentralizedCyberSecurityService/DetectAttack', + request_serializer=context__pb2.Empty.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) + self.ReportSummarizedKpi = channel.unary_unary( + '/centralized_cybersecurity.CentralizedCyberSecurityService/ReportSummarizedKpi', + request_serializer=monitoring__pb2.KpiList.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) + self.ReportKpi = channel.unary_unary( + '/centralized_cybersecurity.CentralizedCyberSecurityService/ReportKpi', + request_serializer=monitoring__pb2.KpiList.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) class CentralizedCyberSecurityServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def NotifyServiceUpdate(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DetectAttack(self, request, context): - """rpc that triggers the attack detection loop - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ReportSummarizedKpi(self, request, context): - """rpc called by the distributed component to report KPIs - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ReportKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + # missing associated documentation comment in .proto file + pass + + def NotifyServiceUpdate(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DetectAttack(self, request, context): + """rpc that triggers the attack detection loop + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ReportSummarizedKpi(self, request, context): + """rpc called by the distributed component to report KPIs + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ReportKpi(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_CentralizedCyberSecurityServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'NotifyServiceUpdate': grpc.unary_unary_rpc_method_handler( - servicer.NotifyServiceUpdate, - request_deserializer=service__pb2.Service.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'DetectAttack': grpc.unary_unary_rpc_method_handler( - servicer.DetectAttack, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'ReportSummarizedKpi': grpc.unary_unary_rpc_method_handler( - servicer.ReportSummarizedKpi, - request_deserializer=monitoring__pb2.KpiList.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'ReportKpi': grpc.unary_unary_rpc_method_handler( - servicer.ReportKpi, - request_deserializer=monitoring__pb2.KpiList.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'centralized_cybersecurity.CentralizedCyberSecurityService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class CentralizedCyberSecurityService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def NotifyServiceUpdate(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, '/centralized_cybersecurity.CentralizedCyberSecurityService/NotifyServiceUpdate', - service__pb2.Service.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DetectAttack(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, '/centralized_cybersecurity.CentralizedCyberSecurityService/DetectAttack', - context__pb2.Empty.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ReportSummarizedKpi(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, '/centralized_cybersecurity.CentralizedCyberSecurityService/ReportSummarizedKpi', - monitoring__pb2.KpiList.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ReportKpi(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, '/centralized_cybersecurity.CentralizedCyberSecurityService/ReportKpi', - monitoring__pb2.KpiList.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'NotifyServiceUpdate': grpc.unary_unary_rpc_method_handler( + servicer.NotifyServiceUpdate, + request_deserializer=service__pb2.Service.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + 'DetectAttack': grpc.unary_unary_rpc_method_handler( + servicer.DetectAttack, + request_deserializer=context__pb2.Empty.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + 'ReportSummarizedKpi': grpc.unary_unary_rpc_method_handler( + servicer.ReportSummarizedKpi, + request_deserializer=monitoring__pb2.KpiList.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + 'ReportKpi': grpc.unary_unary_rpc_method_handler( + servicer.ReportKpi, + request_deserializer=monitoring__pb2.KpiList.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'centralized_cybersecurity.CentralizedCyberSecurityService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/compute_pb2.py b/proto/src/compute_pb2.py index 80c7fedf5f29ed1ee7c84bee13c622c9ed5ca03d..ea9fa5ece1fa1cc2f6885f2cb981f1e18403acfb 100644 --- a/proto/src/compute_pb2.py +++ b/proto/src/compute_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: compute.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -20,8 +22,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='compute', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcompute.proto\x12\x07\x63ompute\x1a\rcontext.proto\x1a\rservice.proto2\x99\x04\n\x0e\x43omputeService\x12Q\n\x11\x63heck_credentials\x12\x1b.context.TeraFlowController\x1a\x1d.context.AuthenticationResult\"\x00\x12N\n\x1fget_connectivity_service_status\x12\x12.service.ServiceId\x1a\x15.service.ServiceState\"\x00\x12\x45\n\x1b\x63reate_connectivity_service\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x43\n\x19\x65\x64it_connectivity_service\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x41\n\x1b\x64\x65lete_connectivity_service\x12\x10.service.Service\x1a\x0e.context.Empty\"\x00\x12P\n$get_all_active_connectivity_services\x12\x0e.context.Empty\x1a\x16.service.ServiceIdList\"\x00\x12\x43\n\x1f\x63lear_all_connectivity_services\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x62\x06proto3' + serialized_pb=_b('\n\rcompute.proto\x12\x07\x63ompute\x1a\rcontext.proto\x1a\rservice.proto2\x99\x04\n\x0e\x43omputeService\x12Q\n\x11\x63heck_credentials\x12\x1b.context.TeraFlowController\x1a\x1d.context.AuthenticationResult\"\x00\x12N\n\x1fget_connectivity_service_status\x12\x12.service.ServiceId\x1a\x15.service.ServiceState\"\x00\x12\x45\n\x1b\x63reate_connectivity_service\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x43\n\x19\x65\x64it_connectivity_service\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x41\n\x1b\x64\x65lete_connectivity_service\x12\x10.service.Service\x1a\x0e.context.Empty\"\x00\x12P\n$get_all_active_connectivity_services\x12\x0e.context.Empty\x1a\x16.service.ServiceIdList\"\x00\x12\x43\n\x1f\x63lear_all_connectivity_services\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x62\x06proto3') , dependencies=[context__pb2.DESCRIPTOR,service__pb2.DESCRIPTOR,]) @@ -37,7 +38,6 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, serialized_start=57, serialized_end=594, methods=[ @@ -49,7 +49,6 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._TERAFLOWCONTROLLER, output_type=context__pb2._AUTHENTICATIONRESULT, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='get_connectivity_service_status', @@ -59,7 +58,6 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( input_type=service__pb2._SERVICEID, output_type=service__pb2._SERVICESTATE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='create_connectivity_service', @@ -69,7 +67,6 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( input_type=service__pb2._SERVICE, output_type=service__pb2._SERVICEID, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='edit_connectivity_service', @@ -79,7 +76,6 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( input_type=service__pb2._SERVICE, output_type=service__pb2._SERVICEID, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='delete_connectivity_service', @@ -89,7 +85,6 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( input_type=service__pb2._SERVICE, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='get_all_active_connectivity_services', @@ -99,7 +94,6 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._EMPTY, output_type=service__pb2._SERVICEIDLIST, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='clear_all_connectivity_services', @@ -109,7 +103,6 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._EMPTY, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_COMPUTESERVICE) diff --git a/proto/src/compute_pb2_grpc.py b/proto/src/compute_pb2_grpc.py index 4bea209b39296afe74708b43f1c61edd78ba5696..4b5d7228c6bf3b257f4ad741140e77d29d2e4868 100644 --- a/proto/src/compute_pb2_grpc.py +++ b/proto/src/compute_pb2_grpc.py @@ -1,5 +1,4 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 @@ -7,259 +6,144 @@ import service_pb2 as service__pb2 class ComputeServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.check_credentials = channel.unary_unary( - '/compute.ComputeService/check_credentials', - request_serializer=context__pb2.TeraFlowController.SerializeToString, - response_deserializer=context__pb2.AuthenticationResult.FromString, - ) - self.get_connectivity_service_status = channel.unary_unary( - '/compute.ComputeService/get_connectivity_service_status', - request_serializer=service__pb2.ServiceId.SerializeToString, - response_deserializer=service__pb2.ServiceState.FromString, - ) - self.create_connectivity_service = channel.unary_unary( - '/compute.ComputeService/create_connectivity_service', - request_serializer=service__pb2.Service.SerializeToString, - response_deserializer=service__pb2.ServiceId.FromString, - ) - self.edit_connectivity_service = channel.unary_unary( - '/compute.ComputeService/edit_connectivity_service', - request_serializer=service__pb2.Service.SerializeToString, - response_deserializer=service__pb2.ServiceId.FromString, - ) - self.delete_connectivity_service = channel.unary_unary( - '/compute.ComputeService/delete_connectivity_service', - request_serializer=service__pb2.Service.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.get_all_active_connectivity_services = channel.unary_unary( - '/compute.ComputeService/get_all_active_connectivity_services', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=service__pb2.ServiceIdList.FromString, - ) - self.clear_all_connectivity_services = channel.unary_unary( - '/compute.ComputeService/clear_all_connectivity_services', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.check_credentials = channel.unary_unary( + '/compute.ComputeService/check_credentials', + request_serializer=context__pb2.TeraFlowController.SerializeToString, + response_deserializer=context__pb2.AuthenticationResult.FromString, + ) + self.get_connectivity_service_status = channel.unary_unary( + '/compute.ComputeService/get_connectivity_service_status', + request_serializer=service__pb2.ServiceId.SerializeToString, + response_deserializer=service__pb2.ServiceState.FromString, + ) + self.create_connectivity_service = channel.unary_unary( + '/compute.ComputeService/create_connectivity_service', + request_serializer=service__pb2.Service.SerializeToString, + response_deserializer=service__pb2.ServiceId.FromString, + ) + self.edit_connectivity_service = channel.unary_unary( + '/compute.ComputeService/edit_connectivity_service', + request_serializer=service__pb2.Service.SerializeToString, + response_deserializer=service__pb2.ServiceId.FromString, + ) + self.delete_connectivity_service = channel.unary_unary( + '/compute.ComputeService/delete_connectivity_service', + request_serializer=service__pb2.Service.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) + self.get_all_active_connectivity_services = channel.unary_unary( + '/compute.ComputeService/get_all_active_connectivity_services', + request_serializer=context__pb2.Empty.SerializeToString, + response_deserializer=service__pb2.ServiceIdList.FromString, + ) + self.clear_all_connectivity_services = channel.unary_unary( + '/compute.ComputeService/clear_all_connectivity_services', + request_serializer=context__pb2.Empty.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) class ComputeServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def check_credentials(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def get_connectivity_service_status(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def create_connectivity_service(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def edit_connectivity_service(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def delete_connectivity_service(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def get_all_active_connectivity_services(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def clear_all_connectivity_services(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + # missing associated documentation comment in .proto file + pass + + def check_credentials(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def get_connectivity_service_status(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def create_connectivity_service(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def edit_connectivity_service(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def delete_connectivity_service(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def get_all_active_connectivity_services(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def clear_all_connectivity_services(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_ComputeServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'check_credentials': grpc.unary_unary_rpc_method_handler( - servicer.check_credentials, - request_deserializer=context__pb2.TeraFlowController.FromString, - response_serializer=context__pb2.AuthenticationResult.SerializeToString, - ), - 'get_connectivity_service_status': grpc.unary_unary_rpc_method_handler( - servicer.get_connectivity_service_status, - request_deserializer=service__pb2.ServiceId.FromString, - response_serializer=service__pb2.ServiceState.SerializeToString, - ), - 'create_connectivity_service': grpc.unary_unary_rpc_method_handler( - servicer.create_connectivity_service, - request_deserializer=service__pb2.Service.FromString, - response_serializer=service__pb2.ServiceId.SerializeToString, - ), - 'edit_connectivity_service': grpc.unary_unary_rpc_method_handler( - servicer.edit_connectivity_service, - request_deserializer=service__pb2.Service.FromString, - response_serializer=service__pb2.ServiceId.SerializeToString, - ), - 'delete_connectivity_service': grpc.unary_unary_rpc_method_handler( - servicer.delete_connectivity_service, - request_deserializer=service__pb2.Service.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'get_all_active_connectivity_services': grpc.unary_unary_rpc_method_handler( - servicer.get_all_active_connectivity_services, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=service__pb2.ServiceIdList.SerializeToString, - ), - 'clear_all_connectivity_services': grpc.unary_unary_rpc_method_handler( - servicer.clear_all_connectivity_services, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'compute.ComputeService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class ComputeService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def check_credentials(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, '/compute.ComputeService/check_credentials', - context__pb2.TeraFlowController.SerializeToString, - context__pb2.AuthenticationResult.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def get_connectivity_service_status(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, '/compute.ComputeService/get_connectivity_service_status', - service__pb2.ServiceId.SerializeToString, - service__pb2.ServiceState.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def create_connectivity_service(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, '/compute.ComputeService/create_connectivity_service', - service__pb2.Service.SerializeToString, - service__pb2.ServiceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def edit_connectivity_service(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, '/compute.ComputeService/edit_connectivity_service', - service__pb2.Service.SerializeToString, - service__pb2.ServiceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def delete_connectivity_service(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, '/compute.ComputeService/delete_connectivity_service', - service__pb2.Service.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def get_all_active_connectivity_services(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, '/compute.ComputeService/get_all_active_connectivity_services', - context__pb2.Empty.SerializeToString, - service__pb2.ServiceIdList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def clear_all_connectivity_services(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, '/compute.ComputeService/clear_all_connectivity_services', - context__pb2.Empty.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'check_credentials': grpc.unary_unary_rpc_method_handler( + servicer.check_credentials, + request_deserializer=context__pb2.TeraFlowController.FromString, + response_serializer=context__pb2.AuthenticationResult.SerializeToString, + ), + 'get_connectivity_service_status': grpc.unary_unary_rpc_method_handler( + servicer.get_connectivity_service_status, + request_deserializer=service__pb2.ServiceId.FromString, + response_serializer=service__pb2.ServiceState.SerializeToString, + ), + 'create_connectivity_service': grpc.unary_unary_rpc_method_handler( + servicer.create_connectivity_service, + request_deserializer=service__pb2.Service.FromString, + response_serializer=service__pb2.ServiceId.SerializeToString, + ), + 'edit_connectivity_service': grpc.unary_unary_rpc_method_handler( + servicer.edit_connectivity_service, + request_deserializer=service__pb2.Service.FromString, + response_serializer=service__pb2.ServiceId.SerializeToString, + ), + 'delete_connectivity_service': grpc.unary_unary_rpc_method_handler( + servicer.delete_connectivity_service, + request_deserializer=service__pb2.Service.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + 'get_all_active_connectivity_services': grpc.unary_unary_rpc_method_handler( + servicer.get_all_active_connectivity_services, + request_deserializer=context__pb2.Empty.FromString, + response_serializer=service__pb2.ServiceIdList.SerializeToString, + ), + 'clear_all_connectivity_services': grpc.unary_unary_rpc_method_handler( + servicer.clear_all_connectivity_services, + request_deserializer=context__pb2.Empty.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'compute.ComputeService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/context_pb2.py b/proto/src/context_pb2.py index 6aa7798fb3bb89f6b4b09a98d8b653b9fff526c4..d27de2618c175d3730376147f03ece21c8baefa6 100644 --- a/proto/src/context_pb2.py +++ b/proto/src/context_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: context.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -19,8 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='context', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\"\x07\n\x05\x45mpty\"T\n\x07\x43ontext\x12\x1f\n\x04topo\x18\x01 \x01(\x0b\x32\x11.context.Topology\x12(\n\x03\x63tl\x18\x02 \x01(\x0b\x32\x1b.context.TeraFlowController\"H\n\x08Topology\x12\x1f\n\x06\x64\x65vice\x18\x01 \x03(\x0b\x32\x0f.context.Device\x12\x1b\n\x04link\x18\x02 \x03(\x0b\x32\r.context.Link\"1\n\x04Link\x12)\n\x0c\x65ndpointList\x18\x01 \x03(\x0b\x32\x13.context.EndPointId\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"\xda\x01\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12>\n\x14\x64\x65vOperationalStatus\x18\x04 \x01(\x0e\x32 .context.DeviceOperationalStatus\x12\'\n\x0c\x65ndpointList\x18\x05 \x03(\x0b\x32\x11.context.EndPoint\"%\n\x0c\x44\x65viceConfig\x12\x15\n\rdevice_config\x18\x01 \x01(\t\"C\n\x08\x45ndPoint\x12$\n\x07port_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x11\n\tport_type\x18\x02 \x01(\t\"O\n\nEndPointId\x12\x1e\n\x07port_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12!\n\x06\x64\x65v_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\",\n\x08\x44\x65viceId\x12 \n\tdevice_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x12TeraFlowController\x12\x1d\n\x06\x63tl_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x11\n\tipaddress\x18\x02 \x01(\t\"L\n\x14\x41uthenticationResult\x12\x1d\n\x06\x63tl_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*4\n\x17\x44\x65viceOperationalStatus\x12\x0c\n\x08\x44ISABLED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x32\x44\n\x0e\x43ontextService\x12\x32\n\x0bGetTopology\x12\x0e.context.Empty\x1a\x11.context.Topology\"\x00\x62\x06proto3' + serialized_pb=_b('\n\rcontext.proto\x12\x07\x63ontext\"\x07\n\x05\x45mpty\"{\n\x07\x43ontext\x12%\n\tcontextId\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x1f\n\x04topo\x18\x02 \x01(\x0b\x32\x11.context.Topology\x12(\n\x03\x63tl\x18\x03 \x01(\x0b\x32\x1b.context.TeraFlowController\"/\n\tContextId\x12\"\n\x0b\x63ontextUuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"m\n\x08Topology\x12#\n\x06topoId\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\x12\x1f\n\x06\x64\x65vice\x18\x03 \x03(\x0b\x32\x0f.context.Device\x12\x1b\n\x04link\x18\x04 \x03(\x0b\x32\r.context.Link\"1\n\x04Link\x12)\n\x0c\x65ndpointList\x18\x01 \x03(\x0b\x32\x13.context.EndPointId\"R\n\nTopologyId\x12%\n\tcontextId\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x1d\n\x06topoId\x18\x02 \x01(\x0b\x32\r.context.Uuid\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"\xda\x01\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12>\n\x14\x64\x65vOperationalStatus\x18\x04 \x01(\x0e\x32 .context.DeviceOperationalStatus\x12\'\n\x0c\x65ndpointList\x18\x05 \x03(\x0b\x32\x11.context.EndPoint\"%\n\x0c\x44\x65viceConfig\x12\x15\n\rdevice_config\x18\x01 \x01(\t\"C\n\x08\x45ndPoint\x12$\n\x07port_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x11\n\tport_type\x18\x02 \x01(\t\"t\n\nEndPointId\x12#\n\x06topoId\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12!\n\x06\x64\x65v_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12\x1e\n\x07port_id\x18\x03 \x01(\x0b\x32\r.context.Uuid\",\n\x08\x44\x65viceId\x12 \n\tdevice_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"K\n\x12TeraFlowController\x12\"\n\x06\x63tl_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x11\n\tipaddress\x18\x02 \x01(\t\"Q\n\x14\x41uthenticationResult\x12\"\n\x06\x63tl_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*4\n\x17\x44\x65viceOperationalStatus\x12\x0c\n\x08\x44ISABLED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x32\x44\n\x0e\x43ontextService\x12\x32\n\x0bGetTopology\x12\x0e.context.Empty\x1a\x11.context.Topology\"\x00\x62\x06proto3') ) _DEVICEOPERATIONALSTATUS = _descriptor.EnumDescriptor( @@ -28,23 +29,20 @@ _DEVICEOPERATIONALSTATUS = _descriptor.EnumDescriptor( full_name='context.DeviceOperationalStatus', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='DISABLED', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='ENABLED', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, - serialized_start=939, - serialized_end=991, + serialized_start=1195, + serialized_end=1247, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUS) @@ -60,7 +58,6 @@ _EMPTY = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ ], extensions=[ @@ -85,22 +82,28 @@ _CONTEXT = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='topo', full_name='context.Context.topo', index=0, + name='contextId', full_name='context.Context.contextId', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( - name='ctl', full_name='context.Context.ctl', index=1, + name='topo', full_name='context.Context.topo', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='ctl', full_name='context.Context.ctl', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -114,7 +117,38 @@ _CONTEXT = _descriptor.Descriptor( oneofs=[ ], serialized_start=35, - serialized_end=119, + serialized_end=158, +) + + +_CONTEXTID = _descriptor.Descriptor( + name='ContextId', + full_name='context.ContextId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='contextUuid', full_name='context.ContextId.contextUuid', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=160, + serialized_end=207, ) @@ -124,22 +158,28 @@ _TOPOLOGY = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='device', full_name='context.Topology.device', index=0, - number=1, type=11, cpp_type=10, label=3, + name='topoId', full_name='context.Topology.topoId', index=0, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='device', full_name='context.Topology.device', index=1, + number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( - name='link', full_name='context.Topology.link', index=1, - number=2, type=11, cpp_type=10, label=3, + name='link', full_name='context.Topology.link', index=2, + number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -152,8 +192,8 @@ _TOPOLOGY = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=121, - serialized_end=193, + serialized_start=209, + serialized_end=318, ) @@ -163,7 +203,6 @@ _LINK = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='endpointList', full_name='context.Link.endpointList', index=0, @@ -171,7 +210,45 @@ _LINK = _descriptor.Descriptor( has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=320, + serialized_end=369, +) + + +_TOPOLOGYID = _descriptor.Descriptor( + name='TopologyId', + full_name='context.TopologyId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='contextId', full_name='context.TopologyId.contextId', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='topoId', full_name='context.TopologyId.topoId', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -184,8 +261,8 @@ _LINK = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=195, - serialized_end=244, + serialized_start=371, + serialized_end=453, ) @@ -195,22 +272,21 @@ _CONSTRAINT = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='constraint_type', full_name='context.Constraint.constraint_type', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='constraint_value', full_name='context.Constraint.constraint_value', index=1, number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -223,8 +299,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=246, - serialized_end=309, + serialized_start=455, + serialized_end=518, ) @@ -234,7 +310,6 @@ _DEVICE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='context.Device.device_id', index=0, @@ -242,35 +317,35 @@ _DEVICE = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_type', full_name='context.Device.device_type', index=1, number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_config', full_name='context.Device.device_config', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='devOperationalStatus', full_name='context.Device.devOperationalStatus', index=3, number=4, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='endpointList', full_name='context.Device.endpointList', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -283,8 +358,8 @@ _DEVICE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=312, - serialized_end=530, + serialized_start=521, + serialized_end=739, ) @@ -294,15 +369,14 @@ _DEVICECONFIG = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='device_config', full_name='context.DeviceConfig.device_config', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -315,8 +389,8 @@ _DEVICECONFIG = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=532, - serialized_end=569, + serialized_start=741, + serialized_end=778, ) @@ -326,7 +400,6 @@ _ENDPOINT = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='port_id', full_name='context.EndPoint.port_id', index=0, @@ -334,14 +407,14 @@ _ENDPOINT = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='port_type', full_name='context.EndPoint.port_type', index=1, number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -354,8 +427,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=571, - serialized_end=638, + serialized_start=780, + serialized_end=847, ) @@ -365,22 +438,28 @@ _ENDPOINTID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='port_id', full_name='context.EndPointId.port_id', index=0, + name='topoId', full_name='context.EndPointId.topoId', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='dev_id', full_name='context.EndPointId.dev_id', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='port_id', full_name='context.EndPointId.port_id', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -393,8 +472,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=640, - serialized_end=719, + serialized_start=849, + serialized_end=965, ) @@ -404,7 +483,6 @@ _DEVICEID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='device_id', full_name='context.DeviceId.device_id', index=0, @@ -412,7 +490,7 @@ _DEVICEID = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -425,8 +503,8 @@ _DEVICEID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=721, - serialized_end=765, + serialized_start=967, + serialized_end=1011, ) @@ -436,15 +514,14 @@ _UUID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='uuid', full_name='context.Uuid.uuid', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -457,8 +534,8 @@ _UUID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=767, - serialized_end=787, + serialized_start=1013, + serialized_end=1033, ) @@ -468,7 +545,6 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='ctl_id', full_name='context.TeraFlowController.ctl_id', index=0, @@ -476,14 +552,14 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ipaddress', full_name='context.TeraFlowController.ipaddress', index=1, number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -496,8 +572,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=789, - serialized_end=859, + serialized_start=1035, + serialized_end=1110, ) @@ -507,7 +583,6 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='ctl_id', full_name='context.AuthenticationResult.ctl_id', index=0, @@ -515,14 +590,14 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, number=2, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -535,29 +610,37 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=861, - serialized_end=937, + serialized_start=1112, + serialized_end=1193, ) +_CONTEXT.fields_by_name['contextId'].message_type = _CONTEXTID _CONTEXT.fields_by_name['topo'].message_type = _TOPOLOGY _CONTEXT.fields_by_name['ctl'].message_type = _TERAFLOWCONTROLLER +_CONTEXTID.fields_by_name['contextUuid'].message_type = _UUID +_TOPOLOGY.fields_by_name['topoId'].message_type = _TOPOLOGYID _TOPOLOGY.fields_by_name['device'].message_type = _DEVICE _TOPOLOGY.fields_by_name['link'].message_type = _LINK _LINK.fields_by_name['endpointList'].message_type = _ENDPOINTID +_TOPOLOGYID.fields_by_name['contextId'].message_type = _CONTEXTID +_TOPOLOGYID.fields_by_name['topoId'].message_type = _UUID _DEVICE.fields_by_name['device_id'].message_type = _DEVICEID _DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG _DEVICE.fields_by_name['devOperationalStatus'].enum_type = _DEVICEOPERATIONALSTATUS _DEVICE.fields_by_name['endpointList'].message_type = _ENDPOINT _ENDPOINT.fields_by_name['port_id'].message_type = _ENDPOINTID -_ENDPOINTID.fields_by_name['port_id'].message_type = _UUID +_ENDPOINTID.fields_by_name['topoId'].message_type = _TOPOLOGYID _ENDPOINTID.fields_by_name['dev_id'].message_type = _DEVICEID +_ENDPOINTID.fields_by_name['port_id'].message_type = _UUID _DEVICEID.fields_by_name['device_id'].message_type = _UUID -_TERAFLOWCONTROLLER.fields_by_name['ctl_id'].message_type = _UUID -_AUTHENTICATIONRESULT.fields_by_name['ctl_id'].message_type = _UUID +_TERAFLOWCONTROLLER.fields_by_name['ctl_id'].message_type = _CONTEXTID +_AUTHENTICATIONRESULT.fields_by_name['ctl_id'].message_type = _CONTEXTID DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT +DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY DESCRIPTOR.message_types_by_name['Link'] = _LINK +DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT DESCRIPTOR.message_types_by_name['Device'] = _DEVICE DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG @@ -584,6 +667,13 @@ Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message, }) _sym_db.RegisterMessage(Context) +ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ContextId) + }) +_sym_db.RegisterMessage(ContextId) + Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { 'DESCRIPTOR' : _TOPOLOGY, '__module__' : 'context_pb2' @@ -598,6 +688,13 @@ Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { }) _sym_db.RegisterMessage(Link) +TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGYID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.TopologyId) + }) +_sym_db.RegisterMessage(TopologyId) + Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { 'DESCRIPTOR' : _CONSTRAINT, '__module__' : 'context_pb2' @@ -669,9 +766,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=993, - serialized_end=1061, + serialized_start=1249, + serialized_end=1317, methods=[ _descriptor.MethodDescriptor( name='GetTopology', @@ -681,7 +777,6 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( input_type=_EMPTY, output_type=_TOPOLOGY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) diff --git a/proto/src/context_pb2_grpc.py b/proto/src/context_pb2_grpc.py index 93e66fd20396c644a53daf27ae944cd2bfdbd039..d64835e12d21e68616361612e959d3fd6393ab6a 100644 --- a/proto/src/context_pb2_grpc.py +++ b/proto/src/context_pb2_grpc.py @@ -1,66 +1,46 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 class ContextServiceStub(object): - """Missing associated documentation comment in .proto file.""" + # missing associated documentation comment in .proto file + pass - def __init__(self, channel): - """Constructor. + def __init__(self, channel): + """Constructor. - Args: - channel: A grpc.Channel. - """ - self.GetTopology = channel.unary_unary( - '/context.ContextService/GetTopology', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.Topology.FromString, - ) + Args: + channel: A grpc.Channel. + """ + self.GetTopology = channel.unary_unary( + '/context.ContextService/GetTopology', + request_serializer=context__pb2.Empty.SerializeToString, + response_deserializer=context__pb2.Topology.FromString, + ) class ContextServiceServicer(object): - """Missing associated documentation comment in .proto file.""" + # missing associated documentation comment in .proto file + pass - def GetTopology(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + def GetTopology(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_ContextServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'GetTopology': grpc.unary_unary_rpc_method_handler( - servicer.GetTopology, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.Topology.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'context.ContextService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class ContextService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def GetTopology(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, '/context.ContextService/GetTopology', - context__pb2.Empty.SerializeToString, - context__pb2.Topology.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'GetTopology': grpc.unary_unary_rpc_method_handler( + servicer.GetTopology, + request_deserializer=context__pb2.Empty.FromString, + response_serializer=context__pb2.Topology.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'context.ContextService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/device_pb2.py b/proto/src/device_pb2.py index e72c4b58f00e5fc715a9a21b018cc7ba2c236c95..e86c5042a7be395c776cba9e0ee2f5b3384833b4 100644 --- a/proto/src/device_pb2.py +++ b/proto/src/device_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: device.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -19,8 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='device', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0c\x64\x65vice.proto\x12\x06\x64\x65vice\x1a\rcontext.proto2\xb6\x01\n\rDeviceService\x12\x31\n\tAddDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12=\n\x0f\x43onfigureDevice\x12\x15.context.DeviceConfig\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0c\x44\x65leteDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3' + serialized_pb=_b('\n\x0c\x64\x65vice.proto\x12\x06\x64\x65vice\x1a\rcontext.proto2\xb6\x01\n\rDeviceService\x12\x31\n\tAddDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12=\n\x0f\x43onfigureDevice\x12\x15.context.DeviceConfig\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0c\x44\x65leteDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3') , dependencies=[context__pb2.DESCRIPTOR,]) @@ -36,7 +37,6 @@ _DEVICESERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, serialized_start=40, serialized_end=222, methods=[ @@ -48,7 +48,6 @@ _DEVICESERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._DEVICE, output_type=context__pb2._DEVICEID, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ConfigureDevice', @@ -58,7 +57,6 @@ _DEVICESERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._DEVICECONFIG, output_type=context__pb2._DEVICEID, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='DeleteDevice', @@ -68,7 +66,6 @@ _DEVICESERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._DEVICEID, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_DEVICESERVICE) diff --git a/proto/src/device_pb2_grpc.py b/proto/src/device_pb2_grpc.py index aed8b2e9954e682b69d96c3b9f08c0168586555c..ca45da27e378ba49118f4d101f80bca3e351070d 100644 --- a/proto/src/device_pb2_grpc.py +++ b/proto/src/device_pb2_grpc.py @@ -1,132 +1,80 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 class DeviceServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.AddDevice = channel.unary_unary( - '/device.DeviceService/AddDevice', - request_serializer=context__pb2.Device.SerializeToString, - response_deserializer=context__pb2.DeviceId.FromString, - ) - self.ConfigureDevice = channel.unary_unary( - '/device.DeviceService/ConfigureDevice', - request_serializer=context__pb2.DeviceConfig.SerializeToString, - response_deserializer=context__pb2.DeviceId.FromString, - ) - self.DeleteDevice = channel.unary_unary( - '/device.DeviceService/DeleteDevice', - request_serializer=context__pb2.DeviceId.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.AddDevice = channel.unary_unary( + '/device.DeviceService/AddDevice', + request_serializer=context__pb2.Device.SerializeToString, + response_deserializer=context__pb2.DeviceId.FromString, + ) + self.ConfigureDevice = channel.unary_unary( + '/device.DeviceService/ConfigureDevice', + request_serializer=context__pb2.DeviceConfig.SerializeToString, + response_deserializer=context__pb2.DeviceId.FromString, + ) + self.DeleteDevice = channel.unary_unary( + '/device.DeviceService/DeleteDevice', + request_serializer=context__pb2.DeviceId.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) class DeviceServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def AddDevice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ConfigureDevice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteDevice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + # missing associated documentation comment in .proto file + pass + + def AddDevice(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ConfigureDevice(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteDevice(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_DeviceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'AddDevice': grpc.unary_unary_rpc_method_handler( - servicer.AddDevice, - request_deserializer=context__pb2.Device.FromString, - response_serializer=context__pb2.DeviceId.SerializeToString, - ), - 'ConfigureDevice': grpc.unary_unary_rpc_method_handler( - servicer.ConfigureDevice, - request_deserializer=context__pb2.DeviceConfig.FromString, - response_serializer=context__pb2.DeviceId.SerializeToString, - ), - 'DeleteDevice': grpc.unary_unary_rpc_method_handler( - servicer.DeleteDevice, - request_deserializer=context__pb2.DeviceId.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'device.DeviceService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class DeviceService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def AddDevice(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, '/device.DeviceService/AddDevice', - context__pb2.Device.SerializeToString, - context__pb2.DeviceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ConfigureDevice(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, '/device.DeviceService/ConfigureDevice', - context__pb2.DeviceConfig.SerializeToString, - context__pb2.DeviceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DeleteDevice(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, '/device.DeviceService/DeleteDevice', - context__pb2.DeviceId.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'AddDevice': grpc.unary_unary_rpc_method_handler( + servicer.AddDevice, + request_deserializer=context__pb2.Device.FromString, + response_serializer=context__pb2.DeviceId.SerializeToString, + ), + 'ConfigureDevice': grpc.unary_unary_rpc_method_handler( + servicer.ConfigureDevice, + request_deserializer=context__pb2.DeviceConfig.FromString, + response_serializer=context__pb2.DeviceId.SerializeToString, + ), + 'DeleteDevice': grpc.unary_unary_rpc_method_handler( + servicer.DeleteDevice, + request_deserializer=context__pb2.DeviceId.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'device.DeviceService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/distributed_cybersecurity_pb2.py b/proto/src/distributed_cybersecurity_pb2.py index d31f5bb5fd2efd9ae136dfd6daf190cc2598ce44..841a62540e94d2b152b93d1b170d751a28bcd732 100644 --- a/proto/src/distributed_cybersecurity_pb2.py +++ b/proto/src/distributed_cybersecurity_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: distributed_cybersecurity.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -20,8 +22,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='distributed_cybersecurity', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x1f\x64istributed_cybersecurity.proto\x12\x19\x64istributed_cybersecurity\x1a\rcontext.proto\x1a\x10monitoring.proto2\x87\x01\n\x1f\x44istributedCyberSecurityService\x12\x30\n\x0c\x44\x65tectAttack\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x12\x32\n\tReportKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x62\x06proto3' + serialized_pb=_b('\n\x1f\x64istributed_cybersecurity.proto\x12\x19\x64istributed_cybersecurity\x1a\rcontext.proto\x1a\x10monitoring.proto2\x87\x01\n\x1f\x44istributedCyberSecurityService\x12\x30\n\x0c\x44\x65tectAttack\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x12\x32\n\tReportKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x62\x06proto3') , dependencies=[context__pb2.DESCRIPTOR,monitoring__pb2.DESCRIPTOR,]) @@ -37,7 +38,6 @@ _DISTRIBUTEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, serialized_start=96, serialized_end=231, methods=[ @@ -49,7 +49,6 @@ _DISTRIBUTEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._EMPTY, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ReportKpi', @@ -59,7 +58,6 @@ _DISTRIBUTEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( input_type=monitoring__pb2._KPILIST, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_DISTRIBUTEDCYBERSECURITYSERVICE) diff --git a/proto/src/distributed_cybersecurity_pb2_grpc.py b/proto/src/distributed_cybersecurity_pb2_grpc.py index d5e004a0cac25bebdf19365663fb9ec118b8bbc7..e8b7c9d2dc01993396def5af26e2c4de70e60211 100644 --- a/proto/src/distributed_cybersecurity_pb2_grpc.py +++ b/proto/src/distributed_cybersecurity_pb2_grpc.py @@ -1,5 +1,4 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 @@ -7,96 +6,59 @@ import monitoring_pb2 as monitoring__pb2 class DistributedCyberSecurityServiceStub(object): - """Missing associated documentation comment in .proto file.""" + # missing associated documentation comment in .proto file + pass - def __init__(self, channel): - """Constructor. + def __init__(self, channel): + """Constructor. - Args: - channel: A grpc.Channel. - """ - self.DetectAttack = channel.unary_unary( - '/distributed_cybersecurity.DistributedCyberSecurityService/DetectAttack', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.ReportKpi = channel.unary_unary( - '/distributed_cybersecurity.DistributedCyberSecurityService/ReportKpi', - request_serializer=monitoring__pb2.KpiList.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) + Args: + channel: A grpc.Channel. + """ + self.DetectAttack = channel.unary_unary( + '/distributed_cybersecurity.DistributedCyberSecurityService/DetectAttack', + request_serializer=context__pb2.Empty.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) + self.ReportKpi = channel.unary_unary( + '/distributed_cybersecurity.DistributedCyberSecurityService/ReportKpi', + request_serializer=monitoring__pb2.KpiList.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) class DistributedCyberSecurityServiceServicer(object): - """Missing associated documentation comment in .proto file.""" + # missing associated documentation comment in .proto file + pass - def DetectAttack(self, request, context): - """rpc that triggers the attack detection loop - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + def DetectAttack(self, request, context): + """rpc that triggers the attack detection loop + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') - def ReportKpi(self, request, context): - """receiving KPIs from monitored devices (packed processors) - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + def ReportKpi(self, request, context): + """receiving KPIs from monitored devices (packed processors) + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_DistributedCyberSecurityServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'DetectAttack': grpc.unary_unary_rpc_method_handler( - servicer.DetectAttack, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'ReportKpi': grpc.unary_unary_rpc_method_handler( - servicer.ReportKpi, - request_deserializer=monitoring__pb2.KpiList.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'distributed_cybersecurity.DistributedCyberSecurityService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class DistributedCyberSecurityService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def DetectAttack(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, '/distributed_cybersecurity.DistributedCyberSecurityService/DetectAttack', - context__pb2.Empty.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ReportKpi(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, '/distributed_cybersecurity.DistributedCyberSecurityService/ReportKpi', - monitoring__pb2.KpiList.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'DetectAttack': grpc.unary_unary_rpc_method_handler( + servicer.DetectAttack, + request_deserializer=context__pb2.Empty.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + 'ReportKpi': grpc.unary_unary_rpc_method_handler( + servicer.ReportKpi, + request_deserializer=monitoring__pb2.KpiList.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'distributed_cybersecurity.DistributedCyberSecurityService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/dlt_pb2.py b/proto/src/dlt_pb2.py index afd35b76ee0d3a700101fc01660bcf47fa8740aa..d1fa00a9faa75873b1790613851273e9dd86cb5d 100644 --- a/proto/src/dlt_pb2.py +++ b/proto/src/dlt_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: dlt.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -20,8 +22,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='dlt', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\tdlt.proto\x12\x03\x64lt\x1a\rcontext.proto\"e\n\x15\x44ltRecordSubscription\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.dlt.DltRecordType\x12*\n\toperation\x18\x02 \x01(\x0e\x32\x17.dlt.DltRecordOperation\"\x85\x01\n\tDltRecord\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.dlt.DltRecordId\x12 \n\x04type\x18\x02 \x01(\x0e\x32\x12.dlt.DltRecordType\x12*\n\toperation\x18\x03 \x01(\x0e\x32\x17.dlt.DltRecordOperation\x12\x0c\n\x04json\x18\x04 \x01(\t\"(\n\x0b\x44ltRecordId\x12\x19\n\x02id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"V\n\x0cRecordStatus\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.dlt.DltRecordId\x12(\n\x06status\x18\x02 \x01(\x0e\x32\x18.dlt.DltRecordStatusEnum\"Y\n\tDltStatus\x12(\n\x03\x63tl\x18\x01 \x01(\x0b\x32\x1b.context.TeraFlowController\x12\"\n\x06status\x18\x02 \x01(\x0e\x32\x12.dlt.DltStatusEnum*@\n\rDltRecordType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07SERVICE\x10\x01\x12\n\n\x06\x44\x45VICE\x10\x02\x12\t\n\x05SLICE\x10\x03*5\n\x12\x44ltRecordOperation\x12\x07\n\x03\x41\x44\x44\x10\x00\x12\n\n\x06UPDATE\x10\x01\x12\n\n\x06\x44\x45LETE\x10\x02*>\n\x13\x44ltRecordStatusEnum\x12\r\n\tREQUESTED\x10\x00\x12\n\n\x06STORED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02*N\n\rDltStatusEnum\x12\x11\n\rNOT_AVAILABLE\x10\x00\x12\x0f\n\x0bINITIALIZED\x10\x01\x12\r\n\tAVAILABLE\x10\x02\x12\n\n\x06\x44\x45INIT\x10\x03\x32\xe6\x01\n\nDltService\x12\x32\n\x0bRecordToDlt\x12\x0e.dlt.DltRecord\x1a\x11.dlt.RecordStatus\"\x00\x12\x30\n\nGetFromDlt\x12\x10.dlt.DltRecordId\x1a\x0e.dlt.DltRecord\"\x00\x12@\n\x0eSubscribeToDlt\x12\x1a.dlt.DltRecordSubscription\x1a\x0e.dlt.DltRecord\"\x00\x30\x01\x12\x30\n\x0cGetDltStatus\x12\x0e.context.Empty\x1a\x0e.dlt.DltStatus\"\x00\x62\x06proto3' + serialized_pb=_b('\n\tdlt.proto\x12\x03\x64lt\x1a\rcontext.proto\"e\n\x15\x44ltRecordSubscription\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.dlt.DltRecordType\x12*\n\toperation\x18\x02 \x01(\x0e\x32\x17.dlt.DltRecordOperation\"\x85\x01\n\tDltRecord\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.dlt.DltRecordId\x12 \n\x04type\x18\x02 \x01(\x0e\x32\x12.dlt.DltRecordType\x12*\n\toperation\x18\x03 \x01(\x0e\x32\x17.dlt.DltRecordOperation\x12\x0c\n\x04json\x18\x04 \x01(\t\"(\n\x0b\x44ltRecordId\x12\x19\n\x02id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"V\n\x0cRecordStatus\x12\x1c\n\x02id\x18\x01 \x01(\x0b\x32\x10.dlt.DltRecordId\x12(\n\x06status\x18\x02 \x01(\x0e\x32\x18.dlt.DltRecordStatusEnum\"Y\n\tDltStatus\x12(\n\x03\x63tl\x18\x01 \x01(\x0b\x32\x1b.context.TeraFlowController\x12\"\n\x06status\x18\x02 \x01(\x0e\x32\x12.dlt.DltStatusEnum*@\n\rDltRecordType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07SERVICE\x10\x01\x12\n\n\x06\x44\x45VICE\x10\x02\x12\t\n\x05SLICE\x10\x03*5\n\x12\x44ltRecordOperation\x12\x07\n\x03\x41\x44\x44\x10\x00\x12\n\n\x06UPDATE\x10\x01\x12\n\n\x06\x44\x45LETE\x10\x02*>\n\x13\x44ltRecordStatusEnum\x12\r\n\tREQUESTED\x10\x00\x12\n\n\x06STORED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02*N\n\rDltStatusEnum\x12\x11\n\rNOT_AVAILABLE\x10\x00\x12\x0f\n\x0bINITIALIZED\x10\x01\x12\r\n\tAVAILABLE\x10\x02\x12\n\n\x06\x44\x45INIT\x10\x03\x32\xe6\x01\n\nDltService\x12\x32\n\x0bRecordToDlt\x12\x0e.dlt.DltRecord\x1a\x11.dlt.RecordStatus\"\x00\x12\x30\n\nGetFromDlt\x12\x10.dlt.DltRecordId\x1a\x0e.dlt.DltRecord\"\x00\x12@\n\x0eSubscribeToDlt\x12\x1a.dlt.DltRecordSubscription\x1a\x0e.dlt.DltRecord\"\x00\x30\x01\x12\x30\n\x0cGetDltStatus\x12\x0e.context.Empty\x1a\x0e.dlt.DltStatus\"\x00\x62\x06proto3') , dependencies=[context__pb2.DESCRIPTOR,]) @@ -30,28 +31,23 @@ _DLTRECORDTYPE = _descriptor.EnumDescriptor( full_name='dlt.DltRecordType', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='UNKNOWN', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='SERVICE', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='DEVICE', index=2, number=2, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='SLICE', index=3, number=3, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, @@ -66,23 +62,19 @@ _DLTRECORDOPERATION = _descriptor.EnumDescriptor( full_name='dlt.DltRecordOperation', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='ADD', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='UPDATE', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='DELETE', index=2, number=2, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, @@ -97,23 +89,19 @@ _DLTRECORDSTATUSENUM = _descriptor.EnumDescriptor( full_name='dlt.DltRecordStatusEnum', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='REQUESTED', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='STORED', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='DISABLED', index=2, number=2, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, @@ -128,28 +116,23 @@ _DLTSTATUSENUM = _descriptor.EnumDescriptor( full_name='dlt.DltStatusEnum', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='NOT_AVAILABLE', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='INITIALIZED', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='AVAILABLE', index=2, number=2, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='DEINIT', index=3, number=3, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, @@ -182,7 +165,6 @@ _DLTRECORDSUBSCRIPTION = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='type', full_name='dlt.DltRecordSubscription.type', index=0, @@ -190,14 +172,14 @@ _DLTRECORDSUBSCRIPTION = _descriptor.Descriptor( has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='operation', full_name='dlt.DltRecordSubscription.operation', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -221,7 +203,6 @@ _DLTRECORD = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='id', full_name='dlt.DltRecord.id', index=0, @@ -229,28 +210,28 @@ _DLTRECORD = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='type', full_name='dlt.DltRecord.type', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='operation', full_name='dlt.DltRecord.operation', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='json', full_name='dlt.DltRecord.json', index=3, number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -274,7 +255,6 @@ _DLTRECORDID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='id', full_name='dlt.DltRecordId.id', index=0, @@ -282,7 +262,7 @@ _DLTRECORDID = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -306,7 +286,6 @@ _RECORDSTATUS = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='id', full_name='dlt.RecordStatus.id', index=0, @@ -314,14 +293,14 @@ _RECORDSTATUS = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='dlt.RecordStatus.status', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -345,7 +324,6 @@ _DLTSTATUS = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='ctl', full_name='dlt.DltStatus.ctl', index=0, @@ -353,14 +331,14 @@ _DLTSTATUS = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='dlt.DltStatus.status', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -441,7 +419,6 @@ _DLTSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, serialized_start=759, serialized_end=989, methods=[ @@ -453,7 +430,6 @@ _DLTSERVICE = _descriptor.ServiceDescriptor( input_type=_DLTRECORD, output_type=_RECORDSTATUS, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetFromDlt', @@ -463,7 +439,6 @@ _DLTSERVICE = _descriptor.ServiceDescriptor( input_type=_DLTRECORDID, output_type=_DLTRECORD, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='SubscribeToDlt', @@ -473,7 +448,6 @@ _DLTSERVICE = _descriptor.ServiceDescriptor( input_type=_DLTRECORDSUBSCRIPTION, output_type=_DLTRECORD, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetDltStatus', @@ -483,7 +457,6 @@ _DLTSERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._EMPTY, output_type=_DLTSTATUS, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_DLTSERVICE) diff --git a/proto/src/dlt_pb2_grpc.py b/proto/src/dlt_pb2_grpc.py index acbd11ccb95a36092e8514d5789feed978290c92..a8b22526ecb0fec394facaea76bdb94b03bc8d14 100644 --- a/proto/src/dlt_pb2_grpc.py +++ b/proto/src/dlt_pb2_grpc.py @@ -1,5 +1,4 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 @@ -7,160 +6,93 @@ import dlt_pb2 as dlt__pb2 class DltServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.RecordToDlt = channel.unary_unary( - '/dlt.DltService/RecordToDlt', - request_serializer=dlt__pb2.DltRecord.SerializeToString, - response_deserializer=dlt__pb2.RecordStatus.FromString, - ) - self.GetFromDlt = channel.unary_unary( - '/dlt.DltService/GetFromDlt', - request_serializer=dlt__pb2.DltRecordId.SerializeToString, - response_deserializer=dlt__pb2.DltRecord.FromString, - ) - self.SubscribeToDlt = channel.unary_stream( - '/dlt.DltService/SubscribeToDlt', - request_serializer=dlt__pb2.DltRecordSubscription.SerializeToString, - response_deserializer=dlt__pb2.DltRecord.FromString, - ) - self.GetDltStatus = channel.unary_unary( - '/dlt.DltService/GetDltStatus', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=dlt__pb2.DltStatus.FromString, - ) + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.RecordToDlt = channel.unary_unary( + '/dlt.DltService/RecordToDlt', + request_serializer=dlt__pb2.DltRecord.SerializeToString, + response_deserializer=dlt__pb2.RecordStatus.FromString, + ) + self.GetFromDlt = channel.unary_unary( + '/dlt.DltService/GetFromDlt', + request_serializer=dlt__pb2.DltRecordId.SerializeToString, + response_deserializer=dlt__pb2.DltRecord.FromString, + ) + self.SubscribeToDlt = channel.unary_stream( + '/dlt.DltService/SubscribeToDlt', + request_serializer=dlt__pb2.DltRecordSubscription.SerializeToString, + response_deserializer=dlt__pb2.DltRecord.FromString, + ) + self.GetDltStatus = channel.unary_unary( + '/dlt.DltService/GetDltStatus', + request_serializer=context__pb2.Empty.SerializeToString, + response_deserializer=dlt__pb2.DltStatus.FromString, + ) class DltServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def RecordToDlt(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetFromDlt(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SubscribeToDlt(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetDltStatus(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + # missing associated documentation comment in .proto file + pass + + def RecordToDlt(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetFromDlt(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SubscribeToDlt(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetDltStatus(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_DltServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'RecordToDlt': grpc.unary_unary_rpc_method_handler( - servicer.RecordToDlt, - request_deserializer=dlt__pb2.DltRecord.FromString, - response_serializer=dlt__pb2.RecordStatus.SerializeToString, - ), - 'GetFromDlt': grpc.unary_unary_rpc_method_handler( - servicer.GetFromDlt, - request_deserializer=dlt__pb2.DltRecordId.FromString, - response_serializer=dlt__pb2.DltRecord.SerializeToString, - ), - 'SubscribeToDlt': grpc.unary_stream_rpc_method_handler( - servicer.SubscribeToDlt, - request_deserializer=dlt__pb2.DltRecordSubscription.FromString, - response_serializer=dlt__pb2.DltRecord.SerializeToString, - ), - 'GetDltStatus': grpc.unary_unary_rpc_method_handler( - servicer.GetDltStatus, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=dlt__pb2.DltStatus.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'dlt.DltService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class DltService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def RecordToDlt(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, '/dlt.DltService/RecordToDlt', - dlt__pb2.DltRecord.SerializeToString, - dlt__pb2.RecordStatus.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetFromDlt(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, '/dlt.DltService/GetFromDlt', - dlt__pb2.DltRecordId.SerializeToString, - dlt__pb2.DltRecord.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SubscribeToDlt(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_stream(request, target, '/dlt.DltService/SubscribeToDlt', - dlt__pb2.DltRecordSubscription.SerializeToString, - dlt__pb2.DltRecord.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetDltStatus(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, '/dlt.DltService/GetDltStatus', - context__pb2.Empty.SerializeToString, - dlt__pb2.DltStatus.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'RecordToDlt': grpc.unary_unary_rpc_method_handler( + servicer.RecordToDlt, + request_deserializer=dlt__pb2.DltRecord.FromString, + response_serializer=dlt__pb2.RecordStatus.SerializeToString, + ), + 'GetFromDlt': grpc.unary_unary_rpc_method_handler( + servicer.GetFromDlt, + request_deserializer=dlt__pb2.DltRecordId.FromString, + response_serializer=dlt__pb2.DltRecord.SerializeToString, + ), + 'SubscribeToDlt': grpc.unary_stream_rpc_method_handler( + servicer.SubscribeToDlt, + request_deserializer=dlt__pb2.DltRecordSubscription.FromString, + response_serializer=dlt__pb2.DltRecord.SerializeToString, + ), + 'GetDltStatus': grpc.unary_unary_rpc_method_handler( + servicer.GetDltStatus, + request_deserializer=context__pb2.Empty.FromString, + response_serializer=dlt__pb2.DltStatus.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'dlt.DltService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/interdomain_pb2.py b/proto/src/interdomain_pb2.py index aa1444df06c8c1f976723863ec980018a1faa851..f94dec630b86f1844ac321b4fa0f5a363398fac4 100644 --- a/proto/src/interdomain_pb2.py +++ b/proto/src/interdomain_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: interdomain.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -20,8 +22,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='interdomain', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x11interdomain.proto\x12\x0binterdomain\x1a\rcontext.proto\x1a\x0bslice.proto2\xab\x02\n\x12InterdomainService\x12L\n\x0c\x41uthenticate\x12\x1b.context.TeraFlowController\x1a\x1d.context.AuthenticationResult\"\x00\x12\x36\n\x0bLookUpSlice\x12\x15.slice.TransportSlice\x1a\x0e.slice.SliceId\"\x00\x12\x44\n\x15OrderSliceFromCatalog\x12\x15.slice.TransportSlice\x1a\x12.slice.SliceStatus\"\x00\x12I\n\x1a\x43reateSliceAndAddToCatalog\x12\x15.slice.TransportSlice\x1a\x12.slice.SliceStatus\"\x00\x62\x06proto3' + serialized_pb=_b('\n\x11interdomain.proto\x12\x0binterdomain\x1a\rcontext.proto\x1a\x0bslice.proto2\xab\x02\n\x12InterdomainService\x12L\n\x0c\x41uthenticate\x12\x1b.context.TeraFlowController\x1a\x1d.context.AuthenticationResult\"\x00\x12\x36\n\x0bLookUpSlice\x12\x15.slice.TransportSlice\x1a\x0e.slice.SliceId\"\x00\x12\x44\n\x15OrderSliceFromCatalog\x12\x15.slice.TransportSlice\x1a\x12.slice.SliceStatus\"\x00\x12I\n\x1a\x43reateSliceAndAddToCatalog\x12\x15.slice.TransportSlice\x1a\x12.slice.SliceStatus\"\x00\x62\x06proto3') , dependencies=[context__pb2.DESCRIPTOR,slice__pb2.DESCRIPTOR,]) @@ -37,7 +38,6 @@ _INTERDOMAINSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, serialized_start=63, serialized_end=362, methods=[ @@ -49,7 +49,6 @@ _INTERDOMAINSERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._TERAFLOWCONTROLLER, output_type=context__pb2._AUTHENTICATIONRESULT, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='LookUpSlice', @@ -59,7 +58,6 @@ _INTERDOMAINSERVICE = _descriptor.ServiceDescriptor( input_type=slice__pb2._TRANSPORTSLICE, output_type=slice__pb2._SLICEID, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='OrderSliceFromCatalog', @@ -69,7 +67,6 @@ _INTERDOMAINSERVICE = _descriptor.ServiceDescriptor( input_type=slice__pb2._TRANSPORTSLICE, output_type=slice__pb2._SLICESTATUS, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='CreateSliceAndAddToCatalog', @@ -79,7 +76,6 @@ _INTERDOMAINSERVICE = _descriptor.ServiceDescriptor( input_type=slice__pb2._TRANSPORTSLICE, output_type=slice__pb2._SLICESTATUS, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_INTERDOMAINSERVICE) diff --git a/proto/src/interdomain_pb2_grpc.py b/proto/src/interdomain_pb2_grpc.py index 9df51786c4d019075cd5fd333edaf8905afbd463..5bbeb7bd7900633ace0b711e3a15c2c23415169e 100644 --- a/proto/src/interdomain_pb2_grpc.py +++ b/proto/src/interdomain_pb2_grpc.py @@ -1,5 +1,4 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 @@ -7,160 +6,93 @@ import slice_pb2 as slice__pb2 class InterdomainServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Authenticate = channel.unary_unary( - '/interdomain.InterdomainService/Authenticate', - request_serializer=context__pb2.TeraFlowController.SerializeToString, - response_deserializer=context__pb2.AuthenticationResult.FromString, - ) - self.LookUpSlice = channel.unary_unary( - '/interdomain.InterdomainService/LookUpSlice', - request_serializer=slice__pb2.TransportSlice.SerializeToString, - response_deserializer=slice__pb2.SliceId.FromString, - ) - self.OrderSliceFromCatalog = channel.unary_unary( - '/interdomain.InterdomainService/OrderSliceFromCatalog', - request_serializer=slice__pb2.TransportSlice.SerializeToString, - response_deserializer=slice__pb2.SliceStatus.FromString, - ) - self.CreateSliceAndAddToCatalog = channel.unary_unary( - '/interdomain.InterdomainService/CreateSliceAndAddToCatalog', - request_serializer=slice__pb2.TransportSlice.SerializeToString, - response_deserializer=slice__pb2.SliceStatus.FromString, - ) + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Authenticate = channel.unary_unary( + '/interdomain.InterdomainService/Authenticate', + request_serializer=context__pb2.TeraFlowController.SerializeToString, + response_deserializer=context__pb2.AuthenticationResult.FromString, + ) + self.LookUpSlice = channel.unary_unary( + '/interdomain.InterdomainService/LookUpSlice', + request_serializer=slice__pb2.TransportSlice.SerializeToString, + response_deserializer=slice__pb2.SliceId.FromString, + ) + self.OrderSliceFromCatalog = channel.unary_unary( + '/interdomain.InterdomainService/OrderSliceFromCatalog', + request_serializer=slice__pb2.TransportSlice.SerializeToString, + response_deserializer=slice__pb2.SliceStatus.FromString, + ) + self.CreateSliceAndAddToCatalog = channel.unary_unary( + '/interdomain.InterdomainService/CreateSliceAndAddToCatalog', + request_serializer=slice__pb2.TransportSlice.SerializeToString, + response_deserializer=slice__pb2.SliceStatus.FromString, + ) class InterdomainServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def Authenticate(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def LookUpSlice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def OrderSliceFromCatalog(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateSliceAndAddToCatalog(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + # missing associated documentation comment in .proto file + pass + + def Authenticate(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def LookUpSlice(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def OrderSliceFromCatalog(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateSliceAndAddToCatalog(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_InterdomainServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'Authenticate': grpc.unary_unary_rpc_method_handler( - servicer.Authenticate, - request_deserializer=context__pb2.TeraFlowController.FromString, - response_serializer=context__pb2.AuthenticationResult.SerializeToString, - ), - 'LookUpSlice': grpc.unary_unary_rpc_method_handler( - servicer.LookUpSlice, - request_deserializer=slice__pb2.TransportSlice.FromString, - response_serializer=slice__pb2.SliceId.SerializeToString, - ), - 'OrderSliceFromCatalog': grpc.unary_unary_rpc_method_handler( - servicer.OrderSliceFromCatalog, - request_deserializer=slice__pb2.TransportSlice.FromString, - response_serializer=slice__pb2.SliceStatus.SerializeToString, - ), - 'CreateSliceAndAddToCatalog': grpc.unary_unary_rpc_method_handler( - servicer.CreateSliceAndAddToCatalog, - request_deserializer=slice__pb2.TransportSlice.FromString, - response_serializer=slice__pb2.SliceStatus.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'interdomain.InterdomainService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class InterdomainService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def Authenticate(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, '/interdomain.InterdomainService/Authenticate', - context__pb2.TeraFlowController.SerializeToString, - context__pb2.AuthenticationResult.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def LookUpSlice(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, '/interdomain.InterdomainService/LookUpSlice', - slice__pb2.TransportSlice.SerializeToString, - slice__pb2.SliceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def OrderSliceFromCatalog(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, '/interdomain.InterdomainService/OrderSliceFromCatalog', - slice__pb2.TransportSlice.SerializeToString, - slice__pb2.SliceStatus.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def CreateSliceAndAddToCatalog(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, '/interdomain.InterdomainService/CreateSliceAndAddToCatalog', - slice__pb2.TransportSlice.SerializeToString, - slice__pb2.SliceStatus.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'Authenticate': grpc.unary_unary_rpc_method_handler( + servicer.Authenticate, + request_deserializer=context__pb2.TeraFlowController.FromString, + response_serializer=context__pb2.AuthenticationResult.SerializeToString, + ), + 'LookUpSlice': grpc.unary_unary_rpc_method_handler( + servicer.LookUpSlice, + request_deserializer=slice__pb2.TransportSlice.FromString, + response_serializer=slice__pb2.SliceId.SerializeToString, + ), + 'OrderSliceFromCatalog': grpc.unary_unary_rpc_method_handler( + servicer.OrderSliceFromCatalog, + request_deserializer=slice__pb2.TransportSlice.FromString, + response_serializer=slice__pb2.SliceStatus.SerializeToString, + ), + 'CreateSliceAndAddToCatalog': grpc.unary_unary_rpc_method_handler( + servicer.CreateSliceAndAddToCatalog, + request_deserializer=slice__pb2.TransportSlice.FromString, + response_serializer=slice__pb2.SliceStatus.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'interdomain.InterdomainService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/monitoring_pb2.py b/proto/src/monitoring_pb2.py index 0d35be4dab56540bcc3de82b590a122e80d2c79c..2553dc6d264faeeed5e379506a7dc759c40ec8ef 100644 --- a/proto/src/monitoring_pb2.py +++ b/proto/src/monitoring_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: monitoring.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -19,8 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='monitoring', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x10monitoring.proto\x12\nmonitoring\x1a\rcontext.proto\"|\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x16\n\x0ekpiDescription\x18\x03 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"T\n\tKpiDevice\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"+\n\x07KpiList\x12 \n\x07kpiList\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi\"M\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x13\n\tstringVal\x18\x02 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x03 \x01(\x08H\x00\x42\x07\n\x05value2\xeb\x01\n\x11MonitoringService\x12/\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x0e.context.Empty\"\x00\x12\x35\n\nMonitorKpi\x12\x15.monitoring.KpiDevice\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetStream_kpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3' + serialized_pb=_b('\n\x10monitoring.proto\x12\nmonitoring\x1a\rcontext.proto\"|\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x16\n\x0ekpiDescription\x18\x03 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"T\n\tKpiDevice\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"+\n\x07KpiList\x12 \n\x07kpiList\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi\"M\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x13\n\tstringVal\x18\x02 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x03 \x01(\x08H\x00\x42\x07\n\x05value2\xeb\x01\n\x11MonitoringService\x12/\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x0e.context.Empty\"\x00\x12\x35\n\nMonitorKpi\x12\x15.monitoring.KpiDevice\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetStream_kpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3') , dependencies=[context__pb2.DESCRIPTOR,]) @@ -33,7 +34,6 @@ _KPI = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpi_id', full_name='monitoring.Kpi.kpi_id', index=0, @@ -41,28 +41,28 @@ _KPI = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='monitoring.Kpi.timestamp', index=1, number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kpiDescription', full_name='monitoring.Kpi.kpiDescription', index=2, number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kpi_value', full_name='monitoring.Kpi.kpi_value', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -86,7 +86,6 @@ _KPIID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpi_id', full_name='monitoring.KpiId.kpi_id', index=0, @@ -94,7 +93,7 @@ _KPIID = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -118,7 +117,6 @@ _KPIDEVICE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpi_id', full_name='monitoring.KpiDevice.kpi_id', index=0, @@ -126,14 +124,14 @@ _KPIDEVICE = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_id', full_name='monitoring.KpiDevice.device_id', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -157,7 +155,6 @@ _KPILIST = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpiList', full_name='monitoring.KpiList.kpiList', index=0, @@ -165,7 +162,7 @@ _KPILIST = _descriptor.Descriptor( has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -189,7 +186,6 @@ _KPIVALUE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='intVal', full_name='monitoring.KpiValue.intVal', index=0, @@ -197,21 +193,21 @@ _KPIVALUE = _descriptor.Descriptor( has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='stringVal', full_name='monitoring.KpiValue.stringVal', index=1, number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='boolVal', full_name='monitoring.KpiValue.boolVal', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -225,9 +221,7 @@ _KPIVALUE = _descriptor.Descriptor( oneofs=[ _descriptor.OneofDescriptor( name='value', full_name='monitoring.KpiValue.value', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), + index=0, containing_type=None, fields=[]), ], serialized_start=344, serialized_end=421, @@ -298,7 +292,6 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, serialized_start=424, serialized_end=659, methods=[ @@ -310,7 +303,6 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPI, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='MonitorKpi', @@ -320,7 +312,6 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPIDEVICE, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetStream_kpi', @@ -330,7 +321,6 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPIID, output_type=_KPI, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetInstantKpi', @@ -340,7 +330,6 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPIID, output_type=_KPI, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_MONITORINGSERVICE) diff --git a/proto/src/monitoring_pb2_grpc.py b/proto/src/monitoring_pb2_grpc.py index 0c74d26a1df11a9cfb1fa366c528c51a8e1c5db9..10904ec3785342e05b730de0456cf25b443af7d1 100644 --- a/proto/src/monitoring_pb2_grpc.py +++ b/proto/src/monitoring_pb2_grpc.py @@ -1,5 +1,4 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 @@ -7,160 +6,93 @@ import monitoring_pb2 as monitoring__pb2 class MonitoringServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.IncludeKpi = channel.unary_unary( - '/monitoring.MonitoringService/IncludeKpi', - request_serializer=monitoring__pb2.Kpi.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.MonitorKpi = channel.unary_unary( - '/monitoring.MonitoringService/MonitorKpi', - request_serializer=monitoring__pb2.KpiDevice.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.GetStream_kpi = channel.unary_stream( - '/monitoring.MonitoringService/GetStream_kpi', - request_serializer=monitoring__pb2.KpiId.SerializeToString, - response_deserializer=monitoring__pb2.Kpi.FromString, - ) - self.GetInstantKpi = channel.unary_unary( - '/monitoring.MonitoringService/GetInstantKpi', - request_serializer=monitoring__pb2.KpiId.SerializeToString, - response_deserializer=monitoring__pb2.Kpi.FromString, - ) + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.IncludeKpi = channel.unary_unary( + '/monitoring.MonitoringService/IncludeKpi', + request_serializer=monitoring__pb2.Kpi.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) + self.MonitorKpi = channel.unary_unary( + '/monitoring.MonitoringService/MonitorKpi', + request_serializer=monitoring__pb2.KpiDevice.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) + self.GetStream_kpi = channel.unary_stream( + '/monitoring.MonitoringService/GetStream_kpi', + request_serializer=monitoring__pb2.KpiId.SerializeToString, + response_deserializer=monitoring__pb2.Kpi.FromString, + ) + self.GetInstantKpi = channel.unary_unary( + '/monitoring.MonitoringService/GetInstantKpi', + request_serializer=monitoring__pb2.KpiId.SerializeToString, + response_deserializer=monitoring__pb2.Kpi.FromString, + ) class MonitoringServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def IncludeKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def MonitorKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetStream_kpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetInstantKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + # missing associated documentation comment in .proto file + pass + + def IncludeKpi(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def MonitorKpi(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetStream_kpi(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetInstantKpi(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_MonitoringServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'IncludeKpi': grpc.unary_unary_rpc_method_handler( - servicer.IncludeKpi, - request_deserializer=monitoring__pb2.Kpi.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'MonitorKpi': grpc.unary_unary_rpc_method_handler( - servicer.MonitorKpi, - request_deserializer=monitoring__pb2.KpiDevice.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'GetStream_kpi': grpc.unary_stream_rpc_method_handler( - servicer.GetStream_kpi, - request_deserializer=monitoring__pb2.KpiId.FromString, - response_serializer=monitoring__pb2.Kpi.SerializeToString, - ), - 'GetInstantKpi': grpc.unary_unary_rpc_method_handler( - servicer.GetInstantKpi, - request_deserializer=monitoring__pb2.KpiId.FromString, - response_serializer=monitoring__pb2.Kpi.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'monitoring.MonitoringService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class MonitoringService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def IncludeKpi(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, '/monitoring.MonitoringService/IncludeKpi', - monitoring__pb2.Kpi.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def MonitorKpi(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, '/monitoring.MonitoringService/MonitorKpi', - monitoring__pb2.KpiDevice.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetStream_kpi(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_stream(request, target, '/monitoring.MonitoringService/GetStream_kpi', - monitoring__pb2.KpiId.SerializeToString, - monitoring__pb2.Kpi.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetInstantKpi(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, '/monitoring.MonitoringService/GetInstantKpi', - monitoring__pb2.KpiId.SerializeToString, - monitoring__pb2.Kpi.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'IncludeKpi': grpc.unary_unary_rpc_method_handler( + servicer.IncludeKpi, + request_deserializer=monitoring__pb2.Kpi.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + 'MonitorKpi': grpc.unary_unary_rpc_method_handler( + servicer.MonitorKpi, + request_deserializer=monitoring__pb2.KpiDevice.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + 'GetStream_kpi': grpc.unary_stream_rpc_method_handler( + servicer.GetStream_kpi, + request_deserializer=monitoring__pb2.KpiId.FromString, + response_serializer=monitoring__pb2.Kpi.SerializeToString, + ), + 'GetInstantKpi': grpc.unary_unary_rpc_method_handler( + servicer.GetInstantKpi, + request_deserializer=monitoring__pb2.KpiId.FromString, + response_serializer=monitoring__pb2.Kpi.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'monitoring.MonitoringService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/policy_pb2.py b/proto/src/policy_pb2.py index f9684c01ac022c4dc6d558f752f7c1f56e81ebc9..69c49bfb0706114e715ce6be866ed8c02ca37a91 100644 --- a/proto/src/policy_pb2.py +++ b/proto/src/policy_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: policy.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -21,8 +23,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='policy', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0cpolicy.proto\x12\x06policy\x1a\rcontext.proto\x1a\rservice.proto\"<\n\x0ePolicyRuleList\x12*\n\x0epolicyRuleList\x18\x01 \x03(\x0b\x32\x12.policy.PolicyRule\"\xac\x02\n\nPolicyRule\x12*\n\x0cpolicyRuleId\x18\x01 \x01(\x0b\x32\x14.policy.PolicyRuleId\x12\'\n\x0bserviceList\x18\x02 \x03(\x0b\x32\x12.service.ServiceId\x12%\n\ndeviceList\x18\x03 \x03(\x0b\x32\x11.context.DeviceId\x12\x16\n\x0epolicyRuleType\x18\x04 \x01(\t\x12\x1a\n\x12PolicyRulePriority\x18\x05 \x01(\t\x12\x39\n\x14polRuleConditionList\x18\x06 \x03(\x0b\x32\x1b.policy.PolicyRuleCondition\x12\x33\n\x11polRuleActionList\x18\x07 \x03(\x0b\x32\x18.policy.PolicyRuleAction\"+\n\x0cPolicyRuleId\x12\x1b\n\x04uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x84\x01\n\x13PolicyRuleCondition\x12\x37\n\x13polRuleConditionVar\x18\x01 \x01(\x0b\x32\x1a.policy.PolicyRuleVariable\x12\x34\n\x13polRuleConditionVal\x18\x02 \x01(\x0b\x32\x17.policy.PolicyRuleValue\"{\n\x10PolicyRuleAction\x12\x34\n\x10polRuleActionVar\x18\x01 \x01(\x0b\x32\x1a.policy.PolicyRuleVariable\x12\x31\n\x10polRuleActionVal\x18\x02 \x01(\x0b\x32\x17.policy.PolicyRuleValue\"0\n\x12PolicyRuleVariable\x12\x1a\n\x12policyRuleVariable\x18\x01 \x01(\t\"*\n\x0fPolicyRuleValue\x12\x17\n\x0fpolicyRuleValue\x18\x01 \x01(\t\"b\n\x0fPolicyRuleState\x12#\n\x0cpolicyRuleId\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12*\n\x0fpolicyRuleState\x18\x02 \x01(\x0e\x32\x11.policy.RuleState*$\n\tRuleState\x12\x0b\n\x07PLANNED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x32\x8c\x03\n\rPolicyService\x12:\n\tPolicyAdd\x12\x12.policy.PolicyRule\x1a\x17.policy.PolicyRuleState\"\x00\x12=\n\x0cPolicyUpdate\x12\x12.policy.PolicyRule\x1a\x17.policy.PolicyRuleState\"\x00\x12=\n\x0cPolicyDelete\x12\x12.policy.PolicyRule\x1a\x17.policy.PolicyRuleState\"\x00\x12\x37\n\tGetPolicy\x12\x14.policy.PolicyRuleId\x1a\x12.policy.PolicyRule\"\x00\x12\x42\n\x13GetPolicyByDeviceId\x12\x11.context.DeviceId\x1a\x16.policy.PolicyRuleList\"\x00\x12\x44\n\x14GetPolicyByServiceId\x12\x12.service.ServiceId\x1a\x16.policy.PolicyRuleList\"\x00\x62\x06proto3' + serialized_pb=_b('\n\x0cpolicy.proto\x12\x06policy\x1a\rcontext.proto\x1a\rservice.proto\"<\n\x0ePolicyRuleList\x12*\n\x0epolicyRuleList\x18\x01 \x03(\x0b\x32\x12.policy.PolicyRule\"\xac\x02\n\nPolicyRule\x12*\n\x0cpolicyRuleId\x18\x01 \x01(\x0b\x32\x14.policy.PolicyRuleId\x12\'\n\x0bserviceList\x18\x02 \x03(\x0b\x32\x12.service.ServiceId\x12%\n\ndeviceList\x18\x03 \x03(\x0b\x32\x11.context.DeviceId\x12\x16\n\x0epolicyRuleType\x18\x04 \x01(\t\x12\x1a\n\x12PolicyRulePriority\x18\x05 \x01(\t\x12\x39\n\x14polRuleConditionList\x18\x06 \x03(\x0b\x32\x1b.policy.PolicyRuleCondition\x12\x33\n\x11polRuleActionList\x18\x07 \x03(\x0b\x32\x18.policy.PolicyRuleAction\"+\n\x0cPolicyRuleId\x12\x1b\n\x04uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x84\x01\n\x13PolicyRuleCondition\x12\x37\n\x13polRuleConditionVar\x18\x01 \x01(\x0b\x32\x1a.policy.PolicyRuleVariable\x12\x34\n\x13polRuleConditionVal\x18\x02 \x01(\x0b\x32\x17.policy.PolicyRuleValue\"{\n\x10PolicyRuleAction\x12\x34\n\x10polRuleActionVar\x18\x01 \x01(\x0b\x32\x1a.policy.PolicyRuleVariable\x12\x31\n\x10polRuleActionVal\x18\x02 \x01(\x0b\x32\x17.policy.PolicyRuleValue\"0\n\x12PolicyRuleVariable\x12\x1a\n\x12policyRuleVariable\x18\x01 \x01(\t\"*\n\x0fPolicyRuleValue\x12\x17\n\x0fpolicyRuleValue\x18\x01 \x01(\t\"b\n\x0fPolicyRuleState\x12#\n\x0cpolicyRuleId\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12*\n\x0fpolicyRuleState\x18\x02 \x01(\x0e\x32\x11.policy.RuleState*$\n\tRuleState\x12\x0b\n\x07PLANNED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x32\x8c\x03\n\rPolicyService\x12:\n\tPolicyAdd\x12\x12.policy.PolicyRule\x1a\x17.policy.PolicyRuleState\"\x00\x12=\n\x0cPolicyUpdate\x12\x12.policy.PolicyRule\x1a\x17.policy.PolicyRuleState\"\x00\x12=\n\x0cPolicyDelete\x12\x12.policy.PolicyRule\x1a\x17.policy.PolicyRuleState\"\x00\x12\x37\n\tGetPolicy\x12\x14.policy.PolicyRuleId\x1a\x12.policy.PolicyRule\"\x00\x12\x42\n\x13GetPolicyByDeviceId\x12\x11.context.DeviceId\x1a\x16.policy.PolicyRuleList\"\x00\x12\x44\n\x14GetPolicyByServiceId\x12\x12.service.ServiceId\x1a\x16.policy.PolicyRuleList\"\x00\x62\x06proto3') , dependencies=[context__pb2.DESCRIPTOR,service__pb2.DESCRIPTOR,]) @@ -31,18 +32,15 @@ _RULESTATE = _descriptor.EnumDescriptor( full_name='policy.RuleState', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='PLANNED', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='ACTIVE', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, @@ -63,7 +61,6 @@ _POLICYRULELIST = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='policyRuleList', full_name='policy.PolicyRuleList.policyRuleList', index=0, @@ -71,7 +68,7 @@ _POLICYRULELIST = _descriptor.Descriptor( has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -95,7 +92,6 @@ _POLICYRULE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='policyRuleId', full_name='policy.PolicyRule.policyRuleId', index=0, @@ -103,49 +99,49 @@ _POLICYRULE = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='serviceList', full_name='policy.PolicyRule.serviceList', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='deviceList', full_name='policy.PolicyRule.deviceList', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='policyRuleType', full_name='policy.PolicyRule.policyRuleType', index=3, number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='PolicyRulePriority', full_name='policy.PolicyRule.PolicyRulePriority', index=4, number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='polRuleConditionList', full_name='policy.PolicyRule.polRuleConditionList', index=5, number=6, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='polRuleActionList', full_name='policy.PolicyRule.polRuleActionList', index=6, number=7, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -169,7 +165,6 @@ _POLICYRULEID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='uuid', full_name='policy.PolicyRuleId.uuid', index=0, @@ -177,7 +172,7 @@ _POLICYRULEID = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -201,7 +196,6 @@ _POLICYRULECONDITION = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='polRuleConditionVar', full_name='policy.PolicyRuleCondition.polRuleConditionVar', index=0, @@ -209,14 +203,14 @@ _POLICYRULECONDITION = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='polRuleConditionVal', full_name='policy.PolicyRuleCondition.polRuleConditionVal', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -240,7 +234,6 @@ _POLICYRULEACTION = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='polRuleActionVar', full_name='policy.PolicyRuleAction.polRuleActionVar', index=0, @@ -248,14 +241,14 @@ _POLICYRULEACTION = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='polRuleActionVal', full_name='policy.PolicyRuleAction.polRuleActionVal', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -279,15 +272,14 @@ _POLICYRULEVARIABLE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='policyRuleVariable', full_name='policy.PolicyRuleVariable.policyRuleVariable', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -311,15 +303,14 @@ _POLICYRULEVALUE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='policyRuleValue', full_name='policy.PolicyRuleValue.policyRuleValue', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -343,7 +334,6 @@ _POLICYRULESTATE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='policyRuleId', full_name='policy.PolicyRuleState.policyRuleId', index=0, @@ -351,14 +341,14 @@ _POLICYRULESTATE = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='policyRuleState', full_name='policy.PolicyRuleState.policyRuleState', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -463,7 +453,6 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, serialized_start=957, serialized_end=1353, methods=[ @@ -475,7 +464,6 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( input_type=_POLICYRULE, output_type=_POLICYRULESTATE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='PolicyUpdate', @@ -485,7 +473,6 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( input_type=_POLICYRULE, output_type=_POLICYRULESTATE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='PolicyDelete', @@ -495,7 +482,6 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( input_type=_POLICYRULE, output_type=_POLICYRULESTATE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetPolicy', @@ -505,7 +491,6 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( input_type=_POLICYRULEID, output_type=_POLICYRULE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetPolicyByDeviceId', @@ -515,7 +500,6 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._DEVICEID, output_type=_POLICYRULELIST, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetPolicyByServiceId', @@ -525,7 +509,6 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( input_type=service__pb2._SERVICEID, output_type=_POLICYRULELIST, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_POLICYSERVICE) diff --git a/proto/src/policy_pb2_grpc.py b/proto/src/policy_pb2_grpc.py index 5de12fa15880ff8023c0674f7d32ec249b8a276c..e7cea718547c3f9af99586c351cf7316724209a4 100644 --- a/proto/src/policy_pb2_grpc.py +++ b/proto/src/policy_pb2_grpc.py @@ -1,5 +1,4 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 @@ -8,226 +7,127 @@ import service_pb2 as service__pb2 class PolicyServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.PolicyAdd = channel.unary_unary( - '/policy.PolicyService/PolicyAdd', - request_serializer=policy__pb2.PolicyRule.SerializeToString, - response_deserializer=policy__pb2.PolicyRuleState.FromString, - ) - self.PolicyUpdate = channel.unary_unary( - '/policy.PolicyService/PolicyUpdate', - request_serializer=policy__pb2.PolicyRule.SerializeToString, - response_deserializer=policy__pb2.PolicyRuleState.FromString, - ) - self.PolicyDelete = channel.unary_unary( - '/policy.PolicyService/PolicyDelete', - request_serializer=policy__pb2.PolicyRule.SerializeToString, - response_deserializer=policy__pb2.PolicyRuleState.FromString, - ) - self.GetPolicy = channel.unary_unary( - '/policy.PolicyService/GetPolicy', - request_serializer=policy__pb2.PolicyRuleId.SerializeToString, - response_deserializer=policy__pb2.PolicyRule.FromString, - ) - self.GetPolicyByDeviceId = channel.unary_unary( - '/policy.PolicyService/GetPolicyByDeviceId', - request_serializer=context__pb2.DeviceId.SerializeToString, - response_deserializer=policy__pb2.PolicyRuleList.FromString, - ) - self.GetPolicyByServiceId = channel.unary_unary( - '/policy.PolicyService/GetPolicyByServiceId', - request_serializer=service__pb2.ServiceId.SerializeToString, - response_deserializer=policy__pb2.PolicyRuleList.FromString, - ) + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.PolicyAdd = channel.unary_unary( + '/policy.PolicyService/PolicyAdd', + request_serializer=policy__pb2.PolicyRule.SerializeToString, + response_deserializer=policy__pb2.PolicyRuleState.FromString, + ) + self.PolicyUpdate = channel.unary_unary( + '/policy.PolicyService/PolicyUpdate', + request_serializer=policy__pb2.PolicyRule.SerializeToString, + response_deserializer=policy__pb2.PolicyRuleState.FromString, + ) + self.PolicyDelete = channel.unary_unary( + '/policy.PolicyService/PolicyDelete', + request_serializer=policy__pb2.PolicyRule.SerializeToString, + response_deserializer=policy__pb2.PolicyRuleState.FromString, + ) + self.GetPolicy = channel.unary_unary( + '/policy.PolicyService/GetPolicy', + request_serializer=policy__pb2.PolicyRuleId.SerializeToString, + response_deserializer=policy__pb2.PolicyRule.FromString, + ) + self.GetPolicyByDeviceId = channel.unary_unary( + '/policy.PolicyService/GetPolicyByDeviceId', + request_serializer=context__pb2.DeviceId.SerializeToString, + response_deserializer=policy__pb2.PolicyRuleList.FromString, + ) + self.GetPolicyByServiceId = channel.unary_unary( + '/policy.PolicyService/GetPolicyByServiceId', + request_serializer=service__pb2.ServiceId.SerializeToString, + response_deserializer=policy__pb2.PolicyRuleList.FromString, + ) class PolicyServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def PolicyAdd(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def PolicyUpdate(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def PolicyDelete(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetPolicy(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetPolicyByDeviceId(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetPolicyByServiceId(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + # missing associated documentation comment in .proto file + pass + + def PolicyAdd(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def PolicyUpdate(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def PolicyDelete(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetPolicy(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetPolicyByDeviceId(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetPolicyByServiceId(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_PolicyServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'PolicyAdd': grpc.unary_unary_rpc_method_handler( - servicer.PolicyAdd, - request_deserializer=policy__pb2.PolicyRule.FromString, - response_serializer=policy__pb2.PolicyRuleState.SerializeToString, - ), - 'PolicyUpdate': grpc.unary_unary_rpc_method_handler( - servicer.PolicyUpdate, - request_deserializer=policy__pb2.PolicyRule.FromString, - response_serializer=policy__pb2.PolicyRuleState.SerializeToString, - ), - 'PolicyDelete': grpc.unary_unary_rpc_method_handler( - servicer.PolicyDelete, - request_deserializer=policy__pb2.PolicyRule.FromString, - response_serializer=policy__pb2.PolicyRuleState.SerializeToString, - ), - 'GetPolicy': grpc.unary_unary_rpc_method_handler( - servicer.GetPolicy, - request_deserializer=policy__pb2.PolicyRuleId.FromString, - response_serializer=policy__pb2.PolicyRule.SerializeToString, - ), - 'GetPolicyByDeviceId': grpc.unary_unary_rpc_method_handler( - servicer.GetPolicyByDeviceId, - request_deserializer=context__pb2.DeviceId.FromString, - response_serializer=policy__pb2.PolicyRuleList.SerializeToString, - ), - 'GetPolicyByServiceId': grpc.unary_unary_rpc_method_handler( - servicer.GetPolicyByServiceId, - request_deserializer=service__pb2.ServiceId.FromString, - response_serializer=policy__pb2.PolicyRuleList.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'policy.PolicyService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class PolicyService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def PolicyAdd(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, '/policy.PolicyService/PolicyAdd', - policy__pb2.PolicyRule.SerializeToString, - policy__pb2.PolicyRuleState.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def PolicyUpdate(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, '/policy.PolicyService/PolicyUpdate', - policy__pb2.PolicyRule.SerializeToString, - policy__pb2.PolicyRuleState.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def PolicyDelete(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, '/policy.PolicyService/PolicyDelete', - policy__pb2.PolicyRule.SerializeToString, - policy__pb2.PolicyRuleState.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetPolicy(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, '/policy.PolicyService/GetPolicy', - policy__pb2.PolicyRuleId.SerializeToString, - policy__pb2.PolicyRule.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetPolicyByDeviceId(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, '/policy.PolicyService/GetPolicyByDeviceId', - context__pb2.DeviceId.SerializeToString, - policy__pb2.PolicyRuleList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetPolicyByServiceId(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, '/policy.PolicyService/GetPolicyByServiceId', - service__pb2.ServiceId.SerializeToString, - policy__pb2.PolicyRuleList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'PolicyAdd': grpc.unary_unary_rpc_method_handler( + servicer.PolicyAdd, + request_deserializer=policy__pb2.PolicyRule.FromString, + response_serializer=policy__pb2.PolicyRuleState.SerializeToString, + ), + 'PolicyUpdate': grpc.unary_unary_rpc_method_handler( + servicer.PolicyUpdate, + request_deserializer=policy__pb2.PolicyRule.FromString, + response_serializer=policy__pb2.PolicyRuleState.SerializeToString, + ), + 'PolicyDelete': grpc.unary_unary_rpc_method_handler( + servicer.PolicyDelete, + request_deserializer=policy__pb2.PolicyRule.FromString, + response_serializer=policy__pb2.PolicyRuleState.SerializeToString, + ), + 'GetPolicy': grpc.unary_unary_rpc_method_handler( + servicer.GetPolicy, + request_deserializer=policy__pb2.PolicyRuleId.FromString, + response_serializer=policy__pb2.PolicyRule.SerializeToString, + ), + 'GetPolicyByDeviceId': grpc.unary_unary_rpc_method_handler( + servicer.GetPolicyByDeviceId, + request_deserializer=context__pb2.DeviceId.FromString, + response_serializer=policy__pb2.PolicyRuleList.SerializeToString, + ), + 'GetPolicyByServiceId': grpc.unary_unary_rpc_method_handler( + servicer.GetPolicyByServiceId, + request_deserializer=service__pb2.ServiceId.FromString, + response_serializer=policy__pb2.PolicyRuleList.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'policy.PolicyService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/service_pb2.py b/proto/src/service_pb2.py index 6d41f661ca86956fbbaaf3b64594bce9a922856a..9375349b0cb327ab92c87db0a759ee59fc590892 100644 --- a/proto/src/service_pb2.py +++ b/proto/src/service_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: service.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -20,8 +22,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='service', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto\"+\n\x0bServiceList\x12\x1c\n\x02\x63s\x18\x01 \x03(\x0b\x32\x10.service.Service\"\x87\x02\n\x07Service\x12!\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\x12.service.ServiceId\x12)\n\x0bserviceType\x18\x02 \x01(\x0e\x32\x14.service.ServiceType\x12)\n\x0c\x65ndpointList\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\'\n\nconstraint\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12+\n\x0cserviceState\x18\x05 \x01(\x0b\x32\x15.service.ServiceState\x12-\n\rserviceConfig\x18\x06 \x01(\x0b\x32\x16.service.ServiceConfig\"&\n\rServiceConfig\x12\x15\n\rserviceConfig\x18\x01 \x01(\t\")\n\tServiceId\x12\x1c\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\":\n\rServiceIdList\x12)\n\rserviceIdList\x18\x01 \x03(\x0b\x32\x12.service.ServiceId\"?\n\x0cServiceState\x12/\n\x0cserviceState\x18\x01 \x01(\x0e\x32\x19.service.ServiceStateEnum\"=\n\x0e\x43onnectionList\x12+\n\x0e\x63onnectionList\x18\x01 \x03(\x0b\x32\x13.service.Connection\"\x84\x01\n\nConnection\x12%\n\x06\x63on_id\x18\x01 \x01(\x0b\x32\x15.service.ConnectionId\x12,\n\x10relatedServiceId\x18\x02 \x01(\x0b\x32\x12.service.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"-\n\x0c\x43onnectionId\x12\x1d\n\x06\x63on_id\x18\x01 \x01(\x0b\x32\r.context.Uuid*M\n\x0bServiceType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04L3NM\x10\x01\x12\x08\n\x04L2NM\x10\x02\x12\x1d\n\x19TAPI_CONNECTIVITY_SERVICE\x10\x03*@\n\x10ServiceStateEnum\x12\x0b\n\x07PLANNED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x13\n\x0fPENDING_REMOVAL\x10\x02\x32\xef\x02\n\x0eServiceService\x12\x38\n\x0eGetServiceList\x12\x0e.context.Empty\x1a\x14.service.ServiceList\"\x00\x12\x37\n\rCreateService\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x37\n\rDeleteService\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x38\n\x0eGetServiceById\x12\x12.service.ServiceId\x1a\x10.service.Service\"\x00\x12>\n\x11GetConnectionList\x12\x0e.context.Empty\x1a\x17.service.ConnectionList\"\x00\x62\x06proto3' + serialized_pb=_b('\n\rservice.proto\x12\x07service\x1a\rcontext.proto\"+\n\x0bServiceList\x12\x1c\n\x02\x63s\x18\x01 \x03(\x0b\x32\x10.service.Service\"\x87\x02\n\x07Service\x12!\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\x12.service.ServiceId\x12)\n\x0bserviceType\x18\x02 \x01(\x0e\x32\x14.service.ServiceType\x12)\n\x0c\x65ndpointList\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\'\n\nconstraint\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12+\n\x0cserviceState\x18\x05 \x01(\x0b\x32\x15.service.ServiceState\x12-\n\rserviceConfig\x18\x06 \x01(\x0b\x32\x16.service.ServiceConfig\"&\n\rServiceConfig\x12\x15\n\rserviceConfig\x18\x01 \x01(\t\"P\n\tServiceId\x12%\n\tcontextId\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x1c\n\x05\x63s_id\x18\x02 \x01(\x0b\x32\r.context.Uuid\":\n\rServiceIdList\x12)\n\rserviceIdList\x18\x01 \x03(\x0b\x32\x12.service.ServiceId\"?\n\x0cServiceState\x12/\n\x0cserviceState\x18\x01 \x01(\x0e\x32\x19.service.ServiceStateEnum\"=\n\x0e\x43onnectionList\x12+\n\x0e\x63onnectionList\x18\x01 \x03(\x0b\x32\x13.service.Connection\"\x84\x01\n\nConnection\x12%\n\x06\x63on_id\x18\x01 \x01(\x0b\x32\x15.service.ConnectionId\x12,\n\x10relatedServiceId\x18\x02 \x01(\x0b\x32\x12.service.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"-\n\x0c\x43onnectionId\x12\x1d\n\x06\x63on_id\x18\x01 \x01(\x0b\x32\r.context.Uuid*M\n\x0bServiceType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04L3NM\x10\x01\x12\x08\n\x04L2NM\x10\x02\x12\x1d\n\x19TAPI_CONNECTIVITY_SERVICE\x10\x03*@\n\x10ServiceStateEnum\x12\x0b\n\x07PLANNED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x13\n\x0fPENDING_REMOVAL\x10\x02\x32\xef\x02\n\x0eServiceService\x12\x38\n\x0eGetServiceList\x12\x0e.context.Empty\x1a\x14.service.ServiceList\"\x00\x12\x37\n\rCreateService\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x37\n\rDeleteService\x12\x10.service.Service\x1a\x12.service.ServiceId\"\x00\x12\x38\n\x0eGetServiceById\x12\x12.service.ServiceId\x1a\x10.service.Service\"\x00\x12>\n\x11GetConnectionList\x12\x0e.context.Empty\x1a\x17.service.ConnectionList\"\x00\x62\x06proto3') , dependencies=[context__pb2.DESCRIPTOR,]) @@ -30,33 +31,28 @@ _SERVICETYPE = _descriptor.EnumDescriptor( full_name='service.ServiceType', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='UNKNOWN', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='L3NM', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='L2NM', index=2, number=2, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='TAPI_CONNECTIVITY_SERVICE', index=3, number=3, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, - serialized_start=805, - serialized_end=882, + serialized_start=844, + serialized_end=921, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPE) @@ -66,28 +62,24 @@ _SERVICESTATEENUM = _descriptor.EnumDescriptor( full_name='service.ServiceStateEnum', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='PLANNED', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='ACTIVE', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='PENDING_REMOVAL', index=2, number=2, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, - serialized_start=884, - serialized_end=948, + serialized_start=923, + serialized_end=987, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATEENUM) @@ -108,7 +100,6 @@ _SERVICELIST = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='cs', full_name='service.ServiceList.cs', index=0, @@ -116,7 +107,7 @@ _SERVICELIST = _descriptor.Descriptor( has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -140,7 +131,6 @@ _SERVICE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='cs_id', full_name='service.Service.cs_id', index=0, @@ -148,42 +138,42 @@ _SERVICE = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='serviceType', full_name='service.Service.serviceType', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='endpointList', full_name='service.Service.endpointList', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='constraint', full_name='service.Service.constraint', index=3, number=4, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='serviceState', full_name='service.Service.serviceState', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='serviceConfig', full_name='service.Service.serviceConfig', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -207,15 +197,14 @@ _SERVICECONFIG = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='serviceConfig', full_name='service.ServiceConfig.serviceConfig', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -239,15 +228,21 @@ _SERVICEID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='cs_id', full_name='service.ServiceId.cs_id', index=0, + name='contextId', full_name='service.ServiceId.contextId', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='cs_id', full_name='service.ServiceId.cs_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -261,7 +256,7 @@ _SERVICEID = _descriptor.Descriptor( oneofs=[ ], serialized_start=392, - serialized_end=433, + serialized_end=472, ) @@ -271,7 +266,6 @@ _SERVICEIDLIST = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='serviceIdList', full_name='service.ServiceIdList.serviceIdList', index=0, @@ -279,7 +273,7 @@ _SERVICEIDLIST = _descriptor.Descriptor( has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -292,8 +286,8 @@ _SERVICEIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=435, - serialized_end=493, + serialized_start=474, + serialized_end=532, ) @@ -303,7 +297,6 @@ _SERVICESTATE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='serviceState', full_name='service.ServiceState.serviceState', index=0, @@ -311,7 +304,7 @@ _SERVICESTATE = _descriptor.Descriptor( has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -324,8 +317,8 @@ _SERVICESTATE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=495, - serialized_end=558, + serialized_start=534, + serialized_end=597, ) @@ -335,7 +328,6 @@ _CONNECTIONLIST = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='connectionList', full_name='service.ConnectionList.connectionList', index=0, @@ -343,7 +335,7 @@ _CONNECTIONLIST = _descriptor.Descriptor( has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -356,8 +348,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=560, - serialized_end=621, + serialized_start=599, + serialized_end=660, ) @@ -367,7 +359,6 @@ _CONNECTION = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='con_id', full_name='service.Connection.con_id', index=0, @@ -375,21 +366,21 @@ _CONNECTION = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='relatedServiceId', full_name='service.Connection.relatedServiceId', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='path', full_name='service.Connection.path', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -402,8 +393,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=624, - serialized_end=756, + serialized_start=663, + serialized_end=795, ) @@ -413,7 +404,6 @@ _CONNECTIONID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='con_id', full_name='service.ConnectionId.con_id', index=0, @@ -421,7 +411,7 @@ _CONNECTIONID = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -434,8 +424,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=758, - serialized_end=803, + serialized_start=797, + serialized_end=842, ) _SERVICELIST.fields_by_name['cs'].message_type = _SERVICE @@ -445,6 +435,7 @@ _SERVICE.fields_by_name['endpointList'].message_type = context__pb2._ENDPOINTID _SERVICE.fields_by_name['constraint'].message_type = context__pb2._CONSTRAINT _SERVICE.fields_by_name['serviceState'].message_type = _SERVICESTATE _SERVICE.fields_by_name['serviceConfig'].message_type = _SERVICECONFIG +_SERVICEID.fields_by_name['contextId'].message_type = context__pb2._CONTEXTID _SERVICEID.fields_by_name['cs_id'].message_type = context__pb2._UUID _SERVICEIDLIST.fields_by_name['serviceIdList'].message_type = _SERVICEID _SERVICESTATE.fields_by_name['serviceState'].enum_type = _SERVICESTATEENUM @@ -537,9 +528,8 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=951, - serialized_end=1318, + serialized_start=990, + serialized_end=1357, methods=[ _descriptor.MethodDescriptor( name='GetServiceList', @@ -549,7 +539,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._EMPTY, output_type=_SERVICELIST, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='CreateService', @@ -559,7 +548,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( input_type=_SERVICE, output_type=_SERVICEID, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='UpdateService', @@ -569,7 +557,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( input_type=_SERVICE, output_type=_SERVICEID, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='DeleteService', @@ -579,7 +566,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( input_type=_SERVICE, output_type=_SERVICEID, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetServiceById', @@ -589,7 +575,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( input_type=_SERVICEID, output_type=_SERVICE, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetConnectionList', @@ -599,7 +584,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._EMPTY, output_type=_CONNECTIONLIST, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_SERVICESERVICE) diff --git a/proto/src/service_pb2_grpc.py b/proto/src/service_pb2_grpc.py index 051c64a190d7f51f37fd4b09f913210697fa6d85..473364431b3d8ac83b6b726e37683d34bda77a3a 100644 --- a/proto/src/service_pb2_grpc.py +++ b/proto/src/service_pb2_grpc.py @@ -1,5 +1,4 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 @@ -7,226 +6,127 @@ import service_pb2 as service__pb2 class ServiceServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.GetServiceList = channel.unary_unary( - '/service.ServiceService/GetServiceList', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=service__pb2.ServiceList.FromString, - ) - self.CreateService = channel.unary_unary( - '/service.ServiceService/CreateService', - request_serializer=service__pb2.Service.SerializeToString, - response_deserializer=service__pb2.ServiceId.FromString, - ) - self.UpdateService = channel.unary_unary( - '/service.ServiceService/UpdateService', - request_serializer=service__pb2.Service.SerializeToString, - response_deserializer=service__pb2.ServiceId.FromString, - ) - self.DeleteService = channel.unary_unary( - '/service.ServiceService/DeleteService', - request_serializer=service__pb2.Service.SerializeToString, - response_deserializer=service__pb2.ServiceId.FromString, - ) - self.GetServiceById = channel.unary_unary( - '/service.ServiceService/GetServiceById', - request_serializer=service__pb2.ServiceId.SerializeToString, - response_deserializer=service__pb2.Service.FromString, - ) - self.GetConnectionList = channel.unary_unary( - '/service.ServiceService/GetConnectionList', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=service__pb2.ConnectionList.FromString, - ) + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.GetServiceList = channel.unary_unary( + '/service.ServiceService/GetServiceList', + request_serializer=context__pb2.Empty.SerializeToString, + response_deserializer=service__pb2.ServiceList.FromString, + ) + self.CreateService = channel.unary_unary( + '/service.ServiceService/CreateService', + request_serializer=service__pb2.Service.SerializeToString, + response_deserializer=service__pb2.ServiceId.FromString, + ) + self.UpdateService = channel.unary_unary( + '/service.ServiceService/UpdateService', + request_serializer=service__pb2.Service.SerializeToString, + response_deserializer=service__pb2.ServiceId.FromString, + ) + self.DeleteService = channel.unary_unary( + '/service.ServiceService/DeleteService', + request_serializer=service__pb2.Service.SerializeToString, + response_deserializer=service__pb2.ServiceId.FromString, + ) + self.GetServiceById = channel.unary_unary( + '/service.ServiceService/GetServiceById', + request_serializer=service__pb2.ServiceId.SerializeToString, + response_deserializer=service__pb2.Service.FromString, + ) + self.GetConnectionList = channel.unary_unary( + '/service.ServiceService/GetConnectionList', + request_serializer=context__pb2.Empty.SerializeToString, + response_deserializer=service__pb2.ConnectionList.FromString, + ) class ServiceServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def GetServiceList(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetServiceById(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetConnectionList(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + # missing associated documentation comment in .proto file + pass + + def GetServiceList(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateService(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateService(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteService(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetServiceById(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetConnectionList(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_ServiceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'GetServiceList': grpc.unary_unary_rpc_method_handler( - servicer.GetServiceList, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=service__pb2.ServiceList.SerializeToString, - ), - 'CreateService': grpc.unary_unary_rpc_method_handler( - servicer.CreateService, - request_deserializer=service__pb2.Service.FromString, - response_serializer=service__pb2.ServiceId.SerializeToString, - ), - 'UpdateService': grpc.unary_unary_rpc_method_handler( - servicer.UpdateService, - request_deserializer=service__pb2.Service.FromString, - response_serializer=service__pb2.ServiceId.SerializeToString, - ), - 'DeleteService': grpc.unary_unary_rpc_method_handler( - servicer.DeleteService, - request_deserializer=service__pb2.Service.FromString, - response_serializer=service__pb2.ServiceId.SerializeToString, - ), - 'GetServiceById': grpc.unary_unary_rpc_method_handler( - servicer.GetServiceById, - request_deserializer=service__pb2.ServiceId.FromString, - response_serializer=service__pb2.Service.SerializeToString, - ), - 'GetConnectionList': grpc.unary_unary_rpc_method_handler( - servicer.GetConnectionList, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=service__pb2.ConnectionList.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'service.ServiceService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class ServiceService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def GetServiceList(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, '/service.ServiceService/GetServiceList', - context__pb2.Empty.SerializeToString, - service__pb2.ServiceList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def CreateService(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, '/service.ServiceService/CreateService', - service__pb2.Service.SerializeToString, - service__pb2.ServiceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def UpdateService(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, '/service.ServiceService/UpdateService', - service__pb2.Service.SerializeToString, - service__pb2.ServiceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DeleteService(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, '/service.ServiceService/DeleteService', - service__pb2.Service.SerializeToString, - service__pb2.ServiceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetServiceById(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, '/service.ServiceService/GetServiceById', - service__pb2.ServiceId.SerializeToString, - service__pb2.Service.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetConnectionList(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, '/service.ServiceService/GetConnectionList', - context__pb2.Empty.SerializeToString, - service__pb2.ConnectionList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'GetServiceList': grpc.unary_unary_rpc_method_handler( + servicer.GetServiceList, + request_deserializer=context__pb2.Empty.FromString, + response_serializer=service__pb2.ServiceList.SerializeToString, + ), + 'CreateService': grpc.unary_unary_rpc_method_handler( + servicer.CreateService, + request_deserializer=service__pb2.Service.FromString, + response_serializer=service__pb2.ServiceId.SerializeToString, + ), + 'UpdateService': grpc.unary_unary_rpc_method_handler( + servicer.UpdateService, + request_deserializer=service__pb2.Service.FromString, + response_serializer=service__pb2.ServiceId.SerializeToString, + ), + 'DeleteService': grpc.unary_unary_rpc_method_handler( + servicer.DeleteService, + request_deserializer=service__pb2.Service.FromString, + response_serializer=service__pb2.ServiceId.SerializeToString, + ), + 'GetServiceById': grpc.unary_unary_rpc_method_handler( + servicer.GetServiceById, + request_deserializer=service__pb2.ServiceId.FromString, + response_serializer=service__pb2.Service.SerializeToString, + ), + 'GetConnectionList': grpc.unary_unary_rpc_method_handler( + servicer.GetConnectionList, + request_deserializer=context__pb2.Empty.FromString, + response_serializer=service__pb2.ConnectionList.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'service.ServiceService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/src/slice_pb2.py b/proto/src/slice_pb2.py index 26daf947f817a192a16ecd091d9fc6bba739db26..8d93c77c9522ead02844633b453e20e54bf7915a 100644 --- a/proto/src/slice_pb2.py +++ b/proto/src/slice_pb2.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: slice.proto -"""Generated protocol buffer code.""" + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -13,6 +15,7 @@ _sym_db = _symbol_database.Default() import context_pb2 as context__pb2 +import service_pb2 as service__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -20,43 +23,37 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='slice', syntax='proto3', serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0bslice.proto\x12\x05slice\x1a\rcontext.proto\"3\n\rSliceEndpoint\x12\"\n\x07port_id\x18\x01 \x01(\x0b\x32\x11.context.EndPoint\"\xa9\x01\n\x0eTransportSlice\x12 \n\x08slice_id\x18\x01 \x01(\x0b\x32\x0e.slice.SliceId\x12\'\n\tendpoints\x18\x02 \x03(\x0b\x32\x14.slice.SliceEndpoint\x12(\n\x0b\x63onstraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12\"\n\x06status\x18\x04 \x01(\x0b\x32\x12.slice.SliceStatus\"*\n\x07SliceId\x12\x1f\n\x08slice_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"W\n\x0bSliceStatus\x12 \n\x08slice_id\x18\x01 \x01(\x0b\x32\x0e.slice.SliceId\x12&\n\x06status\x18\x02 \x01(\x0e\x32\x16.slice.SliceStatusEnum*@\n\x0fSliceStatusEnum\x12\x0b\n\x07PLANNED\x10\x00\x12\x08\n\x04INIT\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\n\n\x06\x44\x45INIT\x10\x03\x32\x88\x01\n\x0cSliceService\x12@\n\x11\x43reateUpdateSlice\x12\x15.slice.TransportSlice\x1a\x12.slice.SliceStatus\"\x00\x12\x36\n\x0b\x44\x65leteSlice\x12\x15.slice.TransportSlice\x1a\x0e.context.Empty\"\x00\x62\x06proto3' + serialized_pb=_b('\n\x0bslice.proto\x12\x05slice\x1a\rcontext.proto\x1a\rservice.proto\"3\n\rSliceEndpoint\x12\"\n\x07port_id\x18\x01 \x01(\x0b\x32\x11.context.EndPoint\"\xf4\x01\n\x0eTransportSlice\x12 \n\x08slice_id\x18\x01 \x01(\x0b\x32\x0e.slice.SliceId\x12\'\n\tendpoints\x18\x02 \x03(\x0b\x32\x14.slice.SliceEndpoint\x12(\n\x0b\x63onstraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12$\n\x08services\x18\x04 \x03(\x0b\x32\x12.service.ServiceId\x12#\n\x0bsubSlicesId\x18\x05 \x03(\x0b\x32\x0e.slice.SliceId\x12\"\n\x06status\x18\x06 \x01(\x0b\x32\x12.slice.SliceStatus\"Q\n\x07SliceId\x12%\n\tcontextId\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x1f\n\x08slice_id\x18\x02 \x01(\x0b\x32\r.context.Uuid\"W\n\x0bSliceStatus\x12 \n\x08slice_id\x18\x01 \x01(\x0b\x32\x0e.slice.SliceId\x12&\n\x06status\x18\x02 \x01(\x0e\x32\x16.slice.SliceStatusEnum*@\n\x0fSliceStatusEnum\x12\x0b\n\x07PLANNED\x10\x00\x12\x08\n\x04INIT\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\n\n\x06\x44\x45INIT\x10\x03\x32\x88\x01\n\x0cSliceService\x12@\n\x11\x43reateUpdateSlice\x12\x15.slice.TransportSlice\x1a\x12.slice.SliceStatus\"\x00\x12\x36\n\x0b\x44\x65leteSlice\x12\x15.slice.TransportSlice\x1a\x0e.context.Empty\"\x00\x62\x06proto3') , - dependencies=[context__pb2.DESCRIPTOR,]) + dependencies=[context__pb2.DESCRIPTOR,service__pb2.DESCRIPTOR,]) _SLICESTATUSENUM = _descriptor.EnumDescriptor( name='SliceStatusEnum', full_name='slice.SliceStatusEnum', filename=None, file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='PLANNED', index=0, number=0, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='INIT', index=1, number=1, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='ACTIVE', index=2, number=2, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), _descriptor.EnumValueDescriptor( name='DEINIT', index=3, number=3, serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), + type=None), ], containing_type=None, serialized_options=None, - serialized_start=395, - serialized_end=459, + serialized_start=524, + serialized_end=588, ) _sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) @@ -74,7 +71,6 @@ _SLICEENDPOINT = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='port_id', full_name='slice.SliceEndpoint.port_id', index=0, @@ -82,7 +78,7 @@ _SLICEENDPOINT = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -95,8 +91,8 @@ _SLICEENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=37, - serialized_end=88, + serialized_start=52, + serialized_end=103, ) @@ -106,7 +102,6 @@ _TRANSPORTSLICE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='slice_id', full_name='slice.TransportSlice.slice_id', index=0, @@ -114,28 +109,42 @@ _TRANSPORTSLICE = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='endpoints', full_name='slice.TransportSlice.endpoints', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='constraints', full_name='slice.TransportSlice.constraints', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( - name='status', full_name='slice.TransportSlice.status', index=3, - number=4, type=11, cpp_type=10, label=1, + name='services', full_name='slice.TransportSlice.services', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='subSlicesId', full_name='slice.TransportSlice.subSlicesId', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='status', full_name='slice.TransportSlice.status', index=5, + number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -148,8 +157,8 @@ _TRANSPORTSLICE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=91, - serialized_end=260, + serialized_start=106, + serialized_end=350, ) @@ -159,15 +168,21 @@ _SLICEID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='slice_id', full_name='slice.SliceId.slice_id', index=0, + name='contextId', full_name='slice.SliceId.contextId', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='slice_id', full_name='slice.SliceId.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -180,8 +195,8 @@ _SLICEID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=262, - serialized_end=304, + serialized_start=352, + serialized_end=433, ) @@ -191,7 +206,6 @@ _SLICESTATUS = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, - create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='slice_id', full_name='slice.SliceStatus.slice_id', index=0, @@ -199,14 +213,14 @@ _SLICESTATUS = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='status', full_name='slice.SliceStatus.status', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -219,15 +233,18 @@ _SLICESTATUS = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=306, - serialized_end=393, + serialized_start=435, + serialized_end=522, ) _SLICEENDPOINT.fields_by_name['port_id'].message_type = context__pb2._ENDPOINT _TRANSPORTSLICE.fields_by_name['slice_id'].message_type = _SLICEID _TRANSPORTSLICE.fields_by_name['endpoints'].message_type = _SLICEENDPOINT _TRANSPORTSLICE.fields_by_name['constraints'].message_type = context__pb2._CONSTRAINT +_TRANSPORTSLICE.fields_by_name['services'].message_type = service__pb2._SERVICEID +_TRANSPORTSLICE.fields_by_name['subSlicesId'].message_type = _SLICEID _TRANSPORTSLICE.fields_by_name['status'].message_type = _SLICESTATUS +_SLICEID.fields_by_name['contextId'].message_type = context__pb2._CONTEXTID _SLICEID.fields_by_name['slice_id'].message_type = context__pb2._UUID _SLICESTATUS.fields_by_name['slice_id'].message_type = _SLICEID _SLICESTATUS.fields_by_name['status'].enum_type = _SLICESTATUSENUM @@ -274,9 +291,8 @@ _SLICESERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=462, - serialized_end=598, + serialized_start=591, + serialized_end=727, methods=[ _descriptor.MethodDescriptor( name='CreateUpdateSlice', @@ -286,7 +302,6 @@ _SLICESERVICE = _descriptor.ServiceDescriptor( input_type=_TRANSPORTSLICE, output_type=_SLICESTATUS, serialized_options=None, - create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='DeleteSlice', @@ -296,7 +311,6 @@ _SLICESERVICE = _descriptor.ServiceDescriptor( input_type=_TRANSPORTSLICE, output_type=context__pb2._EMPTY, serialized_options=None, - create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_SLICESERVICE) diff --git a/proto/src/slice_pb2_grpc.py b/proto/src/slice_pb2_grpc.py index f09c823cdbb43da54d9d2e3a8d0c9c25ee5f509e..e191ecaf25e89279aca1a59774e6344de91a2c2c 100644 --- a/proto/src/slice_pb2_grpc.py +++ b/proto/src/slice_pb2_grpc.py @@ -1,5 +1,4 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 @@ -7,94 +6,59 @@ import slice_pb2 as slice__pb2 class SliceServiceStub(object): - """Missing associated documentation comment in .proto file.""" + # missing associated documentation comment in .proto file + pass - def __init__(self, channel): - """Constructor. + def __init__(self, channel): + """Constructor. - Args: - channel: A grpc.Channel. - """ - self.CreateUpdateSlice = channel.unary_unary( - '/slice.SliceService/CreateUpdateSlice', - request_serializer=slice__pb2.TransportSlice.SerializeToString, - response_deserializer=slice__pb2.SliceStatus.FromString, - ) - self.DeleteSlice = channel.unary_unary( - '/slice.SliceService/DeleteSlice', - request_serializer=slice__pb2.TransportSlice.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) + Args: + channel: A grpc.Channel. + """ + self.CreateUpdateSlice = channel.unary_unary( + '/slice.SliceService/CreateUpdateSlice', + request_serializer=slice__pb2.TransportSlice.SerializeToString, + response_deserializer=slice__pb2.SliceStatus.FromString, + ) + self.DeleteSlice = channel.unary_unary( + '/slice.SliceService/DeleteSlice', + request_serializer=slice__pb2.TransportSlice.SerializeToString, + response_deserializer=context__pb2.Empty.FromString, + ) class SliceServiceServicer(object): - """Missing associated documentation comment in .proto file.""" + # missing associated documentation comment in .proto file + pass - def CreateUpdateSlice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + def CreateUpdateSlice(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') - def DeleteSlice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + def DeleteSlice(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_SliceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'CreateUpdateSlice': grpc.unary_unary_rpc_method_handler( - servicer.CreateUpdateSlice, - request_deserializer=slice__pb2.TransportSlice.FromString, - response_serializer=slice__pb2.SliceStatus.SerializeToString, - ), - 'DeleteSlice': grpc.unary_unary_rpc_method_handler( - servicer.DeleteSlice, - request_deserializer=slice__pb2.TransportSlice.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'slice.SliceService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class SliceService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def CreateUpdateSlice(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, '/slice.SliceService/CreateUpdateSlice', - slice__pb2.TransportSlice.SerializeToString, - slice__pb2.SliceStatus.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DeleteSlice(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, '/slice.SliceService/DeleteSlice', - slice__pb2.TransportSlice.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + rpc_method_handlers = { + 'CreateUpdateSlice': grpc.unary_unary_rpc_method_handler( + servicer.CreateUpdateSlice, + request_deserializer=slice__pb2.TransportSlice.FromString, + response_serializer=slice__pb2.SliceStatus.SerializeToString, + ), + 'DeleteSlice': grpc.unary_unary_rpc_method_handler( + servicer.DeleteSlice, + request_deserializer=slice__pb2.TransportSlice.FromString, + response_serializer=context__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'slice.SliceService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/proto/uml/context.png b/proto/uml/context.png index db19b0f591ba4cb329c4211584765816b661d577..c71d2e63e77f68084b1ac112c7c8bbc7842dc92c 100644 Binary files a/proto/uml/context.png and b/proto/uml/context.png differ diff --git a/proto/uml/service.png b/proto/uml/service.png index 0459ff3e2e6ad04f90721bf46dc33f8b2ea7854d..b2b12f0bbc12415f53912ce4658311eb805672c8 100644 Binary files a/proto/uml/service.png and b/proto/uml/service.png differ diff --git a/proto/uml/slice.png b/proto/uml/slice.png index fdb2213049f6dfc8bbe07f781d35ce0447df51df..7a9335c46a2807528928b1d3df22a2b5ea5ac951 100644 Binary files a/proto/uml/slice.png and b/proto/uml/slice.png differ