Repository URL to install this package:
|
Version:
4.1.0 ▾
|
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from bosdyn.api import lease_pb2 as bosdyn_dot_api_dot_lease__pb2
class LeaseServiceStub(object):
"""LeaseService provides Leases of shared resources to clients.
An example of a shared resource is the set of leg motors on Spot, which
has the resource name of "body".
Clients can delegate out the Leases they receive from the LeaseService
to additional clients or services by generating sub-leases.
Leases obtained from the LeaseService may be revoked if the Lease holder
does not check in frequently to the LeaseService, or if another client
force-acquires a Lease.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.AcquireLease = channel.unary_unary(
'/bosdyn.api.LeaseService/AcquireLease',
request_serializer=bosdyn_dot_api_dot_lease__pb2.AcquireLeaseRequest.SerializeToString,
response_deserializer=bosdyn_dot_api_dot_lease__pb2.AcquireLeaseResponse.FromString,
)
self.TakeLease = channel.unary_unary(
'/bosdyn.api.LeaseService/TakeLease',
request_serializer=bosdyn_dot_api_dot_lease__pb2.TakeLeaseRequest.SerializeToString,
response_deserializer=bosdyn_dot_api_dot_lease__pb2.TakeLeaseResponse.FromString,
)
self.ReturnLease = channel.unary_unary(
'/bosdyn.api.LeaseService/ReturnLease',
request_serializer=bosdyn_dot_api_dot_lease__pb2.ReturnLeaseRequest.SerializeToString,
response_deserializer=bosdyn_dot_api_dot_lease__pb2.ReturnLeaseResponse.FromString,
)
self.ListLeases = channel.unary_unary(
'/bosdyn.api.LeaseService/ListLeases',
request_serializer=bosdyn_dot_api_dot_lease__pb2.ListLeasesRequest.SerializeToString,
response_deserializer=bosdyn_dot_api_dot_lease__pb2.ListLeasesResponse.FromString,
)
self.RetainLease = channel.unary_unary(
'/bosdyn.api.LeaseService/RetainLease',
request_serializer=bosdyn_dot_api_dot_lease__pb2.RetainLeaseRequest.SerializeToString,
response_deserializer=bosdyn_dot_api_dot_lease__pb2.RetainLeaseResponse.FromString,
)
class LeaseServiceServicer(object):
"""LeaseService provides Leases of shared resources to clients.
An example of a shared resource is the set of leg motors on Spot, which
has the resource name of "body".
Clients can delegate out the Leases they receive from the LeaseService
to additional clients or services by generating sub-leases.
Leases obtained from the LeaseService may be revoked if the Lease holder
does not check in frequently to the LeaseService, or if another client
force-acquires a Lease.
"""
def AcquireLease(self, request, context):
"""Acquire a lease to a specific resource if the resource is available.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def TakeLease(self, request, context):
"""Take a lease for a specific resource even if another client has a lease.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ReturnLease(self, request, context):
"""Return a lease to the LeaseService.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListLeases(self, request, context):
"""List state of all leases managed by the LeaseService.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def RetainLease(self, request, context):
"""Retain possession of a lease.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_LeaseServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'AcquireLease': grpc.unary_unary_rpc_method_handler(
servicer.AcquireLease,
request_deserializer=bosdyn_dot_api_dot_lease__pb2.AcquireLeaseRequest.FromString,
response_serializer=bosdyn_dot_api_dot_lease__pb2.AcquireLeaseResponse.SerializeToString,
),
'TakeLease': grpc.unary_unary_rpc_method_handler(
servicer.TakeLease,
request_deserializer=bosdyn_dot_api_dot_lease__pb2.TakeLeaseRequest.FromString,
response_serializer=bosdyn_dot_api_dot_lease__pb2.TakeLeaseResponse.SerializeToString,
),
'ReturnLease': grpc.unary_unary_rpc_method_handler(
servicer.ReturnLease,
request_deserializer=bosdyn_dot_api_dot_lease__pb2.ReturnLeaseRequest.FromString,
response_serializer=bosdyn_dot_api_dot_lease__pb2.ReturnLeaseResponse.SerializeToString,
),
'ListLeases': grpc.unary_unary_rpc_method_handler(
servicer.ListLeases,
request_deserializer=bosdyn_dot_api_dot_lease__pb2.ListLeasesRequest.FromString,
response_serializer=bosdyn_dot_api_dot_lease__pb2.ListLeasesResponse.SerializeToString,
),
'RetainLease': grpc.unary_unary_rpc_method_handler(
servicer.RetainLease,
request_deserializer=bosdyn_dot_api_dot_lease__pb2.RetainLeaseRequest.FromString,
response_serializer=bosdyn_dot_api_dot_lease__pb2.RetainLeaseResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'bosdyn.api.LeaseService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class LeaseService(object):
"""LeaseService provides Leases of shared resources to clients.
An example of a shared resource is the set of leg motors on Spot, which
has the resource name of "body".
Clients can delegate out the Leases they receive from the LeaseService
to additional clients or services by generating sub-leases.
Leases obtained from the LeaseService may be revoked if the Lease holder
does not check in frequently to the LeaseService, or if another client
force-acquires a Lease.
"""
@staticmethod
def AcquireLease(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, '/bosdyn.api.LeaseService/AcquireLease',
bosdyn_dot_api_dot_lease__pb2.AcquireLeaseRequest.SerializeToString,
bosdyn_dot_api_dot_lease__pb2.AcquireLeaseResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def TakeLease(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, '/bosdyn.api.LeaseService/TakeLease',
bosdyn_dot_api_dot_lease__pb2.TakeLeaseRequest.SerializeToString,
bosdyn_dot_api_dot_lease__pb2.TakeLeaseResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ReturnLease(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, '/bosdyn.api.LeaseService/ReturnLease',
bosdyn_dot_api_dot_lease__pb2.ReturnLeaseRequest.SerializeToString,
bosdyn_dot_api_dot_lease__pb2.ReturnLeaseResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListLeases(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, '/bosdyn.api.LeaseService/ListLeases',
bosdyn_dot_api_dot_lease__pb2.ListLeasesRequest.SerializeToString,
bosdyn_dot_api_dot_lease__pb2.ListLeasesResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def RetainLease(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, '/bosdyn.api.LeaseService/RetainLease',
bosdyn_dot_api_dot_lease__pb2.RetainLeaseRequest.SerializeToString,
bosdyn_dot_api_dot_lease__pb2.RetainLeaseResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)