Пример #1
0
def _stub(args):
    if args.oauth_scope:
        metadata_transformer = lambda x: [('Authorization', 'Bearer %s' %
                                           _oauth_access_token(args))]
    else:
        metadata_transformer = lambda x: []
    if args.use_tls:
        if args.use_test_ca:
            root_certificates = resources.test_root_certificates()
        else:
            root_certificates = resources.prod_root_certificates()

        stub = implementations.stub(
            methods.SERVICE_NAME,
            methods.CLIENT_METHODS,
            args.server_host,
            args.server_port,
            metadata_transformer=metadata_transformer,
            secure=True,
            root_certificates=root_certificates,
            server_host_override=args.server_host_override)
    else:
        stub = implementations.stub(methods.SERVICE_NAME,
                                    methods.CLIENT_METHODS,
                                    args.server_host,
                                    args.server_port,
                                    secure=False)
    return stub
Пример #2
0
def _stub(args):
    if args.oauth_scope:
        metadata_transformer = lambda x: [("Authorization", "Bearer %s" % _oauth_access_token(args))]
    else:
        metadata_transformer = lambda x: []
    if args.use_tls:
        if args.use_test_ca:
            root_certificates = resources.test_root_certificates()
        else:
            root_certificates = resources.prod_root_certificates()

        stub = implementations.stub(
            methods.SERVICE_NAME,
            methods.CLIENT_METHODS,
            args.server_host,
            args.server_port,
            metadata_transformer=metadata_transformer,
            secure=True,
            root_certificates=root_certificates,
            server_host_override=args.server_host_override,
        )
    else:
        stub = implementations.stub(
            methods.SERVICE_NAME, methods.CLIENT_METHODS, args.server_host, args.server_port, secure=False
        )
    return stub
Пример #3
0
def _stub(args):
  if args.oauth_scope:
    if args.test_case == 'oauth2_auth_token':
      # TODO(jtattermusch): This testcase sets the auth metadata key-value
      # manually, which also means that the user would need to do the same
      # thing every time he/she would like to use and out of band oauth token.
      # The transformer function that produces the metadata key-value from
      # the access token should be provided by gRPC auth library.
      access_token = _oauth_access_token(args)
      metadata_transformer = lambda x: [
          ('authorization', 'Bearer %s' % access_token)]
    else:
      metadata_transformer = lambda x: [
          ('authorization', 'Bearer %s' % _oauth_access_token(args))]
  else:
    metadata_transformer = lambda x: []
  if args.use_tls:
    if args.use_test_ca:
      root_certificates = resources.test_root_certificates()
    else:
      root_certificates = resources.prod_root_certificates()

    stub = implementations.stub(
        methods.SERVICE_NAME, methods.CLIENT_METHODS, args.server_host,
        args.server_port, metadata_transformer=metadata_transformer,
        secure=True, root_certificates=root_certificates,
        server_host_override=args.server_host_override)
  else:
    stub = implementations.stub(
        methods.SERVICE_NAME, methods.CLIENT_METHODS, args.server_host,
        args.server_port, secure=False)
  return stub
Пример #4
0
def early_adopter_create_Greeter_stub(
    host,
    port,
    metadata_transformer=None,
    secure=False,
    root_certificates=None,
    private_key=None,
    certificate_chain=None,
    server_host_override=None,
):
    import helloworld_pb2
    import helloworld_pb2

    method_invocation_descriptions = {
        "SayHello": alpha_utilities.unary_unary_invocation_description(
            helloworld_pb2.HelloRequest.SerializeToString, helloworld_pb2.HelloReply.FromString
        )
    }
    return early_adopter_implementations.stub(
        "helloworld.Greeter",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override,
    )
