diff --git a/proto/automation.proto b/proto/automation.proto index dffcda7016c9ef9e1c2266f0c309185cf25b233a..9df2d0e29fba6c9b56ec2b4e7794c579e1c8b464 100644 --- a/proto/automation.proto +++ b/proto/automation.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package automation; -//import "google/protobuf/empty.proto"; import "context.proto"; service AutomationService { diff --git a/proto/centralized_cybersecurity.proto b/proto/centralized_cybersecurity.proto index 8e4997798b44f7e796bdce738a0a92450ae1933c..53042be54641bfb203661a77183a95518a28fa8b 100644 --- a/proto/centralized_cybersecurity.proto +++ b/proto/centralized_cybersecurity.proto @@ -2,22 +2,22 @@ syntax = "proto3"; package centralized_cybersecurity; -import "google/protobuf/empty.proto"; +import "context.proto"; import "service.proto"; import "monitoring.proto"; service CentralizedCyberSecurityService { - rpc NotifyServiceUpdate (service.Service) returns (google.protobuf.Empty) {} + rpc NotifyServiceUpdate (service.Service) returns (context.Empty) {} // rpc that triggers the attack detection loop - rpc DetectAttack (google.protobuf.Empty) returns (google.protobuf.Empty) {} + rpc DetectAttack (context.Empty) returns (context.Empty) {} // rpc called by the distributed component to report KPIs - rpc ReportSummarizedKpi (monitoring.KpiList) returns (google.protobuf.Empty) {} + rpc ReportSummarizedKpi (monitoring.KpiList) returns (context.Empty) {} - rpc ReportKpi (monitoring.KpiList) returns (google.protobuf.Empty) {} + rpc ReportKpi (monitoring.KpiList) returns (context.Empty) {} } diff --git a/proto/compute.proto b/proto/compute.proto index 1756a8de946d1e2a5eb4af4169d3052215eea5d3..c3c1340ec6d7f2fb90afdb91768504fa4d3cca61 100644 --- a/proto/compute.proto +++ b/proto/compute.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package compute; -import "google/protobuf/empty.proto"; import "context.proto"; import "service.proto"; @@ -11,9 +10,9 @@ service ComputeService { rpc get_connectivity_service_status ( service.ServiceId ) returns (service.ServiceState) {} rpc create_connectivity_service ( service.Service ) returns (service.ServiceId) {} rpc edit_connectivity_service ( service.Service ) returns (service.ServiceId) {} - rpc delete_connectivity_service ( service.Service ) returns ( google.protobuf.Empty ) {} - rpc get_all_active_connectivity_services ( google.protobuf.Empty ) returns ( service.ServiceIdList ) {} - rpc clear_all_connectivity_services ( google.protobuf.Empty ) returns (google.protobuf.Empty ) {} + rpc delete_connectivity_service ( service.Service ) returns ( context.Empty ) {} + rpc get_all_active_connectivity_services ( context.Empty ) returns ( service.ServiceIdList ) {} + rpc clear_all_connectivity_services ( context.Empty ) returns ( context.Empty ) {} } diff --git a/proto/context.proto b/proto/context.proto index e62cc532dee7cf6a6d32b7eedc78019309c74242..82487b0376c1c827e6dbcf96772bd001b872b671 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -2,13 +2,15 @@ syntax = "proto3"; package context; -import "google/protobuf/empty.proto"; service ContextService { - rpc GetTopology (google.protobuf.Empty) returns (Topology) {} + rpc GetTopology (Empty) returns (Topology) {} } +message Empty { + +} message Context { Topology topo = 1; diff --git a/proto/device.proto b/proto/device.proto index 6970a439e74acae335d36513491837a349ccd770..a277e8fdee63b24e8d4ab155b0d0701662e9dff4 100644 --- a/proto/device.proto +++ b/proto/device.proto @@ -2,13 +2,12 @@ syntax = "proto3"; package device; -import "google/protobuf/empty.proto"; import "context.proto"; service DeviceService { rpc AddDevice(context.Device) returns (context.DeviceId) {} rpc ConfigureDevice(context.DeviceConfig) returns (context.DeviceId) {} - rpc DeleteDevice(context.DeviceId) returns (google.protobuf.Empty) {} + rpc DeleteDevice(context.DeviceId) returns (context.Empty) {} } diff --git a/proto/distributed_cybersecurity.proto b/proto/distributed_cybersecurity.proto index 40b105e67f587078bde3b0442fa373fc0849bd67..69d480a69573510efd32b6fcfb746e9d56bd615e 100644 --- a/proto/distributed_cybersecurity.proto +++ b/proto/distributed_cybersecurity.proto @@ -2,15 +2,15 @@ syntax = "proto3"; package distributed_cybersecurity; -import "google/protobuf/empty.proto"; +import "context.proto"; import "monitoring.proto"; service DistributedCyberSecurityService { // rpc that triggers the attack detection loop - rpc DetectAttack (google.protobuf.Empty) returns (google.protobuf.Empty) {} + rpc DetectAttack (context.Empty) returns (context.Empty) {} // receiving KPIs from monitored devices (packed processors) - rpc ReportKpi(monitoring.KpiList) returns (google.protobuf.Empty) {} + rpc ReportKpi(monitoring.KpiList) returns (context.Empty) {} } diff --git a/proto/dlt.proto b/proto/dlt.proto index 0e56b43b35bc9be9871515b21f85554fae6153f9..f6dacfbb83eca04714b6795d4875f9fab5d08e0b 100644 --- a/proto/dlt.proto +++ b/proto/dlt.proto @@ -2,14 +2,13 @@ syntax = "proto3"; package dlt; -import "google/protobuf/empty.proto"; import "context.proto"; service DltService { rpc RecordToDlt ( DltRecord ) returns ( RecordStatus ) {} rpc GetFromDlt ( DltRecordId ) returns ( DltRecord ) {} rpc SubscribeToDlt ( DltRecordSubscription ) returns ( stream DltRecord ) {} - rpc GetDltStatus ( google.protobuf.Empty ) returns ( DltStatus ) {} + rpc GetDltStatus ( context.Empty ) returns ( DltStatus ) {} } message DltRecordSubscription { diff --git a/proto/interdomain.proto b/proto/interdomain.proto index 35e4ea9f71105fe1834b8acdcbcbccfaf377cff7..7e7f6c10e93ab1ea5563b13d1cad27fb0a2ee90a 100644 --- a/proto/interdomain.proto +++ b/proto/interdomain.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package interdomain; -//import "google/protobuf/empty.proto"; import "context.proto"; import "slice.proto"; diff --git a/proto/monitoring.proto b/proto/monitoring.proto index 57fbcd009247c29c38555f4b1a7dfd9e4fe91f95..18f91b79703566bbbd2effb9c0de4cff21515544 100644 --- a/proto/monitoring.proto +++ b/proto/monitoring.proto @@ -2,12 +2,11 @@ syntax = "proto3"; package monitoring; -import "google/protobuf/empty.proto"; import "context.proto"; service MonitoringService { - rpc IncludeKpi (Kpi) returns (google.protobuf.Empty) {} - rpc MonitorKpi ( KpiDevice ) returns (google.protobuf.Empty) {} + rpc IncludeKpi (Kpi) returns (context.Empty) {} + rpc MonitorKpi ( KpiDevice ) returns (context.Empty) {} rpc GetStream_kpi ( KpiId ) returns (stream Kpi) {} rpc GetInstantKpi ( KpiId ) returns ( Kpi) {} } diff --git a/proto/policy.proto b/proto/policy.proto index 6af885d78448855d397c7fd8694ec38bbf99cb93..4b1b50985abd32cb02b56e66f15f31be5a4c04db 100644 --- a/proto/policy.proto +++ b/proto/policy.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package policy; -//import "google/protobuf/empty.proto"; import "context.proto"; import "service.proto"; diff --git a/proto/service.proto b/proto/service.proto index 77cdba7a8a2116e762a423f038dbb2ca768b11bd..37e39393c587314fc804b1d1e0166b80dd7de05b 100644 --- a/proto/service.proto +++ b/proto/service.proto @@ -2,16 +2,15 @@ syntax = "proto3"; package service; -import "google/protobuf/empty.proto"; import "context.proto"; service ServiceService { - rpc GetServiceList (google.protobuf.Empty) returns (ServiceList) {} + rpc GetServiceList (context.Empty) returns (ServiceList) {} rpc CreateService (Service) returns (ServiceId) {} rpc UpdateService (Service) returns (ServiceId) {} rpc DeleteService (Service) returns (ServiceId) {} rpc GetServiceById (ServiceId) returns (Service) {} - rpc GetConnectionList (google.protobuf.Empty) returns (ConnectionList) {} + rpc GetConnectionList (context.Empty) returns (ConnectionList) {} } diff --git a/proto/slice.proto b/proto/slice.proto index b02400930973ba6881942c351275802f32488dd7..d5e7b67244e0a7accfcf578f63608a04b5e8c894 100644 --- a/proto/slice.proto +++ b/proto/slice.proto @@ -2,12 +2,11 @@ syntax = "proto3"; package slice; -import "google/protobuf/empty.proto"; import "context.proto"; service SliceService { rpc CreateUpdateSlice ( TransportSlice ) returns (SliceStatus) {} - rpc DeleteSlice ( TransportSlice ) returns (google.protobuf.Empty) {} + rpc DeleteSlice ( TransportSlice ) returns (context.Empty) {} } diff --git a/proto/src/attack_mitigator_pb2.py b/proto/src/attack_mitigator_pb2.py index ce1e2d4910eeededdd110d90d80936d0b2cf0533..c011a5beb0fb69aead59c907450f3492b2d513f8 100644 --- a/proto/src/attack_mitigator_pb2.py +++ b/proto/src/attack_mitigator_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: attack_mitigator.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -21,7 +19,8 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='attack_mitigator', syntax='proto3', serialized_options=None, - 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') + 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' , dependencies=[context__pb2.DESCRIPTOR,]) @@ -34,6 +33,7 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -86,6 +86,7 @@ _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, @@ -93,35 +94,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -166,6 +167,7 @@ _ATTACKMITIGATOR = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, + create_key=_descriptor._internal_create_key, serialized_start=342, serialized_end=448, methods=[ @@ -177,6 +179,7 @@ _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 71518e3952ea5aad2cd5d9885a57b895faab9056..e045402c78edb162007e5b7bc45cc9660ee058cc 100644 --- a/proto/src/attack_mitigator_pb2_grpc.py +++ b/proto/src/attack_mitigator_pb2_grpc.py @@ -1,46 +1,66 @@ # 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 - pass + """Missing associated documentation comment in .proto file.""" - 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 - pass + """Missing associated documentation comment in .proto file.""" - 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 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 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,)) + 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) diff --git a/proto/src/automation_pb2.py b/proto/src/automation_pb2.py index 5fd11474d4cfdcb5a19ba05fd82bf5bce4f81e96..ab3119681ca136fee0a7a72739d067dcf77eaf74 100644 --- a/proto/src/automation_pb2.py +++ b/proto/src/automation_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: automation.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -22,7 +20,8 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='automation', syntax='proto3', serialized_options=None, - 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') + 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' , dependencies=[context__pb2.DESCRIPTOR,]) @@ -31,23 +30,28 @@ _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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DEV_OPS', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DEV_CONF', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PIPELINE_CONF', index=3, number=3, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, @@ -62,27 +66,33 @@ _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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='POTENCIAL_AVAILABLE', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='POTENCIAL_BUSY', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='INSTALLED', index=3, number=3, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PENDING_REMOVAL', index=4, number=4, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, @@ -110,6 +120,7 @@ _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, @@ -117,14 +128,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -148,6 +159,7 @@ _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, @@ -155,14 +167,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -186,6 +198,7 @@ _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, @@ -193,7 +206,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -217,6 +230,7 @@ _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, @@ -224,14 +238,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -299,6 +313,7 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, + create_key=_descriptor._internal_create_key, serialized_start=599, serialized_end=1047, methods=[ @@ -310,6 +325,7 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( input_type=_DEVICEROLEID, output_type=_DEVICEROLE, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ZtpGetDeviceRolesByDeviceId', @@ -319,6 +335,7 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._DEVICEID, output_type=_DEVICEROLELIST, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ZtpAdd', @@ -328,6 +345,7 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( input_type=_DEVICEROLE, output_type=_DEVICEROLESTATE, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ZtpUpdate', @@ -337,6 +355,7 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( input_type=_DEVICEROLE, output_type=_DEVICEROLESTATE, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ZtpDelete', @@ -346,6 +365,7 @@ _AUTOMATIONSERVICE = _descriptor.ServiceDescriptor( input_type=_DEVICEROLE, output_type=_DEVICEROLESTATE, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ZtpDeleteAllByDeviceId', @@ -355,6 +375,7 @@ _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 8ceb7956b3e7778db9d1c6e88c054238f57d7a61..2b5d3f23114f52f7ed700e01928e9162ff8b80e2 100644 --- a/proto/src/automation_pb2_grpc.py +++ b/proto/src/automation_pb2_grpc.py @@ -1,4 +1,5 @@ # 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 @@ -6,127 +7,226 @@ import context_pb2 as context__pb2 class AutomationServiceStub(object): - # 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, - ) + """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, + ) class AutomationServiceServicer(object): - # 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!') + """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!') 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,)) + 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) diff --git a/proto/src/centralized_cybersecurity_pb2.py b/proto/src/centralized_cybersecurity_pb2.py index 2d6cf7b8daaf322f1346d01258faf04732b27905..996f3e35fe88374d81c3801d8b5d6e908301f62c 100644 --- a/proto/src/centralized_cybersecurity_pb2.py +++ b/proto/src/centralized_cybersecurity_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: centralized_cybersecurity.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -13,7 +11,7 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +import context_pb2 as context__pb2 import service_pb2 as service__pb2 import monitoring_pb2 as monitoring__pb2 @@ -23,9 +21,10 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='centralized_cybersecurity', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\x1f\x63\x65ntralized_cybersecurity.proto\x12\x19\x63\x65ntralized_cybersecurity\x1a\x1bgoogle/protobuf/empty.proto\x1a\rservice.proto\x1a\x10monitoring.proto2\xa8\x02\n\x1f\x43\x65ntralizedCyberSecurityService\x12\x41\n\x13NotifyServiceUpdate\x12\x10.service.Service\x1a\x16.google.protobuf.Empty\"\x00\x12@\n\x0c\x44\x65tectAttack\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x44\n\x13ReportSummarizedKpi\x12\x13.monitoring.KpiList\x1a\x16.google.protobuf.Empty\"\x00\x12:\n\tReportKpi\x12\x13.monitoring.KpiList\x1a\x16.google.protobuf.Empty\"\x00\x62\x06proto3') + 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' , - dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,service__pb2.DESCRIPTOR,monitoring__pb2.DESCRIPTOR,]) + dependencies=[context__pb2.DESCRIPTOR,service__pb2.DESCRIPTOR,monitoring__pb2.DESCRIPTOR,]) @@ -39,8 +38,9 @@ _CENTRALIZEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - serialized_start=125, - serialized_end=421, + create_key=_descriptor._internal_create_key, + serialized_start=111, + serialized_end=367, methods=[ _descriptor.MethodDescriptor( name='NotifyServiceUpdate', @@ -48,17 +48,19 @@ _CENTRALIZEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( index=0, containing_service=None, input_type=service__pb2._SERVICE, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + output_type=context__pb2._EMPTY, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='DetectAttack', full_name='centralized_cybersecurity.CentralizedCyberSecurityService.DetectAttack', index=1, containing_service=None, - input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + input_type=context__pb2._EMPTY, + output_type=context__pb2._EMPTY, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ReportSummarizedKpi', @@ -66,8 +68,9 @@ _CENTRALIZEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( index=2, containing_service=None, input_type=monitoring__pb2._KPILIST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + output_type=context__pb2._EMPTY, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ReportKpi', @@ -75,8 +78,9 @@ _CENTRALIZEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( index=3, containing_service=None, input_type=monitoring__pb2._KPILIST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + 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 9485907b498ff742a8f8f0b365a397885126aa2f..ddd7ccd8805e3f7b425a69d428a465c660199406 100644 --- a/proto/src/centralized_cybersecurity_pb2_grpc.py +++ b/proto/src/centralized_cybersecurity_pb2_grpc.py @@ -1,99 +1,169 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +import context_pb2 as context__pb2 import monitoring_pb2 as monitoring__pb2 import service_pb2 as service__pb2 class CentralizedCyberSecurityServiceStub(object): - # 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=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.DetectAttack = channel.unary_unary( - '/centralized_cybersecurity.CentralizedCyberSecurityService/DetectAttack', - request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ReportSummarizedKpi = channel.unary_unary( - '/centralized_cybersecurity.CentralizedCyberSecurityService/ReportSummarizedKpi', - request_serializer=monitoring__pb2.KpiList.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ReportKpi = channel.unary_unary( - '/centralized_cybersecurity.CentralizedCyberSecurityService/ReportKpi', - request_serializer=monitoring__pb2.KpiList.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + """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, + ) class CentralizedCyberSecurityServiceServicer(object): - # 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!') + """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!') 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=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'DetectAttack': grpc.unary_unary_rpc_method_handler( - servicer.DetectAttack, - request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'ReportSummarizedKpi': grpc.unary_unary_rpc_method_handler( - servicer.ReportSummarizedKpi, - request_deserializer=monitoring__pb2.KpiList.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'ReportKpi': grpc.unary_unary_rpc_method_handler( - servicer.ReportKpi, - request_deserializer=monitoring__pb2.KpiList.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'centralized_cybersecurity.CentralizedCyberSecurityService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) + 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) diff --git a/proto/src/compute_pb2.py b/proto/src/compute_pb2.py index cc2e7136f8bb9fbb726540b93539898d706751fc..80c7fedf5f29ed1ee7c84bee13c622c9ed5ca03d 100644 --- a/proto/src/compute_pb2.py +++ b/proto/src/compute_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: compute.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -13,7 +11,6 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 import context_pb2 as context__pb2 import service_pb2 as service__pb2 @@ -23,9 +20,10 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='compute', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\rcompute.proto\x12\x07\x63ompute\x1a\x1bgoogle/protobuf/empty.proto\x1a\rcontext.proto\x1a\rservice.proto2\xb9\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\x12I\n\x1b\x64\x65lete_connectivity_service\x12\x10.service.Service\x1a\x16.google.protobuf.Empty\"\x00\x12X\n$get_all_active_connectivity_services\x12\x16.google.protobuf.Empty\x1a\x16.service.ServiceIdList\"\x00\x12S\n\x1f\x63lear_all_connectivity_services\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x62\x06proto3') + 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' , - dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,context__pb2.DESCRIPTOR,service__pb2.DESCRIPTOR,]) + dependencies=[context__pb2.DESCRIPTOR,service__pb2.DESCRIPTOR,]) @@ -39,8 +37,9 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - serialized_start=86, - serialized_end=655, + create_key=_descriptor._internal_create_key, + serialized_start=57, + serialized_end=594, methods=[ _descriptor.MethodDescriptor( name='check_credentials', @@ -50,6 +49,7 @@ _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,6 +59,7 @@ _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', @@ -68,6 +69,7 @@ _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', @@ -77,6 +79,7 @@ _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', @@ -84,26 +87,29 @@ _COMPUTESERVICE = _descriptor.ServiceDescriptor( index=4, containing_service=None, input_type=service__pb2._SERVICE, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + output_type=context__pb2._EMPTY, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='get_all_active_connectivity_services', full_name='compute.ComputeService.get_all_active_connectivity_services', index=5, containing_service=None, - input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + 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', full_name='compute.ComputeService.clear_all_connectivity_services', index=6, containing_service=None, - input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + 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 63b1cd48f2dd39822ca2ed0e459146144171cedc..4bea209b39296afe74708b43f1c61edd78ba5696 100644 --- a/proto/src/compute_pb2_grpc.py +++ b/proto/src/compute_pb2_grpc.py @@ -1,150 +1,265 @@ # 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 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 import service_pb2 as service__pb2 class ComputeServiceStub(object): - # 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=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.get_all_active_connectivity_services = channel.unary_unary( - '/compute.ComputeService/get_all_active_connectivity_services', - request_serializer=google_dot_protobuf_dot_empty__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=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + """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, + ) class ComputeServiceServicer(object): - # 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!') + """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!') 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=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'get_all_active_connectivity_services': grpc.unary_unary_rpc_method_handler( - servicer.get_all_active_connectivity_services, - request_deserializer=google_dot_protobuf_dot_empty__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=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'compute.ComputeService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) + 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) diff --git a/proto/src/context_pb2.py b/proto/src/context_pb2.py index 3c000313a8708a257cf850102ede48c74b41ddeb..6aa7798fb3bb89f6b4b09a98d8b653b9fff526c4 100644 --- a/proto/src/context_pb2.py +++ b/proto/src/context_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: context.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -14,7 +12,6 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -22,29 +19,32 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='context', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\rcontext.proto\x12\x07\x63ontext\x1a\x1bgoogle/protobuf/empty.proto\"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\x32L\n\x0e\x43ontextService\x12:\n\x0bGetTopology\x12\x16.google.protobuf.Empty\x1a\x11.context.Topology\"\x00\x62\x06proto3') - , - dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,]) + 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' +) _DEVICEOPERATIONALSTATUS = _descriptor.EnumDescriptor( name='DeviceOperationalStatus', 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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ENABLED', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, - serialized_start=959, - serialized_end=1011, + serialized_start=939, + serialized_end=991, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUS) @@ -54,12 +54,38 @@ ENABLED = 1 +_EMPTY = _descriptor.Descriptor( + name='Empty', + full_name='context.Empty', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=26, + serialized_end=33, +) + + _CONTEXT = _descriptor.Descriptor( name='Context', full_name='context.Context', 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, @@ -67,14 +93,14 @@ _CONTEXT = _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ctl', full_name='context.Context.ctl', 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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -87,8 +113,8 @@ _CONTEXT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=55, - serialized_end=139, + serialized_start=35, + serialized_end=119, ) @@ -98,6 +124,7 @@ _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, @@ -105,14 +132,14 @@ _TOPOLOGY = _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='link', full_name='context.Topology.link', 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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -125,8 +152,8 @@ _TOPOLOGY = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=141, - serialized_end=213, + serialized_start=121, + serialized_end=193, ) @@ -136,6 +163,7 @@ _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, @@ -143,7 +171,7 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -156,8 +184,8 @@ _LINK = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=215, - serialized_end=264, + serialized_start=195, + serialized_end=244, ) @@ -167,21 +195,22 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -194,8 +223,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=266, - serialized_end=329, + serialized_start=246, + serialized_end=309, ) @@ -205,6 +234,7 @@ _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, @@ -212,35 +242,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -253,8 +283,8 @@ _DEVICE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=332, - serialized_end=550, + serialized_start=312, + serialized_end=530, ) @@ -264,14 +294,15 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -284,8 +315,8 @@ _DEVICECONFIG = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=552, - serialized_end=589, + serialized_start=532, + serialized_end=569, ) @@ -295,6 +326,7 @@ _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, @@ -302,14 +334,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -322,8 +354,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=591, - serialized_end=658, + serialized_start=571, + serialized_end=638, ) @@ -333,6 +365,7 @@ _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, @@ -340,14 +373,14 @@ _ENDPOINTID = _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -360,8 +393,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=660, - serialized_end=739, + serialized_start=640, + serialized_end=719, ) @@ -371,6 +404,7 @@ _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, @@ -378,7 +412,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -391,8 +425,8 @@ _DEVICEID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=741, - serialized_end=785, + serialized_start=721, + serialized_end=765, ) @@ -402,14 +436,15 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -422,8 +457,8 @@ _UUID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=787, - serialized_end=807, + serialized_start=767, + serialized_end=787, ) @@ -433,6 +468,7 @@ _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, @@ -440,14 +476,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -460,8 +496,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=809, - serialized_end=879, + serialized_start=789, + serialized_end=859, ) @@ -471,6 +507,7 @@ _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, @@ -478,14 +515,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -498,8 +535,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=881, - serialized_end=957, + serialized_start=861, + serialized_end=937, ) _CONTEXT.fields_by_name['topo'].message_type = _TOPOLOGY @@ -517,6 +554,7 @@ _ENDPOINTID.fields_by_name['dev_id'].message_type = _DEVICEID _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 +DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY DESCRIPTOR.message_types_by_name['Link'] = _LINK @@ -532,6 +570,13 @@ DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT DESCRIPTOR.enum_types_by_name['DeviceOperationalStatus'] = _DEVICEOPERATIONALSTATUS _sym_db.RegisterFileDescriptor(DESCRIPTOR) +Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { + 'DESCRIPTOR' : _EMPTY, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Empty) + }) +_sym_db.RegisterMessage(Empty) + Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { 'DESCRIPTOR' : _CONTEXT, '__module__' : 'context_pb2' @@ -624,17 +669,19 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - serialized_start=1013, - serialized_end=1089, + create_key=_descriptor._internal_create_key, + serialized_start=993, + serialized_end=1061, methods=[ _descriptor.MethodDescriptor( name='GetTopology', full_name='context.ContextService.GetTopology', index=0, containing_service=None, - input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + 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 3b7c02da5fbca4ce39db81f680af540282106894..93e66fd20396c644a53daf27ae944cd2bfdbd039 100644 --- a/proto/src/context_pb2_grpc.py +++ b/proto/src/context_pb2_grpc.py @@ -1,47 +1,66 @@ # 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 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 class ContextServiceStub(object): - # missing associated documentation comment in .proto file - pass + """Missing associated documentation comment in .proto file.""" - 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=google_dot_protobuf_dot_empty__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 - pass + """Missing associated documentation comment in .proto file.""" - 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 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 add_ContextServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'GetTopology': grpc.unary_unary_rpc_method_handler( - servicer.GetTopology, - request_deserializer=google_dot_protobuf_dot_empty__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,)) + 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) diff --git a/proto/src/device_pb2.py b/proto/src/device_pb2.py index 2e548ed8c6a5f3b1a474fa60e33f85ac988f757a..e72c4b58f00e5fc715a9a21b018cc7ba2c236c95 100644 --- a/proto/src/device_pb2.py +++ b/proto/src/device_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: device.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -13,7 +11,6 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 import context_pb2 as context__pb2 @@ -22,9 +19,10 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='device', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\x0c\x64\x65vice.proto\x12\x06\x64\x65vice\x1a\x1bgoogle/protobuf/empty.proto\x1a\rcontext.proto2\xbe\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;\n\x0c\x44\x65leteDevice\x12\x11.context.DeviceId\x1a\x16.google.protobuf.Empty\"\x00\x62\x06proto3') + 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' , - dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,context__pb2.DESCRIPTOR,]) + dependencies=[context__pb2.DESCRIPTOR,]) @@ -38,8 +36,9 @@ _DEVICESERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - serialized_start=69, - serialized_end=259, + create_key=_descriptor._internal_create_key, + serialized_start=40, + serialized_end=222, methods=[ _descriptor.MethodDescriptor( name='AddDevice', @@ -49,6 +48,7 @@ _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,6 +58,7 @@ _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', @@ -65,8 +66,9 @@ _DEVICESERVICE = _descriptor.ServiceDescriptor( index=2, containing_service=None, input_type=context__pb2._DEVICEID, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + 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 2ecde1c5d16c1c6746005efb3e95b4c2b2e62d03..aed8b2e9954e682b69d96c3b9f08c0168586555c 100644 --- a/proto/src/device_pb2_grpc.py +++ b/proto/src/device_pb2_grpc.py @@ -1,81 +1,132 @@ # 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 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 class DeviceServiceStub(object): - # 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=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) + """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, + ) class DeviceServiceServicer(object): - # 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!') + """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!') 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=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'device.DeviceService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) + 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) diff --git a/proto/src/distributed_cybersecurity_pb2.py b/proto/src/distributed_cybersecurity_pb2.py index e29397c34d7d12bfe2e1a15082944d3671997a79..d31f5bb5fd2efd9ae136dfd6daf190cc2598ce44 100644 --- a/proto/src/distributed_cybersecurity_pb2.py +++ b/proto/src/distributed_cybersecurity_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: distributed_cybersecurity.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -13,7 +11,7 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +import context_pb2 as context__pb2 import monitoring_pb2 as monitoring__pb2 @@ -22,9 +20,10 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='distributed_cybersecurity', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\x1f\x64istributed_cybersecurity.proto\x12\x19\x64istributed_cybersecurity\x1a\x1bgoogle/protobuf/empty.proto\x1a\x10monitoring.proto2\x9f\x01\n\x1f\x44istributedCyberSecurityService\x12@\n\x0c\x44\x65tectAttack\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12:\n\tReportKpi\x12\x13.monitoring.KpiList\x1a\x16.google.protobuf.Empty\"\x00\x62\x06proto3') + 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' , - dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,monitoring__pb2.DESCRIPTOR,]) + dependencies=[context__pb2.DESCRIPTOR,monitoring__pb2.DESCRIPTOR,]) @@ -38,17 +37,19 @@ _DISTRIBUTEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - serialized_start=110, - serialized_end=269, + create_key=_descriptor._internal_create_key, + serialized_start=96, + serialized_end=231, methods=[ _descriptor.MethodDescriptor( name='DetectAttack', full_name='distributed_cybersecurity.DistributedCyberSecurityService.DetectAttack', index=0, containing_service=None, - input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + input_type=context__pb2._EMPTY, + output_type=context__pb2._EMPTY, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ReportKpi', @@ -56,8 +57,9 @@ _DISTRIBUTEDCYBERSECURITYSERVICE = _descriptor.ServiceDescriptor( index=1, containing_service=None, input_type=monitoring__pb2._KPILIST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + 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 ceab3fc0534f970eb292c16e5062a67716ddc8a5..d5e004a0cac25bebdf19365663fb9ec118b8bbc7 100644 --- a/proto/src/distributed_cybersecurity_pb2_grpc.py +++ b/proto/src/distributed_cybersecurity_pb2_grpc.py @@ -1,64 +1,102 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +import context_pb2 as context__pb2 import monitoring_pb2 as monitoring__pb2 class DistributedCyberSecurityServiceStub(object): - # missing associated documentation comment in .proto file - pass + """Missing associated documentation comment in .proto file.""" - 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=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ReportKpi = channel.unary_unary( - '/distributed_cybersecurity.DistributedCyberSecurityService/ReportKpi', - request_serializer=monitoring__pb2.KpiList.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__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 - pass + """Missing associated documentation comment in .proto file.""" - 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=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'ReportKpi': grpc.unary_unary_rpc_method_handler( - servicer.ReportKpi, - request_deserializer=monitoring__pb2.KpiList.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'distributed_cybersecurity.DistributedCyberSecurityService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) + 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) diff --git a/proto/src/dlt_pb2.py b/proto/src/dlt_pb2.py index dba939fe812867228ab7a405ecd0a4c99a839f9b..afd35b76ee0d3a700101fc01660bcf47fa8740aa 100644 --- a/proto/src/dlt_pb2.py +++ b/proto/src/dlt_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: dlt.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -14,7 +12,6 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 import context_pb2 as context__pb2 @@ -23,37 +20,43 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='dlt', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\tdlt.proto\x12\x03\x64lt\x1a\x1bgoogle/protobuf/empty.proto\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\xee\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\x38\n\x0cGetDltStatus\x12\x16.google.protobuf.Empty\x1a\x0e.dlt.DltStatus\"\x00\x62\x06proto3') + 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' , - dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,context__pb2.DESCRIPTOR,]) + dependencies=[context__pb2.DESCRIPTOR,]) _DLTRECORDTYPE = _descriptor.EnumDescriptor( name='DltRecordType', 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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SERVICE', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DEVICE', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='SLICE', index=3, number=3, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, - serialized_start=522, - serialized_end=586, + serialized_start=493, + serialized_end=557, ) _sym_db.RegisterEnumDescriptor(_DLTRECORDTYPE) @@ -63,24 +66,28 @@ _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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='UPDATE', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DELETE', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, - serialized_start=588, - serialized_end=641, + serialized_start=559, + serialized_end=612, ) _sym_db.RegisterEnumDescriptor(_DLTRECORDOPERATION) @@ -90,24 +97,28 @@ _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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='STORED', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DISABLED', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, - serialized_start=643, - serialized_end=705, + serialized_start=614, + serialized_end=676, ) _sym_db.RegisterEnumDescriptor(_DLTRECORDSTATUSENUM) @@ -117,28 +128,33 @@ _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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='INITIALIZED', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='AVAILABLE', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DEINIT', index=3, number=3, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, - serialized_start=707, - serialized_end=785, + serialized_start=678, + serialized_end=756, ) _sym_db.RegisterEnumDescriptor(_DLTSTATUSENUM) @@ -166,6 +182,7 @@ _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, @@ -173,14 +190,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -193,8 +210,8 @@ _DLTRECORDSUBSCRIPTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=62, - serialized_end=163, + serialized_start=33, + serialized_end=134, ) @@ -204,6 +221,7 @@ _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, @@ -211,28 +229,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -245,8 +263,8 @@ _DLTRECORD = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=166, - serialized_end=299, + serialized_start=137, + serialized_end=270, ) @@ -256,6 +274,7 @@ _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, @@ -263,7 +282,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -276,8 +295,8 @@ _DLTRECORDID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=301, - serialized_end=341, + serialized_start=272, + serialized_end=312, ) @@ -287,6 +306,7 @@ _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, @@ -294,14 +314,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -314,8 +334,8 @@ _RECORDSTATUS = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=343, - serialized_end=429, + serialized_start=314, + serialized_end=400, ) @@ -325,6 +345,7 @@ _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, @@ -332,14 +353,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -352,8 +373,8 @@ _DLTSTATUS = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=431, - serialized_end=520, + serialized_start=402, + serialized_end=491, ) _DLTRECORDSUBSCRIPTION.fields_by_name['type'].enum_type = _DLTRECORDTYPE @@ -420,8 +441,9 @@ _DLTSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - serialized_start=788, - serialized_end=1026, + create_key=_descriptor._internal_create_key, + serialized_start=759, + serialized_end=989, methods=[ _descriptor.MethodDescriptor( name='RecordToDlt', @@ -431,6 +453,7 @@ _DLTSERVICE = _descriptor.ServiceDescriptor( input_type=_DLTRECORD, output_type=_RECORDSTATUS, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetFromDlt', @@ -440,6 +463,7 @@ _DLTSERVICE = _descriptor.ServiceDescriptor( input_type=_DLTRECORDID, output_type=_DLTRECORD, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='SubscribeToDlt', @@ -449,15 +473,17 @@ _DLTSERVICE = _descriptor.ServiceDescriptor( input_type=_DLTRECORDSUBSCRIPTION, output_type=_DLTRECORD, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetDltStatus', full_name='dlt.DltService.GetDltStatus', index=3, containing_service=None, - input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + 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 e5184ecf041cf83c33f2d75115fb5429f6719b9b..acbd11ccb95a36092e8514d5789feed978290c92 100644 --- a/proto/src/dlt_pb2_grpc.py +++ b/proto/src/dlt_pb2_grpc.py @@ -1,98 +1,166 @@ # 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 import dlt_pb2 as dlt__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 class DltServiceStub(object): - # 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=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=dlt__pb2.DltStatus.FromString, - ) + """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, + ) class DltServiceServicer(object): - # 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!') + """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!') 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=google_dot_protobuf_dot_empty__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,)) + 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) diff --git a/proto/src/interdomain_pb2.py b/proto/src/interdomain_pb2.py index f94dec630b86f1844ac321b4fa0f5a363398fac4..aa1444df06c8c1f976723863ec980018a1faa851 100644 --- a/proto/src/interdomain_pb2.py +++ b/proto/src/interdomain_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: interdomain.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -22,7 +20,8 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='interdomain', syntax='proto3', serialized_options=None, - 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') + 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' , dependencies=[context__pb2.DESCRIPTOR,slice__pb2.DESCRIPTOR,]) @@ -38,6 +37,7 @@ _INTERDOMAINSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, + create_key=_descriptor._internal_create_key, serialized_start=63, serialized_end=362, methods=[ @@ -49,6 +49,7 @@ _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', @@ -58,6 +59,7 @@ _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', @@ -67,6 +69,7 @@ _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', @@ -76,6 +79,7 @@ _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 5bbeb7bd7900633ace0b711e3a15c2c23415169e..9df51786c4d019075cd5fd333edaf8905afbd463 100644 --- a/proto/src/interdomain_pb2_grpc.py +++ b/proto/src/interdomain_pb2_grpc.py @@ -1,4 +1,5 @@ # 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 @@ -6,93 +7,160 @@ import slice_pb2 as slice__pb2 class InterdomainServiceStub(object): - # 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, - ) + """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, + ) class InterdomainServiceServicer(object): - # 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!') + """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!') 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,)) + 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) diff --git a/proto/src/monitoring_pb2.py b/proto/src/monitoring_pb2.py index b17d9262704d6802fa570454c739d327ab8527a0..0d35be4dab56540bcc3de82b590a122e80d2c79c 100644 --- a/proto/src/monitoring_pb2.py +++ b/proto/src/monitoring_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: monitoring.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -13,7 +11,6 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 import context_pb2 as context__pb2 @@ -22,9 +19,10 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='monitoring', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\x10monitoring.proto\x12\nmonitoring\x1a\x1bgoogle/protobuf/empty.proto\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\xfb\x01\n\x11MonitoringService\x12\x37\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x16.google.protobuf.Empty\"\x00\x12=\n\nMonitorKpi\x12\x15.monitoring.KpiDevice\x1a\x16.google.protobuf.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') + 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' , - dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,context__pb2.DESCRIPTOR,]) + dependencies=[context__pb2.DESCRIPTOR,]) @@ -35,6 +33,7 @@ _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, @@ -42,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -76,8 +75,8 @@ _KPI = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=76, - serialized_end=200, + serialized_start=47, + serialized_end=171, ) @@ -87,6 +86,7 @@ _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 +94,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -107,8 +107,8 @@ _KPIID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=202, - serialized_end=240, + serialized_start=173, + serialized_end=211, ) @@ -118,6 +118,7 @@ _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, @@ -125,14 +126,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -145,8 +146,8 @@ _KPIDEVICE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=242, - serialized_end=326, + serialized_start=213, + serialized_end=297, ) @@ -156,6 +157,7 @@ _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, @@ -163,7 +165,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -176,8 +178,8 @@ _KPILIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=328, - serialized_end=371, + serialized_start=299, + serialized_end=342, ) @@ -187,6 +189,7 @@ _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, @@ -194,21 +197,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -222,10 +225,12 @@ _KPIVALUE = _descriptor.Descriptor( oneofs=[ _descriptor.OneofDescriptor( name='value', full_name='monitoring.KpiValue.value', - index=0, containing_type=None, fields=[]), + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), ], - serialized_start=373, - serialized_end=450, + serialized_start=344, + serialized_end=421, ) _KPI.fields_by_name['kpi_id'].message_type = _KPIID @@ -293,8 +298,9 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - serialized_start=453, - serialized_end=704, + create_key=_descriptor._internal_create_key, + serialized_start=424, + serialized_end=659, methods=[ _descriptor.MethodDescriptor( name='IncludeKpi', @@ -302,8 +308,9 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( index=0, containing_service=None, input_type=_KPI, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + output_type=context__pb2._EMPTY, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='MonitorKpi', @@ -311,8 +318,9 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( index=1, containing_service=None, input_type=_KPIDEVICE, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + output_type=context__pb2._EMPTY, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetStream_kpi', @@ -322,6 +330,7 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPIID, output_type=_KPI, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetInstantKpi', @@ -331,6 +340,7 @@ _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 e1627495fe092c8be989172afeba7b4023d304e0..0c74d26a1df11a9cfb1fa366c528c51a8e1c5db9 100644 --- a/proto/src/monitoring_pb2_grpc.py +++ b/proto/src/monitoring_pb2_grpc.py @@ -1,98 +1,166 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +import context_pb2 as context__pb2 import monitoring_pb2 as monitoring__pb2 class MonitoringServiceStub(object): - # 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=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.MonitorKpi = channel.unary_unary( - '/monitoring.MonitoringService/MonitorKpi', - request_serializer=monitoring__pb2.KpiDevice.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__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.""" + + 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 - 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!') + """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!') 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=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'MonitorKpi': grpc.unary_unary_rpc_method_handler( - servicer.MonitorKpi, - request_deserializer=monitoring__pb2.KpiDevice.FromString, - response_serializer=google_dot_protobuf_dot_empty__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,)) + 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) diff --git a/proto/src/policy_pb2.py b/proto/src/policy_pb2.py index 69c49bfb0706114e715ce6be866ed8c02ca37a91..f9684c01ac022c4dc6d558f752f7c1f56e81ebc9 100644 --- a/proto/src/policy_pb2.py +++ b/proto/src/policy_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: policy.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -23,7 +21,8 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='policy', syntax='proto3', serialized_options=None, - 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') + 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' , dependencies=[context__pb2.DESCRIPTOR,service__pb2.DESCRIPTOR,]) @@ -32,15 +31,18 @@ _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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ACTIVE', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, @@ -61,6 +63,7 @@ _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, @@ -68,7 +71,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -92,6 +95,7 @@ _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, @@ -99,49 +103,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -165,6 +169,7 @@ _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, @@ -172,7 +177,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -196,6 +201,7 @@ _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, @@ -203,14 +209,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -234,6 +240,7 @@ _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, @@ -241,14 +248,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -272,14 +279,15 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -303,14 +311,15 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -334,6 +343,7 @@ _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, @@ -341,14 +351,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -453,6 +463,7 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, + create_key=_descriptor._internal_create_key, serialized_start=957, serialized_end=1353, methods=[ @@ -464,6 +475,7 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( input_type=_POLICYRULE, output_type=_POLICYRULESTATE, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='PolicyUpdate', @@ -473,6 +485,7 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( input_type=_POLICYRULE, output_type=_POLICYRULESTATE, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='PolicyDelete', @@ -482,6 +495,7 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( input_type=_POLICYRULE, output_type=_POLICYRULESTATE, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetPolicy', @@ -491,6 +505,7 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( input_type=_POLICYRULEID, output_type=_POLICYRULE, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetPolicyByDeviceId', @@ -500,6 +515,7 @@ _POLICYSERVICE = _descriptor.ServiceDescriptor( input_type=context__pb2._DEVICEID, output_type=_POLICYRULELIST, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetPolicyByServiceId', @@ -509,6 +525,7 @@ _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 e7cea718547c3f9af99586c351cf7316724209a4..5de12fa15880ff8023c0674f7d32ec249b8a276c 100644 --- a/proto/src/policy_pb2_grpc.py +++ b/proto/src/policy_pb2_grpc.py @@ -1,4 +1,5 @@ # 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,127 +8,226 @@ import service_pb2 as service__pb2 class PolicyServiceStub(object): - # 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, - ) + """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, + ) class PolicyServiceServicer(object): - # 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!') + """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!') 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,)) + 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) diff --git a/proto/src/service_pb2.py b/proto/src/service_pb2.py index de070f50460fe0cb99d07404bdd69b36d7f0bb70..6d41f661ca86956fbbaaf3b64594bce9a922856a 100644 --- a/proto/src/service_pb2.py +++ b/proto/src/service_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: service.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -14,7 +12,6 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 import context_pb2 as context__pb2 @@ -23,37 +20,43 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='service', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\rservice.proto\x12\x07service\x1a\x1bgoogle/protobuf/empty.proto\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\xff\x02\n\x0eServiceService\x12@\n\x0eGetServiceList\x12\x16.google.protobuf.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\x46\n\x11GetConnectionList\x12\x16.google.protobuf.Empty\x1a\x17.service.ConnectionList\"\x00\x62\x06proto3') + 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' , - dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,context__pb2.DESCRIPTOR,]) + dependencies=[context__pb2.DESCRIPTOR,]) _SERVICETYPE = _descriptor.EnumDescriptor( name='ServiceType', 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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='L3NM', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='L2NM', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TAPI_CONNECTIVITY_SERVICE', index=3, number=3, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, - serialized_start=834, - serialized_end=911, + serialized_start=805, + serialized_end=882, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPE) @@ -63,24 +66,28 @@ _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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ACTIVE', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PENDING_REMOVAL', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, - serialized_start=913, - serialized_end=977, + serialized_start=884, + serialized_end=948, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATEENUM) @@ -101,6 +108,7 @@ _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, @@ -108,7 +116,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -121,8 +129,8 @@ _SERVICELIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=70, - serialized_end=113, + serialized_start=41, + serialized_end=84, ) @@ -132,6 +140,7 @@ _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, @@ -139,42 +148,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -187,8 +196,8 @@ _SERVICE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=116, - serialized_end=379, + serialized_start=87, + serialized_end=350, ) @@ -198,14 +207,15 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -218,8 +228,8 @@ _SERVICECONFIG = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=381, - serialized_end=419, + serialized_start=352, + serialized_end=390, ) @@ -229,6 +239,7 @@ _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, @@ -236,7 +247,7 @@ _SERVICEID = _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -249,8 +260,8 @@ _SERVICEID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=421, - serialized_end=462, + serialized_start=392, + serialized_end=433, ) @@ -260,6 +271,7 @@ _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, @@ -267,7 +279,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -280,8 +292,8 @@ _SERVICEIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=464, - serialized_end=522, + serialized_start=435, + serialized_end=493, ) @@ -291,6 +303,7 @@ _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, @@ -298,7 +311,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -311,8 +324,8 @@ _SERVICESTATE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=524, - serialized_end=587, + serialized_start=495, + serialized_end=558, ) @@ -322,6 +335,7 @@ _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, @@ -329,7 +343,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -342,8 +356,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=589, - serialized_end=650, + serialized_start=560, + serialized_end=621, ) @@ -353,6 +367,7 @@ _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, @@ -360,21 +375,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -387,8 +402,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=653, - serialized_end=785, + serialized_start=624, + serialized_end=756, ) @@ -398,6 +413,7 @@ _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, @@ -405,7 +421,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -418,8 +434,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=787, - serialized_end=832, + serialized_start=758, + serialized_end=803, ) _SERVICELIST.fields_by_name['cs'].message_type = _SERVICE @@ -521,17 +537,19 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - serialized_start=980, - serialized_end=1363, + create_key=_descriptor._internal_create_key, + serialized_start=951, + serialized_end=1318, methods=[ _descriptor.MethodDescriptor( name='GetServiceList', full_name='service.ServiceService.GetServiceList', index=0, containing_service=None, - input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + input_type=context__pb2._EMPTY, output_type=_SERVICELIST, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='CreateService', @@ -541,6 +559,7 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( input_type=_SERVICE, output_type=_SERVICEID, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='UpdateService', @@ -550,6 +569,7 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( input_type=_SERVICE, output_type=_SERVICEID, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='DeleteService', @@ -559,6 +579,7 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( input_type=_SERVICE, output_type=_SERVICEID, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetServiceById', @@ -568,15 +589,17 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( input_type=_SERVICEID, output_type=_SERVICE, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetConnectionList', full_name='service.ServiceService.GetConnectionList', index=5, containing_service=None, - input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + 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 cfab4be8c8b7502700403e914e7ffe41a02746bb..051c64a190d7f51f37fd4b09f913210697fa6d85 100644 --- a/proto/src/service_pb2_grpc.py +++ b/proto/src/service_pb2_grpc.py @@ -1,132 +1,232 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +import context_pb2 as context__pb2 import service_pb2 as service__pb2 class ServiceServiceStub(object): - # 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=google_dot_protobuf_dot_empty__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=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=service__pb2.ConnectionList.FromString, - ) + """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, + ) class ServiceServiceServicer(object): - # 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!') + """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!') def add_ServiceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'GetServiceList': grpc.unary_unary_rpc_method_handler( - servicer.GetServiceList, - request_deserializer=google_dot_protobuf_dot_empty__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=google_dot_protobuf_dot_empty__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,)) + 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) diff --git a/proto/src/slice_pb2.py b/proto/src/slice_pb2.py index b1570c28f229cf0fabbf5a8f96e16f04635c541c..26daf947f817a192a16ecd091d9fc6bba739db26 100644 --- a/proto/src/slice_pb2.py +++ b/proto/src/slice_pb2.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: slice.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -14,7 +12,6 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 import context_pb2 as context__pb2 @@ -23,37 +20,43 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='slice', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\x0bslice.proto\x12\x05slice\x1a\x1bgoogle/protobuf/empty.proto\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\x90\x01\n\x0cSliceService\x12@\n\x11\x43reateUpdateSlice\x12\x15.slice.TransportSlice\x1a\x12.slice.SliceStatus\"\x00\x12>\n\x0b\x44\x65leteSlice\x12\x15.slice.TransportSlice\x1a\x16.google.protobuf.Empty\"\x00\x62\x06proto3') + 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' , - dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,context__pb2.DESCRIPTOR,]) + dependencies=[context__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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='INIT', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ACTIVE', index=2, number=2, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DEINIT', index=3, number=3, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, - serialized_start=424, - serialized_end=488, + serialized_start=395, + serialized_end=459, ) _sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) @@ -71,6 +74,7 @@ _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, @@ -78,7 +82,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -91,8 +95,8 @@ _SLICEENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=66, - serialized_end=117, + serialized_start=37, + serialized_end=88, ) @@ -102,6 +106,7 @@ _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, @@ -109,28 +114,28 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='status', full_name='slice.TransportSlice.status', 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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -143,8 +148,8 @@ _TRANSPORTSLICE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=120, - serialized_end=289, + serialized_start=91, + serialized_end=260, ) @@ -154,6 +159,7 @@ _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, @@ -161,7 +167,7 @@ _SLICEID = _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -174,8 +180,8 @@ _SLICEID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=291, - serialized_end=333, + serialized_start=262, + serialized_end=304, ) @@ -185,6 +191,7 @@ _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, @@ -192,14 +199,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -212,8 +219,8 @@ _SLICESTATUS = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=335, - serialized_end=422, + serialized_start=306, + serialized_end=393, ) _SLICEENDPOINT.fields_by_name['port_id'].message_type = context__pb2._ENDPOINT @@ -267,8 +274,9 @@ _SLICESERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, - serialized_start=491, - serialized_end=635, + create_key=_descriptor._internal_create_key, + serialized_start=462, + serialized_end=598, methods=[ _descriptor.MethodDescriptor( name='CreateUpdateSlice', @@ -278,6 +286,7 @@ _SLICESERVICE = _descriptor.ServiceDescriptor( input_type=_TRANSPORTSLICE, output_type=_SLICESTATUS, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='DeleteSlice', @@ -285,8 +294,9 @@ _SLICESERVICE = _descriptor.ServiceDescriptor( index=1, containing_service=None, input_type=_TRANSPORTSLICE, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + 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 48b7b47f3f6faaa3f30adb7ec62932fea2907b39..f09c823cdbb43da54d9d2e3a8d0c9c25ee5f509e 100644 --- a/proto/src/slice_pb2_grpc.py +++ b/proto/src/slice_pb2_grpc.py @@ -1,64 +1,100 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +import context_pb2 as context__pb2 import slice_pb2 as slice__pb2 class SliceServiceStub(object): - # missing associated documentation comment in .proto file - pass + """Missing associated documentation comment in .proto file.""" - 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=google_dot_protobuf_dot_empty__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 - pass + """Missing associated documentation comment in .proto file.""" - 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 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 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 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 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=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'slice.SliceService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) + 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) diff --git a/src/clean.sh b/src/clean.sh new file mode 100755 index 0000000000000000000000000000000000000000..9c96b6e12be0818bdc8a5d21ec7d37c5b1356115 --- /dev/null +++ b/src/clean.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +docker rm --force monitoring +docker network remove teraflowbridge + diff --git a/src/monitoring/context_pb2.py b/src/monitoring/context_pb2.py index b88c740b7020f8a0f6d68ec064322fd5b32e6b71..255f813e75bf6dd3f70cb1bc1cf80d676e339c66 100644 --- a/src/monitoring/context_pb2.py +++ b/src/monitoring/context_pb2.py @@ -1,8 +1,7 @@ +# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: context.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -21,7 +20,8 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='context', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\rcontext.proto\x12\x07\x63ontext\x1a\x1bgoogle/protobuf/empty.proto\"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\x32L\n\x0e\x43ontextService\x12:\n\x0bGetTopology\x12\x16.google.protobuf.Empty\x1a\x11.context.Topology\"\x00\x62\x06proto3') + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x1bgoogle/protobuf/empty.proto\"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\x32L\n\x0e\x43ontextService\x12:\n\x0bGetTopology\x12\x16.google.protobuf.Empty\x1a\x11.context.Topology\"\x00\x62\x06proto3' , dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,]) @@ -30,15 +30,18 @@ _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), + type=None, + create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='ENABLED', index=1, number=1, serialized_options=None, - type=None), + type=None, + create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, @@ -59,6 +62,7 @@ _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, @@ -66,14 +70,14 @@ _CONTEXT = _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ctl', full_name='context.Context.ctl', 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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -97,6 +101,7 @@ _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, @@ -104,14 +109,14 @@ _TOPOLOGY = _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='link', full_name='context.Topology.link', 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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -135,6 +140,7 @@ _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, @@ -142,7 +148,7 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -166,21 +172,22 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -204,6 +211,7 @@ _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, @@ -211,35 +219,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -263,14 +271,15 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -294,6 +303,7 @@ _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, @@ -301,14 +311,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -332,6 +342,7 @@ _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, @@ -339,14 +350,14 @@ _ENDPOINTID = _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -370,6 +381,7 @@ _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, @@ -377,7 +389,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -401,14 +413,15 @@ _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -432,6 +445,7 @@ _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, @@ -439,14 +453,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -470,6 +484,7 @@ _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, @@ -477,14 +492,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -531,88 +546,88 @@ DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT DESCRIPTOR.enum_types_by_name['DeviceOperationalStatus'] = _DEVICEOPERATIONALSTATUS _sym_db.RegisterFileDescriptor(DESCRIPTOR) -Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), dict( - DESCRIPTOR = _CONTEXT, - __module__ = 'context_pb2' +Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXT, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.Context) - )) + }) _sym_db.RegisterMessage(Context) -Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), dict( - DESCRIPTOR = _TOPOLOGY, - __module__ = 'context_pb2' +Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { + 'DESCRIPTOR' : _TOPOLOGY, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.Topology) - )) + }) _sym_db.RegisterMessage(Topology) -Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), dict( - DESCRIPTOR = _LINK, - __module__ = 'context_pb2' +Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { + 'DESCRIPTOR' : _LINK, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.Link) - )) + }) _sym_db.RegisterMessage(Link) -Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), dict( - DESCRIPTOR = _CONSTRAINT, - __module__ = 'context_pb2' +Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { + 'DESCRIPTOR' : _CONSTRAINT, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.Constraint) - )) + }) _sym_db.RegisterMessage(Constraint) -Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), dict( - DESCRIPTOR = _DEVICE, - __module__ = 'context_pb2' +Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { + 'DESCRIPTOR' : _DEVICE, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.Device) - )) + }) _sym_db.RegisterMessage(Device) -DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), dict( - DESCRIPTOR = _DEVICECONFIG, - __module__ = 'context_pb2' +DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { + 'DESCRIPTOR' : _DEVICECONFIG, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.DeviceConfig) - )) + }) _sym_db.RegisterMessage(DeviceConfig) -EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), dict( - DESCRIPTOR = _ENDPOINT, - __module__ = 'context_pb2' +EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINT, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.EndPoint) - )) + }) _sym_db.RegisterMessage(EndPoint) -EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), dict( - DESCRIPTOR = _ENDPOINTID, - __module__ = 'context_pb2' +EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINTID, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.EndPointId) - )) + }) _sym_db.RegisterMessage(EndPointId) -DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), dict( - DESCRIPTOR = _DEVICEID, - __module__ = 'context_pb2' +DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { + 'DESCRIPTOR' : _DEVICEID, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.DeviceId) - )) + }) _sym_db.RegisterMessage(DeviceId) -Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), dict( - DESCRIPTOR = _UUID, - __module__ = 'context_pb2' +Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { + 'DESCRIPTOR' : _UUID, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.Uuid) - )) + }) _sym_db.RegisterMessage(Uuid) -TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), dict( - DESCRIPTOR = _TERAFLOWCONTROLLER, - __module__ = 'context_pb2' +TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { + 'DESCRIPTOR' : _TERAFLOWCONTROLLER, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.TeraFlowController) - )) + }) _sym_db.RegisterMessage(TeraFlowController) -AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), dict( - DESCRIPTOR = _AUTHENTICATIONRESULT, - __module__ = 'context_pb2' +AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { + 'DESCRIPTOR' : _AUTHENTICATIONRESULT, + '__module__' : 'context_pb2' # @@protoc_insertion_point(class_scope:context.AuthenticationResult) - )) + }) _sym_db.RegisterMessage(AuthenticationResult) @@ -623,6 +638,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, + create_key=_descriptor._internal_create_key, serialized_start=1013, serialized_end=1089, methods=[ @@ -634,6 +650,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, output_type=_TOPOLOGY, serialized_options=None, + create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) diff --git a/src/monitoring/context_pb2_grpc.py b/src/monitoring/context_pb2_grpc.py index 3b7c02da5fbca4ce39db81f680af540282106894..046c7246e99e9c89c8a1b41268415cdc0f330d34 100644 --- a/src/monitoring/context_pb2_grpc.py +++ b/src/monitoring/context_pb2_grpc.py @@ -1,4 +1,5 @@ # 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 @@ -6,42 +7,61 @@ from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 class ContextServiceStub(object): - # missing associated documentation comment in .proto file - pass + """Missing associated documentation comment in .proto file.""" - 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=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.Topology.FromString, - ) + Args: + channel: A grpc.Channel. + """ + self.GetTopology = channel.unary_unary( + '/context.ContextService/GetTopology', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=context__pb2.Topology.FromString, + ) class ContextServiceServicer(object): - # missing associated documentation comment in .proto file - pass + """Missing associated documentation comment in .proto file.""" - 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 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 add_ContextServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'GetTopology': grpc.unary_unary_rpc_method_handler( - servicer.GetTopology, - request_deserializer=google_dot_protobuf_dot_empty__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,)) + rpc_method_handlers = { + 'GetTopology': grpc.unary_unary_rpc_method_handler( + servicer.GetTopology, + request_deserializer=google_dot_protobuf_dot_empty__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', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + context__pb2.Topology.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/monitoring/genproto.sh b/src/monitoring/genproto.sh index d2343d58786707576aed680cc857d2321a1e189d..e687e882d5f2bc033b43a3e4e482e68cc766dd25 100755 --- a/src/monitoring/genproto.sh +++ b/src/monitoring/genproto.sh @@ -18,4 +18,3 @@ python -m grpc_tools.protoc -I../../proto --python_out=. --grpc_python_out=. ../../proto/monitoring.proto python -m grpc_tools.protoc -I../../proto --python_out=. --grpc_python_out=. ../../proto/context.proto -python -m grpc_tools.protoc -I../../proto --python_out=. --grpc_python_out=. ../../proto/grpc/health/v1/health.proto diff --git a/src/monitoring/grpc/__init__.py b/src/monitoring/grpc/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/monitoring/grpc/health/__init__.py b/src/monitoring/grpc/health/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/monitoring/grpc/health/v1/__init__.py b/src/monitoring/grpc/health/v1/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/monitoring/grpc/health/v1/health_pb2.py b/src/monitoring/grpc/health/v1/health_pb2.py deleted file mode 100644 index 6972b766795f887ab11ae63384c77abc68f74de5..0000000000000000000000000000000000000000 --- a/src/monitoring/grpc/health/v1/health_pb2.py +++ /dev/null @@ -1,162 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: grpc/health/v1/health.proto - -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 -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='grpc/health/v1/health.proto', - package='grpc.health.v1', - syntax='proto3', - serialized_options=_b('\n\021io.grpc.health.v1B\013HealthProtoP\001Z,google.golang.org/grpc/health/grpc_health_v1\252\002\016Grpc.Health.V1'), - serialized_pb=_b('\n\x1bgrpc/health/v1/health.proto\x12\x0egrpc.health.v1\"%\n\x12HealthCheckRequest\x12\x0f\n\x07service\x18\x01 \x01(\t\"\x94\x01\n\x13HealthCheckResponse\x12\x41\n\x06status\x18\x01 \x01(\x0e\x32\x31.grpc.health.v1.HealthCheckResponse.ServingStatus\":\n\rServingStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07SERVING\x10\x01\x12\x0f\n\x0bNOT_SERVING\x10\x02\x32Z\n\x06Health\x12P\n\x05\x43heck\x12\".grpc.health.v1.HealthCheckRequest\x1a#.grpc.health.v1.HealthCheckResponseBa\n\x11io.grpc.health.v1B\x0bHealthProtoP\x01Z,google.golang.org/grpc/health/grpc_health_v1\xaa\x02\x0eGrpc.Health.V1b\x06proto3') -) - - - -_HEALTHCHECKRESPONSE_SERVINGSTATUS = _descriptor.EnumDescriptor( - name='ServingStatus', - full_name='grpc.health.v1.HealthCheckResponse.ServingStatus', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='SERVING', index=1, number=1, - serialized_options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='NOT_SERVING', index=2, number=2, - serialized_options=None, - type=None), - ], - containing_type=None, - serialized_options=None, - serialized_start=177, - serialized_end=235, -) -_sym_db.RegisterEnumDescriptor(_HEALTHCHECKRESPONSE_SERVINGSTATUS) - - -_HEALTHCHECKREQUEST = _descriptor.Descriptor( - name='HealthCheckRequest', - full_name='grpc.health.v1.HealthCheckRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='service', full_name='grpc.health.v1.HealthCheckRequest.service', index=0, - number=1, type=9, cpp_type=9, label=1, - 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), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=47, - serialized_end=84, -) - - -_HEALTHCHECKRESPONSE = _descriptor.Descriptor( - name='HealthCheckResponse', - full_name='grpc.health.v1.HealthCheckResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='status', full_name='grpc.health.v1.HealthCheckResponse.status', index=0, - number=1, 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), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _HEALTHCHECKRESPONSE_SERVINGSTATUS, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=87, - serialized_end=235, -) - -_HEALTHCHECKRESPONSE.fields_by_name['status'].enum_type = _HEALTHCHECKRESPONSE_SERVINGSTATUS -_HEALTHCHECKRESPONSE_SERVINGSTATUS.containing_type = _HEALTHCHECKRESPONSE -DESCRIPTOR.message_types_by_name['HealthCheckRequest'] = _HEALTHCHECKREQUEST -DESCRIPTOR.message_types_by_name['HealthCheckResponse'] = _HEALTHCHECKRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -HealthCheckRequest = _reflection.GeneratedProtocolMessageType('HealthCheckRequest', (_message.Message,), dict( - DESCRIPTOR = _HEALTHCHECKREQUEST, - __module__ = 'grpc.health.v1.health_pb2' - # @@protoc_insertion_point(class_scope:grpc.health.v1.HealthCheckRequest) - )) -_sym_db.RegisterMessage(HealthCheckRequest) - -HealthCheckResponse = _reflection.GeneratedProtocolMessageType('HealthCheckResponse', (_message.Message,), dict( - DESCRIPTOR = _HEALTHCHECKRESPONSE, - __module__ = 'grpc.health.v1.health_pb2' - # @@protoc_insertion_point(class_scope:grpc.health.v1.HealthCheckResponse) - )) -_sym_db.RegisterMessage(HealthCheckResponse) - - -DESCRIPTOR._options = None - -_HEALTH = _descriptor.ServiceDescriptor( - name='Health', - full_name='grpc.health.v1.Health', - file=DESCRIPTOR, - index=0, - serialized_options=None, - serialized_start=237, - serialized_end=327, - methods=[ - _descriptor.MethodDescriptor( - name='Check', - full_name='grpc.health.v1.Health.Check', - index=0, - containing_service=None, - input_type=_HEALTHCHECKREQUEST, - output_type=_HEALTHCHECKRESPONSE, - serialized_options=None, - ), -]) -_sym_db.RegisterServiceDescriptor(_HEALTH) - -DESCRIPTOR.services_by_name['Health'] = _HEALTH - -# @@protoc_insertion_point(module_scope) diff --git a/src/monitoring/grpc/health/v1/health_pb2_grpc.py b/src/monitoring/grpc/health/v1/health_pb2_grpc.py deleted file mode 100644 index 06e5fb02fec56b3f2f9a00f2dcc13a5cbe24e59b..0000000000000000000000000000000000000000 --- a/src/monitoring/grpc/health/v1/health_pb2_grpc.py +++ /dev/null @@ -1,46 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from grpc.health.v1 import health_pb2 as grpc_dot_health_dot_v1_dot_health__pb2 - - -class HealthStub(object): - # missing associated documentation comment in .proto file - pass - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Check = channel.unary_unary( - '/grpc.health.v1.Health/Check', - request_serializer=grpc_dot_health_dot_v1_dot_health__pb2.HealthCheckRequest.SerializeToString, - response_deserializer=grpc_dot_health_dot_v1_dot_health__pb2.HealthCheckResponse.FromString, - ) - - -class HealthServicer(object): - # missing associated documentation comment in .proto file - pass - - def Check(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_HealthServicer_to_server(servicer, server): - rpc_method_handlers = { - 'Check': grpc.unary_unary_rpc_method_handler( - servicer.Check, - request_deserializer=grpc_dot_health_dot_v1_dot_health__pb2.HealthCheckRequest.FromString, - response_serializer=grpc_dot_health_dot_v1_dot_health__pb2.HealthCheckResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'grpc.health.v1.Health', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/src/monitoring/monitoring_client.py b/src/monitoring/monitoring_client.py new file mode 100644 index 0000000000000000000000000000000000000000..955b512f137a61b8a4e2df93afaeeee5f8bb05cc --- /dev/null +++ b/src/monitoring/monitoring_client.py @@ -0,0 +1,64 @@ +import sys +import grpc + +import monitoring +import monitoring_pb2_grpc +import context + +import json + +from logger import getJSONLogger +logger = getJSONLogger('monitoring-client') +logger.setLevel('DEBUG') + +class MonitoringClient: + + def __init__(self, server="monitoring", port="7070"): + logger.info("init monitoringClient port " + port) + self.channel=grpc.insecure_channel(server+':'+port) + self.server=usc_pb2_grpc.MonitoringServiceStub(self.channel) + + def IncludeKpi(self, request): + logger.info("IncludeKpi: {}".format(request)) + response = self.server.IncludeKpi(request) + logger.info("IncludeKpi result: {}".format(response)) + return context.Empty() + + def MonitorKpi(self, request): + logger.info("MonitorKpi: {}".format(request)) + response = self.server.IncludeKpi(request) + logger.info("MonitorKpi result: {}".format(response)) + return context.Empty() + + def GetStream_kpi(self, request): + logger.info("GetStream_kpi: {}".format(request)) + response = self.server.GetStream_kpi(request) + logger.info("GetStream_kpi result: {}".format(response)) + yield response + + def GetInstantKpi(self, request): + logger.info("GetInstantKpi: {}".format(request)) + response = self.server.IncludeKpi(request) + logger.info("GetInstantKpi result: {}".format(response)) + return response + + +if __name__ == "__main__": + # get port + if len(sys.argv) > 1: + port = sys.argv[1] + else: + port = "7070" + + + # form request + kpi = monitoring.Kpi() + kpi.kpi_id.kpi_id = "KPIID0000" + kpi.kpiDescription "KPI Desc" + + # make call to server + client = MonitoringClient(port) + response=client.IncludeKpi(kpi) + + + diff --git a/src/monitoring/monitoring_pb2.py b/src/monitoring/monitoring_pb2.py index 02719e25b05fee8573437acdb858f3b5ee830ead..0f0a9d07634ce5a383eb00f1246d557c0c0667e4 100644 --- a/src/monitoring/monitoring_pb2.py +++ b/src/monitoring/monitoring_pb2.py @@ -1,8 +1,7 @@ +# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: monitoring.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -21,7 +20,8 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='monitoring', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\x10monitoring.proto\x12\nmonitoring\x1a\x1bgoogle/protobuf/empty.proto\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\xfb\x01\n\x11MonitoringService\x12\x37\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x16.google.protobuf.Empty\"\x00\x12=\n\nMonitorKpi\x12\x15.monitoring.KpiDevice\x1a\x16.google.protobuf.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') + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x10monitoring.proto\x12\nmonitoring\x1a\x1bgoogle/protobuf/empty.proto\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\xfb\x01\n\x11MonitoringService\x12\x37\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x16.google.protobuf.Empty\"\x00\x12=\n\nMonitorKpi\x12\x15.monitoring.KpiDevice\x1a\x16.google.protobuf.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=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,context__pb2.DESCRIPTOR,]) @@ -34,6 +34,7 @@ _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 +42,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -86,6 +87,7 @@ _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, @@ -93,7 +95,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -117,6 +119,7 @@ _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, @@ -124,14 +127,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -155,6 +158,7 @@ _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, @@ -162,7 +166,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -186,6 +190,7 @@ _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, @@ -193,21 +198,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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _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), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -221,7 +226,9 @@ _KPIVALUE = _descriptor.Descriptor( oneofs=[ _descriptor.OneofDescriptor( name='value', full_name='monitoring.KpiValue.value', - index=0, containing_type=None, fields=[]), + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), ], serialized_start=373, serialized_end=450, @@ -249,39 +256,39 @@ DESCRIPTOR.message_types_by_name['KpiList'] = _KPILIST DESCRIPTOR.message_types_by_name['KpiValue'] = _KPIVALUE _sym_db.RegisterFileDescriptor(DESCRIPTOR) -Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), dict( - DESCRIPTOR = _KPI, - __module__ = 'monitoring_pb2' +Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), { + 'DESCRIPTOR' : _KPI, + '__module__' : 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.Kpi) - )) + }) _sym_db.RegisterMessage(Kpi) -KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), dict( - DESCRIPTOR = _KPIID, - __module__ = 'monitoring_pb2' +KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), { + 'DESCRIPTOR' : _KPIID, + '__module__' : 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiId) - )) + }) _sym_db.RegisterMessage(KpiId) -KpiDevice = _reflection.GeneratedProtocolMessageType('KpiDevice', (_message.Message,), dict( - DESCRIPTOR = _KPIDEVICE, - __module__ = 'monitoring_pb2' +KpiDevice = _reflection.GeneratedProtocolMessageType('KpiDevice', (_message.Message,), { + 'DESCRIPTOR' : _KPIDEVICE, + '__module__' : 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiDevice) - )) + }) _sym_db.RegisterMessage(KpiDevice) -KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), dict( - DESCRIPTOR = _KPILIST, - __module__ = 'monitoring_pb2' +KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), { + 'DESCRIPTOR' : _KPILIST, + '__module__' : 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiList) - )) + }) _sym_db.RegisterMessage(KpiList) -KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), dict( - DESCRIPTOR = _KPIVALUE, - __module__ = 'monitoring_pb2' +KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), { + 'DESCRIPTOR' : _KPIVALUE, + '__module__' : 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiValue) - )) + }) _sym_db.RegisterMessage(KpiValue) @@ -292,6 +299,7 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, + create_key=_descriptor._internal_create_key, serialized_start=453, serialized_end=704, methods=[ @@ -303,6 +311,7 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPI, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='MonitorKpi', @@ -312,6 +321,7 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPIDEVICE, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetStream_kpi', @@ -321,6 +331,7 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPIID, output_type=_KPI, serialized_options=None, + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetInstantKpi', @@ -330,6 +341,7 @@ _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/src/monitoring/monitoring_pb2_grpc.py b/src/monitoring/monitoring_pb2_grpc.py index e1627495fe092c8be989172afeba7b4023d304e0..14de0299f788c7196f516e343b12e2bc6c934c24 100644 --- a/src/monitoring/monitoring_pb2_grpc.py +++ b/src/monitoring/monitoring_pb2_grpc.py @@ -1,4 +1,5 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 @@ -6,93 +7,160 @@ import monitoring_pb2 as monitoring__pb2 class MonitoringServiceStub(object): - # 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=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.MonitorKpi = channel.unary_unary( - '/monitoring.MonitoringService/MonitorKpi', - request_serializer=monitoring__pb2.KpiDevice.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__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.""" + + 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=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.MonitorKpi = channel.unary_unary( + '/monitoring.MonitoringService/MonitorKpi', + request_serializer=monitoring__pb2.KpiDevice.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__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 - 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!') + """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!') 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=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'MonitorKpi': grpc.unary_unary_rpc_method_handler( - servicer.MonitorKpi, - request_deserializer=monitoring__pb2.KpiDevice.FromString, - response_serializer=google_dot_protobuf_dot_empty__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,)) + rpc_method_handlers = { + 'IncludeKpi': grpc.unary_unary_rpc_method_handler( + servicer.IncludeKpi, + request_deserializer=monitoring__pb2.Kpi.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'MonitorKpi': grpc.unary_unary_rpc_method_handler( + servicer.MonitorKpi, + request_deserializer=monitoring__pb2.KpiDevice.FromString, + response_serializer=google_dot_protobuf_dot_empty__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, + google_dot_protobuf_dot_empty__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, + google_dot_protobuf_dot_empty__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) diff --git a/src/monitoring/monitoring_server.py b/src/monitoring/monitoring_server.py index 3a1783225e4ef69b8bf49ea28a54a7afd0b39bed..0559356aa7c64a78e61a07aa870a5c35679228bf 100644 --- a/src/monitoring/monitoring_server.py +++ b/src/monitoring/monitoring_server.py @@ -2,15 +2,18 @@ import os from concurrent import futures - import grpc + import numpy +import time import monitoring_pb2 import monitoring_pb2_grpc -import grpc.health.v1.health_pb2 -import grpc.health.v1.health_pb2_grpc +from grpc_health.v1 import health +from grpc_health.v1 import health_pb2 +from grpc_health.v1 import health_pb2_grpc + from logger import getJSONLogger logger = getJSONLogger('monitoringservice-server') @@ -53,19 +56,19 @@ if __name__ == "__main__": port = os.environ.get('PORT', "7070") # create gRPC server - server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) # ,interceptors=(tracer_interceptor,)) + serverGRPC = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) # ,interceptors=(tracer_interceptor,)) # add class to gRPC server - service = MonitoringService() - monitoring_pb2_grpc.add_MonitoringServiceServicer_to_server(service, server) + service = monitoring_pb2_grpc.MonitoringService() + monitoring_pb2_grpc.add_MonitoringServiceServicer_to_server(service, serverGRPC) health_servicer = health.HealthServicer(experimental_non_blocking=True,experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - health_pb2_grpc.add_HealthServicer_to_server(health_servicer, server) + health_pb2_grpc.add_HealthServicer_to_server(health_servicer, serverGRPC) # start server logger.info("listening on port: " + port) - server.add_insecure_port('[::]:'+port) - server.start() + serverGRPC.add_insecure_port('[::]:'+port) + serverGRPC.start() health_servicer.set("", health_pb2.HealthCheckResponse.SERVING) # keep alive @@ -73,5 +76,5 @@ if __name__ == "__main__": while True: time.sleep(0.1) except KeyboardInterrupt: - server.stop(0) + serverGRPC.stop(0) diff --git a/src/start.sh b/src/start.sh new file mode 100755 index 0000000000000000000000000000000000000000..da0e7789d92a37f4bd0f429a1d01c7bac468deec --- /dev/null +++ b/src/start.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +docker network create -d bridge teraflowbridge + +docker run -d -p 7070:7070 --name monitoring --network=teraflowbridge monitoring:dockerfile