Пример #5
0
def early_adopter_create_RpcCount_stub(host,
                                       port,
                                       metadata_transformer=None,
                                       secure=False,
                                       root_certificates=None,
                                       private_key=None,
                                       certificate_chain=None,
                                       server_host_override=None):
    import count_pb2
    import count_pb2
    import count_pb2
    import count_pb2
    method_invocation_descriptions = {
        "GetCount":
        alpha_utilities.unary_unary_invocation_description(
            count_pb2.GetCountReq.SerializeToString,
            count_pb2.GetCountRsp.FromString,
        ),
        "SetCount":
        alpha_utilities.unary_unary_invocation_description(
            count_pb2.SetCountReq.SerializeToString,
            count_pb2.SetCountRsp.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "Proto.RpcCount",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #6
0
def early_adopter_create_Greeter_stub(host,
                                      port,
                                      metadata_transformer=None,
                                      secure=False,
                                      root_certificates=None,
                                      private_key=None,
                                      certificate_chain=None,
                                      server_host_override=None):
    import helloworld_pb2
    import helloworld_pb2
    method_invocation_descriptions = {
        "SayHello":
        alpha_utilities.unary_unary_invocation_description(
            helloworld_pb2.HelloRequest.SerializeToString,
            helloworld_pb2.HelloReply.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "helloworld.Greeter",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #7
0
def _stub(args):
  if args.use_tls:
    if args.use_test_ca:
      root_certificates = resources.test_root_certificates()
    else:
      root_certificates = resources.prod_root_certificates()

    stub = implementations.stub(
        methods.SERVICE_NAME, methods.CLIENT_METHODS, args.server_host,
        args.server_port, secure=True, root_certificates=root_certificates,
        server_host_override=args.server_host_override)
  else:
    stub = implementations.stub(
        methods.SERVICE_NAME, methods.CLIENT_METHODS, args.server_host,
        args.server_port, secure=False)
  return stub
def early_adopter_create_RPCSeqAllocDispatcher_stub(host,
                                                    port,
                                                    metadata_transformer=None,
                                                    secure=False,
                                                    root_certificates=None,
                                                    private_key=None,
                                                    certificate_chain=None,
                                                    server_host_override=None):
    import seq_alloc_dispatcher_pb2
    import seq_alloc_dispatcher_pb2
    import seq_alloc_dispatcher_pb2
    import seq_alloc_dispatcher_pb2
    method_invocation_descriptions = {
        "DispatchCurSeqAlloc":
        alpha_utilities.unary_unary_invocation_description(
            seq_alloc_dispatcher_pb2.DispatchCurSeqAllocReq.SerializeToString,
            seq_alloc_dispatcher_pb2.DispatchCurSeqAllocRsp.FromString,
        ),
        "DispatchNewSeqAlloc":
        alpha_utilities.unary_unary_invocation_description(
            seq_alloc_dispatcher_pb2.DispatchNewSeqAllocReq.SerializeToString,
            seq_alloc_dispatcher_pb2.DispatchNewSeqAllocRsp.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "Proto.RPCSeqAllocDispatcher",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #9
0
def early_adopter_create_Vtworker_stub(host,
                                       port,
                                       metadata_transformer=None,
                                       secure=False,
                                       root_certificates=None,
                                       private_key=None,
                                       certificate_chain=None,
                                       server_host_override=None):
    import vtworkerdata_pb2
    import vtworkerdata_pb2
    method_invocation_descriptions = {
        "ExecuteVtworkerCommand":
        utilities.unary_stream_invocation_description(
            vtworkerdata_pb2.ExecuteVtworkerCommandRequest.SerializeToString,
            vtworkerdata_pb2.ExecuteVtworkerCommandResponse.FromString,
        ),
    }
    return implementations.stub("vtworkerservice.Vtworker",
                                method_invocation_descriptions,
                                host,
                                port,
                                metadata_transformer=metadata_transformer,
                                secure=secure,
                                root_certificates=root_certificates,
                                private_key=private_key,
                                certificate_chain=certificate_chain,
                                server_host_override=server_host_override)
Пример #10
0
def early_adopter_create_JobsService_stub(host,
                                          port,
                                          metadata_transformer=None,
                                          secure=False,
                                          root_certificates=None,
                                          private_key=None,
                                          certificate_chain=None,
                                          server_host_override=None):
    import jobs_pb2
    method_invocation_descriptions = {
        "GetCount":
        alpha_utilities.unary_unary_invocation_description(
            jobs_pb2.Void.SerializeToString,
            jobs_pb2.Int.FromString,
        ),
        "GetJobs":
        alpha_utilities.unary_stream_invocation_description(
            jobs_pb2.SearchOptions.SerializeToString,
            jobs_pb2.JobInfo.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "jobs.JobsService",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #11
0
def early_adopter_create_Vtctl_stub(
    host,
    port,
    metadata_transformer=None,
    secure=False,
    root_certificates=None,
    private_key=None,
    certificate_chain=None,
    server_host_override=None,
):
    import vtctldata_pb2
    import vtctldata_pb2

    method_invocation_descriptions = {
        "ExecuteVtctlCommand": alpha_utilities.unary_stream_invocation_description(
            vtctldata_pb2.ExecuteVtctlCommandRequest.SerializeToString,
            vtctldata_pb2.ExecuteVtctlCommandResponse.FromString,
        )
    }
    return early_adopter_implementations.stub(
        "vtctlservice.Vtctl",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override,
    )
Пример #12
0
def early_adopter_create_QrLink_stub(host,
                                     port,
                                     metadata_transformer=None,
                                     secure=False,
                                     root_certificates=None,
                                     private_key=None,
                                     certificate_chain=None,
                                     server_host_override=None):
    import qrlink_pb2
    import qrlink_pb2
    import qrlink_pb2
    import qrlink_pb2
    method_invocation_descriptions = {
        "GetTempQrLink":
        utilities.unary_unary_invocation_description(
            qrlink_pb2.QrLinkRequest.SerializeToString,
            qrlink_pb2.QrLinkReply.FromString,
        ),
        "GetlimitQrLink":
        utilities.unary_unary_invocation_description(
            qrlink_pb2.QrLinkRequest.SerializeToString,
            qrlink_pb2.QrLinkReply.FromString,
        ),
    }
    return implementations.stub("QrLink",
                                method_invocation_descriptions,
                                host,
                                port,
                                metadata_transformer=metadata_transformer,
                                secure=secure,
                                root_certificates=root_certificates,
                                private_key=private_key,
                                certificate_chain=certificate_chain,
                                server_host_override=server_host_override)
Пример #13
0
def early_adopter_create_CampaignManager_stub(host,
                                              port,
                                              metadata_transformer=None,
                                              secure=False,
                                              root_certificates=None,
                                              private_key=None,
                                              certificate_chain=None,
                                              server_host_override=None):
    import consultation_pb2
    import consultation_pb2
    method_invocation_descriptions = {
        "Retort":
        alpha_utilities.unary_unary_invocation_description(
            consultation_pb2.RetortRequest.SerializeToString,
            consultation_pb2.RetortReply.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "consultation.CampaignManager",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #14
0
def early_adopter_create_Automation_stub(host,
                                         port,
                                         metadata_transformer=None,
                                         secure=False,
                                         root_certificates=None,
                                         private_key=None,
                                         certificate_chain=None,
                                         server_host_override=None):
    import automation_pb2
    import automation_pb2
    import automation_pb2
    import automation_pb2
    method_invocation_descriptions = {
        "EnqueueClusterOperation":
        utilities.unary_unary_invocation_description(
            automation_pb2.EnqueueClusterOperationRequest.SerializeToString,
            automation_pb2.EnqueueClusterOperationResponse.FromString,
        ),
        "GetClusterOperationDetails":
        utilities.unary_unary_invocation_description(
            automation_pb2.GetClusterOperationDetailsRequest.SerializeToString,
            automation_pb2.GetClusterOperationDetailsResponse.FromString,
        ),
    }
    return implementations.stub("automationservice.Automation",
                                method_invocation_descriptions,
                                host,
                                port,
                                metadata_transformer=metadata_transformer,
                                secure=secure,
                                root_certificates=root_certificates,
                                private_key=private_key,
                                certificate_chain=certificate_chain,
                                server_host_override=server_host_override)
Пример #15
0
 def setUp(self):
   self.server = implementations.server(
       SERVICE_NAME, _SERVICE_DESCRIPTIONS, 0)
   self.server.start()
   port = self.server.port()
   self.stub = implementations.stub(
       SERVICE_NAME, _INVOCATION_DESCRIPTIONS, 'localhost', port)
Пример #16
0
def early_adopter_create_Authentication_stub(host,
                                             port,
                                             metadata_transformer=None,
                                             secure=False,
                                             root_certificates=None,
                                             private_key=None,
                                             certificate_chain=None,
                                             server_host_override=None):
    import auth_user_pb2
    import auth_user_pb2
    import auth_user_pb2
    import auth_user_pb2
    method_invocation_descriptions = {
        "AuthenticateUser":
        utilities.unary_unary_invocation_description(
            auth_user_pb2.AuthenticateUserRequest.SerializeToString,
            auth_user_pb2.AuthenticateUserReply.FromString,
        ),
        "ConfirmUser":
        utilities.unary_unary_invocation_description(
            auth_user_pb2.ConfirmUserRequest.SerializeToString,
            auth_user_pb2.ConfirmUserReply.FromString,
        ),
    }
    return implementations.stub("grpc.testing.Authentication",
                                method_invocation_descriptions,
                                host,
                                port,
                                metadata_transformer=metadata_transformer,
                                secure=secure,
                                root_certificates=root_certificates,
                                private_key=private_key,
                                certificate_chain=certificate_chain,
                                server_host_override=server_host_override)
Пример #17
0
def early_adopter_create_RouteGuide_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import route_guide_pb2
  import route_guide_pb2
  import route_guide_pb2
  import route_guide_pb2
  import route_guide_pb2
  import route_guide_pb2
  import route_guide_pb2
  import route_guide_pb2
  method_invocation_descriptions = {
    "GetFeature": alpha_utilities.unary_unary_invocation_description(
      route_guide_pb2.Point.SerializeToString,
      route_guide_pb2.Feature.FromString,
    ),
    "ListFeatures": alpha_utilities.unary_stream_invocation_description(
      route_guide_pb2.Rectangle.SerializeToString,
      route_guide_pb2.Feature.FromString,
    ),
    "RecordRoute": alpha_utilities.stream_unary_invocation_description(
      route_guide_pb2.Point.SerializeToString,
      route_guide_pb2.RouteSummary.FromString,
    ),
    "RouteChat": alpha_utilities.stream_stream_invocation_description(
      route_guide_pb2.RouteNote.SerializeToString,
      route_guide_pb2.RouteNote.FromString,
    ),
  }
  return early_adopter_implementations.stub("routeguide.RouteGuide", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
def early_adopter_create_Operations_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import google.longrunning.operations_pb2
  import google.longrunning.operations_pb2
  import google.longrunning.operations_pb2
  import google.longrunning.operations_pb2
  import google.longrunning.operations_pb2
  import google.protobuf.empty_pb2
  import google.longrunning.operations_pb2
  import google.protobuf.empty_pb2
  method_invocation_descriptions = {
    "CancelOperation": alpha_utilities.unary_unary_invocation_description(
      google.longrunning.operations_pb2.CancelOperationRequest.SerializeToString,
      google.protobuf.empty_pb2.Empty.FromString,
    ),
    "DeleteOperation": alpha_utilities.unary_unary_invocation_description(
      google.longrunning.operations_pb2.DeleteOperationRequest.SerializeToString,
      google.protobuf.empty_pb2.Empty.FromString,
    ),
    "GetOperation": alpha_utilities.unary_unary_invocation_description(
      google.longrunning.operations_pb2.GetOperationRequest.SerializeToString,
      google.longrunning.operations_pb2.Operation.FromString,
    ),
    "ListOperations": alpha_utilities.unary_unary_invocation_description(
      google.longrunning.operations_pb2.ListOperationsRequest.SerializeToString,
      google.longrunning.operations_pb2.ListOperationsResponse.FromString,
    ),
  }
  return early_adopter_implementations.stub("google.longrunning.Operations", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #19
0
def early_adopter_create_Candidate_stub(host,
                                        port,
                                        metadata_transformer=None,
                                        secure=False,
                                        root_certificates=None,
                                        private_key=None,
                                        certificate_chain=None,
                                        server_host_override=None):
    import debate_pb2
    import debate_pb2
    import debate_pb2
    import debate_pb2
    method_invocation_descriptions = {
        "Answer":
        alpha_utilities.unary_unary_invocation_description(
            debate_pb2.AnswerRequest.SerializeToString,
            debate_pb2.AnswerReply.FromString,
        ),
        "Elaborate":
        alpha_utilities.unary_unary_invocation_description(
            debate_pb2.ElaborateRequest.SerializeToString,
            debate_pb2.ElaborateReply.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "debate.Candidate",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #20
0
 def setUp(self):
   self.server = implementations.server(
       methods.SERVICE_NAME, methods.SERVER_METHODS, 0)
   self.server.start()
   port = self.server.port()
   self.stub = implementations.stub(
       methods.SERVICE_NAME, methods.CLIENT_METHODS, 'localhost', port)
def early_adopter_create_BigtableService_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import gcloud.bigtable._generated.bigtable_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_service_messages_pb2
  import google.protobuf.empty_pb2
  import gcloud.bigtable._generated.bigtable_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_data_pb2
  method_invocation_descriptions = {
    "CheckAndMutateRow": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_service_messages_pb2.CheckAndMutateRowRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_service_messages_pb2.CheckAndMutateRowResponse.FromString,
    ),
    "MutateRow": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_service_messages_pb2.MutateRowRequest.SerializeToString,
      google.protobuf.empty_pb2.Empty.FromString,
    ),
    "ReadModifyWriteRow": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_service_messages_pb2.ReadModifyWriteRowRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_data_pb2.Row.FromString,
    ),
    "ReadRows": alpha_utilities.unary_stream_invocation_description(
      gcloud.bigtable._generated.bigtable_service_messages_pb2.ReadRowsRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_service_messages_pb2.ReadRowsResponse.FromString,
    ),
    "SampleRowKeys": alpha_utilities.unary_stream_invocation_description(
      gcloud.bigtable._generated.bigtable_service_messages_pb2.SampleRowKeysRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_service_messages_pb2.SampleRowKeysResponse.FromString,
    ),
  }
  return early_adopter_implementations.stub("google.bigtable.v1.BigtableService", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #22
0
def early_adopter_create_ContentCmdHandler_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import content_pb2
  import content_pb2
  import base_pb2
  import content_pb2
  import base_pb2
  import content_pb2
  import content_pb2
  import content_pb2
  method_invocation_descriptions = {
    "remove": utilities.unary_unary_invocation_description(
      base_pb2.Uuid.SerializeToString,
      content_pb2.CmdResponse.FromString,
    ),
    "removePart": utilities.unary_unary_invocation_description(
      base_pb2.Uuid.SerializeToString,
      content_pb2.CmdResponse.FromString,
    ),
    "save": utilities.unary_unary_invocation_description(
      content_pb2.Content.SerializeToString,
      content_pb2.CmdResponse.FromString,
    ),
    "updatePart": utilities.unary_unary_invocation_description(
      content_pb2.UpdatePart.SerializeToString,
      content_pb2.CmdResponse.FromString,
    ),
  }
  return implementations.stub("content.ContentCmdHandler", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #23
0
def early_adopter_create_EventStore_stub(host,
                                         port,
                                         metadata_transformer=None,
                                         secure=False,
                                         root_certificates=None,
                                         private_key=None,
                                         certificate_chain=None,
                                         server_host_override=None):
    import base_pb2
    import event_store_pb2
    method_invocation_descriptions = {
        "get":
        utilities.unary_unary_invocation_description(
            base_pb2.Uuid.SerializeToString,
            event_store_pb2.EventStream.FromString,
        ),
    }
    return implementations.stub("event.EventStore",
                                method_invocation_descriptions,
                                host,
                                port,
                                metadata_transformer=metadata_transformer,
                                secure=secure,
                                root_certificates=root_certificates,
                                private_key=private_key,
                                certificate_chain=certificate_chain,
                                server_host_override=server_host_override)
def early_adopter_create_MnistService_stub(host,
                                           port,
                                           metadata_transformer=None,
                                           secure=False,
                                           root_certificates=None,
                                           private_key=None,
                                           certificate_chain=None,
                                           server_host_override=None):
    import mnist_inference_pb2
    import mnist_inference_pb2
    method_invocation_descriptions = {
        "Classify":
        alpha_utilities.unary_unary_invocation_description(
            mnist_inference_pb2.MnistRequest.SerializeToString,
            mnist_inference_pb2.MnistResponse.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "tensorflow.serving.MnistService",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #25
0
 def setUp(self):
     self.server = implementations.server(SERVICE_NAME,
                                          _SERVICE_DESCRIPTIONS, 0)
     self.server.start()
     port = self.server.port()
     self.stub = implementations.stub(SERVICE_NAME,
                                      _INVOCATION_DESCRIPTIONS, 'localhost',
                                      port)
Пример #26
0
def early_adopter_create_Query_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  import query_pb2
  method_invocation_descriptions = {
    "Begin": alpha_utilities.unary_unary_invocation_description(
      query_pb2.BeginRequest.SerializeToString,
      query_pb2.BeginResponse.FromString,
    ),
    "Commit": alpha_utilities.unary_unary_invocation_description(
      query_pb2.CommitRequest.SerializeToString,
      query_pb2.CommitResponse.FromString,
    ),
    "Execute": alpha_utilities.unary_unary_invocation_description(
      query_pb2.ExecuteRequest.SerializeToString,
      query_pb2.ExecuteResponse.FromString,
    ),
    "ExecuteBatch": alpha_utilities.unary_unary_invocation_description(
      query_pb2.ExecuteBatchRequest.SerializeToString,
      query_pb2.ExecuteBatchResponse.FromString,
    ),
    "GetSessionId": alpha_utilities.unary_unary_invocation_description(
      query_pb2.GetSessionIdRequest.SerializeToString,
      query_pb2.GetSessionIdResponse.FromString,
    ),
    "Rollback": alpha_utilities.unary_unary_invocation_description(
      query_pb2.RollbackRequest.SerializeToString,
      query_pb2.RollbackResponse.FromString,
    ),
    "SplitQuery": alpha_utilities.unary_unary_invocation_description(
      query_pb2.SplitQueryRequest.SerializeToString,
      query_pb2.SplitQueryResponse.FromString,
    ),
    "StreamExecute": alpha_utilities.unary_stream_invocation_description(
      query_pb2.StreamExecuteRequest.SerializeToString,
      query_pb2.StreamExecuteResponse.FromString,
    ),
    "StreamHealth": alpha_utilities.unary_stream_invocation_description(
      query_pb2.StreamHealthRequest.SerializeToString,
      query_pb2.StreamHealthResponse.FromString,
    ),
  }
  return early_adopter_implementations.stub("queryservice.Query", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #27
0
def early_adopter_create_Vtctl_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import vtctl_pb2
  import vtctl_pb2
  method_invocation_descriptions = {
    "ExecuteVtctlCommand": utilities.unary_stream_invocation_description(
      vtctl_pb2.ExecuteVtctlCommandArgs.SerializeToString,
      vtctl_pb2.LoggerEvent.FromString,
    ),
  }
  return implementations.stub("vtctl.Vtctl", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #28
0
def early_adopter_create_MnistService_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import mnist_inference_pb2
  import mnist_inference_pb2
  method_invocation_descriptions = {
    "Classify": alpha_utilities.unary_unary_invocation_description(
      mnist_inference_pb2.MnistRequest.SerializeToString,
      mnist_inference_pb2.MnistResponse.FromString,
    ),
  }
  return early_adopter_implementations.stub("tensorflow.serving.MnistService", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
def early_adopter_create_QueryMasterClientProtocolService_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import ClientProtos_pb2
  import ClientProtos_pb2
  method_invocation_descriptions = {
    "getQueryHistory": utilities.unary_unary_invocation_description(
      ClientProtos_pb2.QueryIdRequest.SerializeToString,
      ClientProtos_pb2.GetQueryHistoryResponse.FromString,
    ),
  }
  return implementations.stub("QueryMasterClientProtocolService", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #30
0
def early_adopter_create_EventStore_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import base_pb2
  import event_store_pb2
  method_invocation_descriptions = {
    "get": utilities.unary_unary_invocation_description(
      base_pb2.Uuid.SerializeToString,
      event_store_pb2.EventStream.FromString,
    ),
  }
  return implementations.stub("event.EventStore", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #31
0
def early_adopter_create_CampaignManager_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import consultation_pb2
  import consultation_pb2
  method_invocation_descriptions = {
    "Retort": alpha_utilities.unary_unary_invocation_description(
      consultation_pb2.RetortRequest.SerializeToString,
      consultation_pb2.RetortReply.FromString,
    ),
  }
  return early_adopter_implementations.stub("consultation.CampaignManager", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #32
0
 def setUp(self):
   self.server = implementations.server(
       methods.SERVICE_NAME, methods.SERVER_METHODS, 0,
       private_key=resources.private_key(),
       certificate_chain=resources.certificate_chain())
   self.server.start()
   port = self.server.port()
   self.stub = implementations.stub(
       methods.SERVICE_NAME, methods.CLIENT_METHODS, 'localhost', port,
       secure=True, root_certificates=resources.test_root_certificates(),
       server_host_override=_SERVER_HOST_OVERRIDE)
def early_adopter_create_BigtableTableService_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import gcloud.bigtable._generated.bigtable_table_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_table_data_pb2
  import gcloud.bigtable._generated.bigtable_table_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_table_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_table_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_table_data_pb2
  import gcloud.bigtable._generated.bigtable_table_service_messages_pb2
  import google.protobuf.empty_pb2
  import gcloud.bigtable._generated.bigtable_table_service_messages_pb2
  import google.protobuf.empty_pb2
  import gcloud.bigtable._generated.bigtable_table_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_table_data_pb2
  import gcloud.bigtable._generated.bigtable_table_data_pb2
  import gcloud.bigtable._generated.bigtable_table_data_pb2
  import gcloud.bigtable._generated.bigtable_table_service_messages_pb2
  import google.protobuf.empty_pb2
  method_invocation_descriptions = {
    "CreateColumnFamily": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_table_service_messages_pb2.CreateColumnFamilyRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_table_data_pb2.ColumnFamily.FromString,
    ),
    "CreateTable": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_table_service_messages_pb2.CreateTableRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_table_data_pb2.Table.FromString,
    ),
    "DeleteColumnFamily": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_table_service_messages_pb2.DeleteColumnFamilyRequest.SerializeToString,
      google.protobuf.empty_pb2.Empty.FromString,
    ),
    "DeleteTable": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_table_service_messages_pb2.DeleteTableRequest.SerializeToString,
      google.protobuf.empty_pb2.Empty.FromString,
    ),
    "GetTable": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_table_service_messages_pb2.GetTableRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_table_data_pb2.Table.FromString,
    ),
    "ListTables": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_table_service_messages_pb2.ListTablesRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_table_service_messages_pb2.ListTablesResponse.FromString,
    ),
    "RenameTable": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_table_service_messages_pb2.RenameTableRequest.SerializeToString,
      google.protobuf.empty_pb2.Empty.FromString,
    ),
    "UpdateColumnFamily": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_table_data_pb2.ColumnFamily.SerializeToString,
      gcloud.bigtable._generated.bigtable_table_data_pb2.ColumnFamily.FromString,
    ),
  }
  return early_adopter_implementations.stub("google.bigtable.admin.table.v1.BigtableTableService", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #34
0
def _stub(args):
    if args.use_tls:
        if args.use_test_ca:
            root_certificates = resources.test_root_certificates()
        else:
            root_certificates = resources.prod_root_certificates()

        stub = implementations.stub(
            methods.SERVICE_NAME,
            methods.CLIENT_METHODS,
            args.server_host,
            args.server_port,
            secure=True,
            root_certificates=root_certificates,
            server_host_override=args.server_host_override)
    else:
        stub = implementations.stub(methods.SERVICE_NAME,
                                    methods.CLIENT_METHODS,
                                    args.server_host,
                                    args.server_port,
                                    secure=False)
    return stub
Пример #35
0
def early_adopter_create_RpcLuckyCard_stub(host,
                                           port,
                                           metadata_transformer=None,
                                           secure=False,
                                           root_certificates=None,
                                           private_key=None,
                                           certificate_chain=None,
                                           server_host_override=None):
    import base_pb2
    import base_pb2
    import lucky_card_pb2
    import lucky_card_pb2
    import lucky_card_pb2
    import lucky_card_pb2
    import lucky_card_pb2
    import lucky_card_pb2
    method_invocation_descriptions = {
        "Echo":
        alpha_utilities.unary_unary_invocation_description(
            base_pb2.EchoReq.SerializeToString,
            base_pb2.EchoRsp.FromString,
        ),
        "FetchCard":
        alpha_utilities.unary_unary_invocation_description(
            lucky_card_pb2.FetchCardReq.SerializeToString,
            lucky_card_pb2.FetchCardRsp.FromString,
        ),
        "H5GetCard":
        alpha_utilities.unary_unary_invocation_description(
            lucky_card_pb2.H5GetCardReq.SerializeToString,
            lucky_card_pb2.H5GetCardRsp.FromString,
        ),
        "OpenCard":
        alpha_utilities.unary_unary_invocation_description(
            lucky_card_pb2.OpenCardReq.SerializeToString,
            lucky_card_pb2.OpenCardRsp.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "Proto.RpcLuckyCard",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #36
0
def early_adopter_create_RouteGuide_stub(host,
                                         port,
                                         metadata_transformer=None,
                                         secure=False,
                                         root_certificates=None,
                                         private_key=None,
                                         certificate_chain=None,
                                         server_host_override=None):
    import route_guide_pb2
    import route_guide_pb2
    import route_guide_pb2
    import route_guide_pb2
    import route_guide_pb2
    import route_guide_pb2
    import route_guide_pb2
    import route_guide_pb2
    method_invocation_descriptions = {
        "GetFeature":
        alpha_utilities.unary_unary_invocation_description(
            route_guide_pb2.Point.SerializeToString,
            route_guide_pb2.Feature.FromString,
        ),
        "ListFeatures":
        alpha_utilities.unary_stream_invocation_description(
            route_guide_pb2.Rectangle.SerializeToString,
            route_guide_pb2.Feature.FromString,
        ),
        "RecordRoute":
        alpha_utilities.stream_unary_invocation_description(
            route_guide_pb2.Point.SerializeToString,
            route_guide_pb2.RouteSummary.FromString,
        ),
        "RouteChat":
        alpha_utilities.stream_stream_invocation_description(
            route_guide_pb2.RouteNote.SerializeToString,
            route_guide_pb2.RouteNote.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "routeguide.RouteGuide",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #37
0
def early_adopter_create_ContentCmdHandler_stub(host,
                                                port,
                                                metadata_transformer=None,
                                                secure=False,
                                                root_certificates=None,
                                                private_key=None,
                                                certificate_chain=None,
                                                server_host_override=None):
    import content_pb2
    import content_pb2
    import base_pb2
    import content_pb2
    import base_pb2
    import content_pb2
    import content_pb2
    import content_pb2
    method_invocation_descriptions = {
        "remove":
        utilities.unary_unary_invocation_description(
            base_pb2.Uuid.SerializeToString,
            content_pb2.CmdResponse.FromString,
        ),
        "removePart":
        utilities.unary_unary_invocation_description(
            base_pb2.Uuid.SerializeToString,
            content_pb2.CmdResponse.FromString,
        ),
        "save":
        utilities.unary_unary_invocation_description(
            content_pb2.Content.SerializeToString,
            content_pb2.CmdResponse.FromString,
        ),
        "updatePart":
        utilities.unary_unary_invocation_description(
            content_pb2.UpdatePart.SerializeToString,
            content_pb2.CmdResponse.FromString,
        ),
    }
    return implementations.stub("content.ContentCmdHandler",
                                method_invocation_descriptions,
                                host,
                                port,
                                metadata_transformer=metadata_transformer,
                                secure=secure,
                                root_certificates=root_certificates,
                                private_key=private_key,
                                certificate_chain=certificate_chain,
                                server_host_override=server_host_override)
Пример #38
0
def early_adopter_create_Search_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import search_pb2
  import search_pb2
  import search_pb2
  import search_pb2
  method_invocation_descriptions = {
    "Index": alpha_utilities.unary_unary_invocation_description(
      search_pb2.IndexRequest.SerializeToString,
      search_pb2.IndexReply.FromString,
    ),
    "Search": alpha_utilities.unary_unary_invocation_description(
      search_pb2.SearchRequest.SerializeToString,
      search_pb2.SearchReply.FromString,
    ),
  }
  return early_adopter_implementations.stub("search.Search", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #39
0
def early_adopter_create_Candidate_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import debate_pb2
  import debate_pb2
  import debate_pb2
  import debate_pb2
  method_invocation_descriptions = {
    "Answer": alpha_utilities.unary_unary_invocation_description(
      debate_pb2.AnswerRequest.SerializeToString,
      debate_pb2.AnswerReply.FromString,
    ),
    "Elaborate": alpha_utilities.unary_unary_invocation_description(
      debate_pb2.ElaborateRequest.SerializeToString,
      debate_pb2.ElaborateReply.FromString,
    ),
  }
  return early_adopter_implementations.stub("debate.Candidate", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #40
0
def early_adopter_create_DataNode_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import datanode_pb2
  import datanode_pb2
  import datanode_pb2
  import datanode_pb2
  method_invocation_descriptions = {
    "Read": alpha_utilities.unary_unary_invocation_description(
      datanode_pb2.ReadRequest.SerializeToString,
      datanode_pb2.ReadReply.FromString,
    ),
    "Store": alpha_utilities.unary_unary_invocation_description(
      datanode_pb2.StoreRequest.SerializeToString,
      datanode_pb2.StoreReply.FromString,
    ),
  }
  return early_adopter_implementations.stub("DataNode", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #41
0
def early_adopter_create_Automation_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import automation_pb2
  import automation_pb2
  import automation_pb2
  import automation_pb2
  method_invocation_descriptions = {
    "EnqueueClusterOperation": alpha_utilities.unary_unary_invocation_description(
      automation_pb2.EnqueueClusterOperationRequest.SerializeToString,
      automation_pb2.EnqueueClusterOperationResponse.FromString,
    ),
    "GetClusterOperationDetails": alpha_utilities.unary_unary_invocation_description(
      automation_pb2.GetClusterOperationDetailsRequest.SerializeToString,
      automation_pb2.GetClusterOperationDetailsResponse.FromString,
    ),
  }
  return early_adopter_implementations.stub("automationservice.Automation", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #42
0
def early_adopter_create_EncoderDecoder_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import playcloud_pb2
  import playcloud_pb2
  import playcloud_pb2
  import playcloud_pb2
  method_invocation_descriptions = {
    "Decode": alpha_utilities.unary_unary_invocation_description(
      playcloud_pb2.DecodeRequest.SerializeToString,
      playcloud_pb2.DecodeReply.FromString,
    ),
    "Encode": alpha_utilities.unary_unary_invocation_description(
      playcloud_pb2.EncodeRequest.SerializeToString,
      playcloud_pb2.EncodeReply.FromString,
    ),
  }
  return early_adopter_implementations.stub("EncoderDecoder", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #43
0
def early_adopter_create_Manager_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import manager_django_pb2
  import manager_django_pb2
  import manager_django_pb2
  import manager_django_pb2
  method_invocation_descriptions = {
    "OpenFile": alpha_utilities.unary_unary_invocation_description(
      manager_django_pb2.OpenRequest.SerializeToString,
      manager_django_pb2.OpenResponse.FromString,
    ),
    "SaveFile": alpha_utilities.unary_unary_invocation_description(
      manager_django_pb2.SaveRequest.SerializeToString,
      manager_django_pb2.SaveResponse.FromString,
    ),
  }
  return early_adopter_implementations.stub("consultation.Manager", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #44
0
def early_adopter_create_Authentication_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import auth_user_pb2
  import auth_user_pb2
  import auth_user_pb2
  import auth_user_pb2
  method_invocation_descriptions = {
    "AuthenticateUser": utilities.unary_unary_invocation_description(
      auth_user_pb2.AuthenticateUserRequest.SerializeToString,
      auth_user_pb2.AuthenticateUserReply.FromString,
    ),
    "ConfirmUser": utilities.unary_unary_invocation_description(
      auth_user_pb2.ConfirmUserRequest.SerializeToString,
      auth_user_pb2.ConfirmUserReply.FromString,
    ),
  }
  return implementations.stub("grpc.testing.Authentication", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #45
0
 def setUp(self):
     self.server = implementations.server(
         methods.SERVICE_NAME,
         methods.SERVER_METHODS,
         0,
         private_key=resources.private_key(),
         certificate_chain=resources.certificate_chain())
     self.server.start()
     port = self.server.port()
     self.stub = implementations.stub(
         methods.SERVICE_NAME,
         methods.CLIENT_METHODS,
         'localhost',
         port,
         secure=True,
         root_certificates=resources.test_root_certificates(),
         server_host_override=_SERVER_HOST_OVERRIDE)
def early_adopter_create_BigtableClusterService_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_cluster_data_pb2
  import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2
  import gcloud.bigtable._generated.bigtable_cluster_data_pb2
  import gcloud.bigtable._generated.bigtable_cluster_data_pb2
  import gcloud.bigtable._generated.bigtable_cluster_data_pb2
  import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2
  import google.protobuf.empty_pb2
  import gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2
  import google.longrunning.operations_pb2
  method_invocation_descriptions = {
    "CreateCluster": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.CreateClusterRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.FromString,
    ),
    "DeleteCluster": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.DeleteClusterRequest.SerializeToString,
      google.protobuf.empty_pb2.Empty.FromString,
    ),
    "GetCluster": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.GetClusterRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.FromString,
    ),
    "ListClusters": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListClustersRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListClustersResponse.FromString,
    ),
    "ListZones": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListZonesRequest.SerializeToString,
      gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.ListZonesResponse.FromString,
    ),
    "UndeleteCluster": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_cluster_service_messages_pb2.UndeleteClusterRequest.SerializeToString,
      google.longrunning.operations_pb2.Operation.FromString,
    ),
    "UpdateCluster": alpha_utilities.unary_unary_invocation_description(
      gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.SerializeToString,
      gcloud.bigtable._generated.bigtable_cluster_data_pb2.Cluster.FromString,
    ),
  }
  return early_adopter_implementations.stub("google.bigtable.admin.cluster.v1.BigtableClusterService", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #47
0
def early_adopter_create_JobsService_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None,
                                          private_key=None, certificate_chain=None, server_host_override=None):
    import jobs_pb2
    method_invocation_descriptions = {
        "GetCount": alpha_utilities.unary_unary_invocation_description(
                jobs_pb2.Void.SerializeToString,
                jobs_pb2.Int.FromString,
        ),
        "GetJobs": alpha_utilities.unary_stream_invocation_description(
                jobs_pb2.SearchOptions.SerializeToString,
                jobs_pb2.JobInfo.FromString,
        ),
    }
    return early_adopter_implementations.stub("jobs.JobsService", method_invocation_descriptions, host, port,
                                              metadata_transformer=metadata_transformer, secure=secure,
                                              root_certificates=root_certificates, private_key=private_key,
                                              certificate_chain=certificate_chain,
                                              server_host_override=server_host_override)
Пример #48
0
def early_adopter_create_DataRetrieval_stub(host,
                                            port,
                                            metadata_transformer=None,
                                            secure=False,
                                            root_certificates=None,
                                            private_key=None,
                                            certificate_chain=None,
                                            server_host_override=None):
    import service_pb2
    import service_pb2
    import service_pb2
    import service_pb2
    import service_pb2
    import service_pb2
    method_invocation_descriptions = {
        "GetDeck":
        alpha_utilities.unary_unary_invocation_description(
            service_pb2.DeckRequest.SerializeToString,
            service_pb2.DeckResponse.FromString,
        ),
        "GetDetailedUserDeck":
        alpha_utilities.unary_unary_invocation_description(
            service_pb2.UserDeckRequest.SerializeToString,
            service_pb2.UserDeckResponse.FromString,
        ),
        "GetUserDeck":
        alpha_utilities.unary_unary_invocation_description(
            service_pb2.UserDeckRequest.SerializeToString,
            service_pb2.UserDeckResponse.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "exercise.DataRetrieval",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #49
0
def early_adopter_create_UpdateStream_stub(host,
                                           port,
                                           metadata_transformer=None,
                                           secure=False,
                                           root_certificates=None,
                                           private_key=None,
                                           certificate_chain=None,
                                           server_host_override=None):
    import binlogdata_pb2
    import binlogdata_pb2
    import binlogdata_pb2
    import binlogdata_pb2
    import binlogdata_pb2
    import binlogdata_pb2
    method_invocation_descriptions = {
        "StreamKeyRange":
        alpha_utilities.unary_stream_invocation_description(
            binlogdata_pb2.StreamKeyRangeRequest.SerializeToString,
            binlogdata_pb2.StreamKeyRangeResponse.FromString,
        ),
        "StreamTables":
        alpha_utilities.unary_stream_invocation_description(
            binlogdata_pb2.StreamTablesRequest.SerializeToString,
            binlogdata_pb2.StreamTablesResponse.FromString,
        ),
        "StreamUpdate":
        alpha_utilities.unary_stream_invocation_description(
            binlogdata_pb2.StreamUpdateRequest.SerializeToString,
            binlogdata_pb2.StreamUpdateResponse.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "binlogservice.UpdateStream",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #50
0
def early_adopter_create_MysqlCtl_stub(host,
                                       port,
                                       metadata_transformer=None,
                                       secure=False,
                                       root_certificates=None,
                                       private_key=None,
                                       certificate_chain=None,
                                       server_host_override=None):
    import mysqlctl_pb2
    import mysqlctl_pb2
    import mysqlctl_pb2
    import mysqlctl_pb2
    import mysqlctl_pb2
    import mysqlctl_pb2
    method_invocation_descriptions = {
        "RunMysqlUpgrade":
        alpha_utilities.unary_unary_invocation_description(
            mysqlctl_pb2.RunMysqlUpgradeRequest.SerializeToString,
            mysqlctl_pb2.RunMysqlUpgradeResponse.FromString,
        ),
        "Shutdown":
        alpha_utilities.unary_unary_invocation_description(
            mysqlctl_pb2.ShutdownRequest.SerializeToString,
            mysqlctl_pb2.ShutdownResponse.FromString,
        ),
        "Start":
        alpha_utilities.unary_unary_invocation_description(
            mysqlctl_pb2.StartRequest.SerializeToString,
            mysqlctl_pb2.StartResponse.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "mysqlctl.MysqlCtl",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)
Пример #51
0
def early_adopter_create_PerfDbTransfer_stub(host,
                                             port,
                                             metadata_transformer=None,
                                             secure=False,
                                             root_certificates=None,
                                             private_key=None,
                                             certificate_chain=None,
                                             server_host_override=None):
    import perf_db_pb2
    import perf_db_pb2
    import perf_db_pb2
    import perf_db_pb2
    import perf_db_pb2
    import perf_db_pb2
    method_invocation_descriptions = {
        "RecordSingleClientData":
        utilities.unary_unary_invocation_description(
            perf_db_pb2.SingleUserRecordRequest.SerializeToString,
            perf_db_pb2.SingleUserRecordReply.FromString,
        ),
        "RetrieveAllUsersData":
        utilities.unary_unary_invocation_description(
            perf_db_pb2.AllUsersRetrieveRequest.SerializeToString,
            perf_db_pb2.AllUsersRetrieveReply.FromString,
        ),
        "RetrieveSingleUserData":
        utilities.unary_unary_invocation_description(
            perf_db_pb2.SingleUserRetrieveRequest.SerializeToString,
            perf_db_pb2.SingleUserRetrieveReply.FromString,
        ),
    }
    return implementations.stub("grpc.testing.PerfDbTransfer",
                                method_invocation_descriptions,
                                host,
                                port,
                                metadata_transformer=metadata_transformer,
                                secure=secure,
                                root_certificates=root_certificates,
                                private_key=private_key,
                                certificate_chain=certificate_chain,
                                server_host_override=server_host_override)
Пример #52
0
def early_adopter_create_UpdateStream_stub(
    host,
    port,
    metadata_transformer=None,
    secure=False,
    root_certificates=None,
    private_key=None,
    certificate_chain=None,
    server_host_override=None,
):
    import binlogdata_pb2
    import binlogdata_pb2
    import binlogdata_pb2
    import binlogdata_pb2
    import binlogdata_pb2
    import binlogdata_pb2

    method_invocation_descriptions = {
        "StreamKeyRange": alpha_utilities.unary_stream_invocation_description(
            binlogdata_pb2.StreamKeyRangeRequest.SerializeToString, binlogdata_pb2.StreamKeyRangeResponse.FromString
        ),
        "StreamTables": alpha_utilities.unary_stream_invocation_description(
            binlogdata_pb2.StreamTablesRequest.SerializeToString, binlogdata_pb2.StreamTablesResponse.FromString
        ),
        "StreamUpdate": alpha_utilities.unary_stream_invocation_description(
            binlogdata_pb2.StreamUpdateRequest.SerializeToString, binlogdata_pb2.StreamUpdateResponse.FromString
        ),
    }
    return early_adopter_implementations.stub(
        "binlogservice.UpdateStream",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override,
    )
Пример #53
0
def early_adopter_create_Datastore_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import gcloud.datastore._generated.datastore_pb2
  import gcloud.datastore._generated.datastore_pb2
  import gcloud.datastore._generated.datastore_pb2
  import gcloud.datastore._generated.datastore_pb2
  import gcloud.datastore._generated.datastore_pb2
  import gcloud.datastore._generated.datastore_pb2
  import gcloud.datastore._generated.datastore_pb2
  import gcloud.datastore._generated.datastore_pb2
  import gcloud.datastore._generated.datastore_pb2
  import gcloud.datastore._generated.datastore_pb2
  import gcloud.datastore._generated.datastore_pb2
  import gcloud.datastore._generated.datastore_pb2
  method_invocation_descriptions = {
    "AllocateIds": alpha_utilities.unary_unary_invocation_description(
      gcloud.datastore._generated.datastore_pb2.AllocateIdsRequest.SerializeToString,
      gcloud.datastore._generated.datastore_pb2.AllocateIdsResponse.FromString,
    ),
    "BeginTransaction": alpha_utilities.unary_unary_invocation_description(
      gcloud.datastore._generated.datastore_pb2.BeginTransactionRequest.SerializeToString,
      gcloud.datastore._generated.datastore_pb2.BeginTransactionResponse.FromString,
    ),
    "Commit": alpha_utilities.unary_unary_invocation_description(
      gcloud.datastore._generated.datastore_pb2.CommitRequest.SerializeToString,
      gcloud.datastore._generated.datastore_pb2.CommitResponse.FromString,
    ),
    "Lookup": alpha_utilities.unary_unary_invocation_description(
      gcloud.datastore._generated.datastore_pb2.LookupRequest.SerializeToString,
      gcloud.datastore._generated.datastore_pb2.LookupResponse.FromString,
    ),
    "Rollback": alpha_utilities.unary_unary_invocation_description(
      gcloud.datastore._generated.datastore_pb2.RollbackRequest.SerializeToString,
      gcloud.datastore._generated.datastore_pb2.RollbackResponse.FromString,
    ),
    "RunQuery": alpha_utilities.unary_unary_invocation_description(
      gcloud.datastore._generated.datastore_pb2.RunQueryRequest.SerializeToString,
      gcloud.datastore._generated.datastore_pb2.RunQueryResponse.FromString,
    ),
  }
  return early_adopter_implementations.stub("google.datastore.v1beta3.Datastore", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #54
0
def early_adopter_create_TestService_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import test.cpp.interop.empty_pb2
  import test.cpp.interop.empty_pb2
  import test.cpp.interop.messages_pb2
  import test.cpp.interop.messages_pb2
  import test.cpp.interop.messages_pb2
  import test.cpp.interop.messages_pb2
  import test.cpp.interop.messages_pb2
  import test.cpp.interop.messages_pb2
  import test.cpp.interop.messages_pb2
  import test.cpp.interop.messages_pb2
  import test.cpp.interop.messages_pb2
  import test.cpp.interop.messages_pb2
  method_invocation_descriptions = {
    "EmptyCall": utilities.unary_unary_invocation_description(
      test.cpp.interop.empty_pb2.Empty.SerializeToString,
      test.cpp.interop.empty_pb2.Empty.FromString,
    ),
    "FullDuplexCall": utilities.stream_stream_invocation_description(
      test.cpp.interop.messages_pb2.StreamingOutputCallRequest.SerializeToString,
      test.cpp.interop.messages_pb2.StreamingOutputCallResponse.FromString,
    ),
    "HalfDuplexCall": utilities.stream_stream_invocation_description(
      test.cpp.interop.messages_pb2.StreamingOutputCallRequest.SerializeToString,
      test.cpp.interop.messages_pb2.StreamingOutputCallResponse.FromString,
    ),
    "StreamingInputCall": utilities.stream_unary_invocation_description(
      test.cpp.interop.messages_pb2.StreamingInputCallRequest.SerializeToString,
      test.cpp.interop.messages_pb2.StreamingInputCallResponse.FromString,
    ),
    "StreamingOutputCall": utilities.unary_stream_invocation_description(
      test.cpp.interop.messages_pb2.StreamingOutputCallRequest.SerializeToString,
      test.cpp.interop.messages_pb2.StreamingOutputCallResponse.FromString,
    ),
    "UnaryCall": utilities.unary_unary_invocation_description(
      test.cpp.interop.messages_pb2.SimpleRequest.SerializeToString,
      test.cpp.interop.messages_pb2.SimpleResponse.FromString,
    ),
  }
  return implementations.stub("grpc.testing.TestService", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #55
0
def early_adopter_create_ZfsRpc_stub(host, port, metadata_transformer=None, secure=False, root_certificates=None, private_key=None, certificate_chain=None, server_host_override=None):
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  import zfs_pb2
  method_invocation_descriptions = {
    "CreateFile": alpha_utilities.unary_unary_invocation_description(
      zfs_pb2.FilePath.SerializeToString,
      zfs_pb2.StdReply.FromString,
    ),
    "Fetch": alpha_utilities.unary_stream_invocation_description(
      zfs_pb2.FilePath.SerializeToString,
      zfs_pb2.FileDataBlock.FromString,
    ),
    "FetchDir": alpha_utilities.unary_stream_invocation_description(
      zfs_pb2.FilePath.SerializeToString,
      zfs_pb2.DirListBlock.FromString,
    ),
    "GetFileStat": alpha_utilities.unary_unary_invocation_description(
      zfs_pb2.FilePath.SerializeToString,
      zfs_pb2.FileStat.FromString,
    ),
    "MakeDir": alpha_utilities.unary_unary_invocation_description(
      zfs_pb2.FilePath.SerializeToString,
      zfs_pb2.StdReply.FromString,
    ),
    "RemoveDir": alpha_utilities.unary_unary_invocation_description(
      zfs_pb2.FilePath.SerializeToString,
      zfs_pb2.StdReply.FromString,
    ),
    "RemoveFile": alpha_utilities.unary_unary_invocation_description(
      zfs_pb2.FilePath.SerializeToString,
      zfs_pb2.StdReply.FromString,
    ),
    "Rename": alpha_utilities.unary_unary_invocation_description(
      zfs_pb2.RenameMsg.SerializeToString,
      zfs_pb2.StdReply.FromString,
    ),
    "SetFileStat": alpha_utilities.unary_unary_invocation_description(
      zfs_pb2.FileStat.SerializeToString,
      zfs_pb2.StdReply.FromString,
    ),
    "Store": alpha_utilities.stream_unary_invocation_description(
      zfs_pb2.FileDataBlock.SerializeToString,
      zfs_pb2.StdReply.FromString,
    ),
    "TestAuth": alpha_utilities.unary_unary_invocation_description(
      zfs_pb2.TestAuthRequest.SerializeToString,
      zfs_pb2.TestAuthReply.FromString,
    ),
  }
  return early_adopter_implementations.stub("zfs.ZfsRpc", method_invocation_descriptions, host, port, metadata_transformer=metadata_transformer, secure=secure, root_certificates=root_certificates, private_key=private_key, certificate_chain=certificate_chain, server_host_override=server_host_override)
Пример #56
0
def early_adopter_create_Vitess_stub(host,
                                     port,
                                     metadata_transformer=None,
                                     secure=False,
                                     root_certificates=None,
                                     private_key=None,
                                     certificate_chain=None,
                                     server_host_override=None):
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    import vtgate_pb2
    method_invocation_descriptions = {
        "Begin":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.BeginRequest.SerializeToString,
            vtgate_pb2.BeginResponse.FromString,
        ),
        "Commit":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.CommitRequest.SerializeToString,
            vtgate_pb2.CommitResponse.FromString,
        ),
        "Execute":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.ExecuteRequest.SerializeToString,
            vtgate_pb2.ExecuteResponse.FromString,
        ),
        "ExecuteBatchKeyspaceIds":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.ExecuteBatchKeyspaceIdsRequest.SerializeToString,
            vtgate_pb2.ExecuteBatchKeyspaceIdsResponse.FromString,
        ),
        "ExecuteBatchShards":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.ExecuteBatchShardsRequest.SerializeToString,
            vtgate_pb2.ExecuteBatchShardsResponse.FromString,
        ),
        "ExecuteEntityIds":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.ExecuteEntityIdsRequest.SerializeToString,
            vtgate_pb2.ExecuteEntityIdsResponse.FromString,
        ),
        "ExecuteKeyRanges":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.ExecuteKeyRangesRequest.SerializeToString,
            vtgate_pb2.ExecuteKeyRangesResponse.FromString,
        ),
        "ExecuteKeyspaceIds":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.ExecuteKeyspaceIdsRequest.SerializeToString,
            vtgate_pb2.ExecuteKeyspaceIdsResponse.FromString,
        ),
        "ExecuteShards":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.ExecuteShardsRequest.SerializeToString,
            vtgate_pb2.ExecuteShardsResponse.FromString,
        ),
        "GetSrvKeyspace":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.GetSrvKeyspaceRequest.SerializeToString,
            vtgate_pb2.GetSrvKeyspaceResponse.FromString,
        ),
        "Rollback":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.RollbackRequest.SerializeToString,
            vtgate_pb2.RollbackResponse.FromString,
        ),
        "SplitQuery":
        alpha_utilities.unary_unary_invocation_description(
            vtgate_pb2.SplitQueryRequest.SerializeToString,
            vtgate_pb2.SplitQueryResponse.FromString,
        ),
        "StreamExecute":
        alpha_utilities.unary_stream_invocation_description(
            vtgate_pb2.StreamExecuteRequest.SerializeToString,
            vtgate_pb2.StreamExecuteResponse.FromString,
        ),
        "StreamExecuteKeyRanges":
        alpha_utilities.unary_stream_invocation_description(
            vtgate_pb2.StreamExecuteKeyRangesRequest.SerializeToString,
            vtgate_pb2.StreamExecuteKeyRangesResponse.FromString,
        ),
        "StreamExecuteKeyspaceIds":
        alpha_utilities.unary_stream_invocation_description(
            vtgate_pb2.StreamExecuteKeyspaceIdsRequest.SerializeToString,
            vtgate_pb2.StreamExecuteKeyspaceIdsResponse.FromString,
        ),
        "StreamExecuteShards":
        alpha_utilities.unary_stream_invocation_description(
            vtgate_pb2.StreamExecuteShardsRequest.SerializeToString,
            vtgate_pb2.StreamExecuteShardsResponse.FromString,
        ),
    }
    return early_adopter_implementations.stub(
        "vtgateservice.Vitess",
        method_invocation_descriptions,
        host,
        port,
        metadata_transformer=metadata_transformer,
        secure=secure,
        root_certificates=root_certificates,
        private_key=private_key,
        certificate_chain=certificate_chain,
        server_host_override=server_host_override)