pymapadmin
¶
- pymapadmin.is_compatible(client_version, server_version)[source]¶
Check if the given client version is backwards- and forwards-compatible with the server version.
pymapadmin.local
¶
- class pymapadmin.local.LocalFile(envvar, filename)[source]¶
Defines a file that is kept on the local filesystem but could be in a number of different places.
- Parameters:
- property add_action: type[Action]¶
Use as an
action=
inargparse
to add command-line arguments as custom paths.
- property custom: Sequence[Path]¶
The custom paths added by
add()
, followed by any path specified by environment variable.
- get_home(*, mkdir=False)[source]¶
Returns filename inside
~/.config/pymap/
. Ifcustom
is not empty, its first value is returned instead.
- get_temp(*, mkdir=False)[source]¶
Returns filename inside the
pymap/
subdirectory ofgettempdir()
. Ifcustom
is not empty, its first value is returned instead.
- pymapadmin.local.config_file = <pymapadmin.local.LocalFile object>¶
The config file for default command-line arguments.
- pymapadmin.local.token_file = <pymapadmin.local.LocalFile object>¶
The token file for pymap-admin authentication.
- pymapadmin.local.socket_file = <pymapadmin.local.LocalFile object>¶
The socket file for connecting to a running pymap server.
pymapadmin.operation
¶
- class pymapadmin.operation.CompoundRequestT¶
Type variable for the compound request in
CompoundOperation
.alias of TypeVar(‘CompoundRequestT’)
- class pymapadmin.operation.FirstResponseT¶
Type variable for the first response in
CompoundOperation
.alias of TypeVar(‘FirstResponseT’)
- class pymapadmin.operation.SecondRequestT¶
Type variable for the second request in
CompoundOperation
.alias of TypeVar(‘SecondRequestT’)
- class pymapadmin.operation.Operation[source]¶
Base class for a GRPC operation.
- class pymapadmin.operation.SingleOperation[source]¶
Implements
Operation
using a single GRPC call.- abstract property method: MethodProtocol[RequestT, ResponseT]¶
The GRPC client method.
- class pymapadmin.operation.CompoundOperation[source]¶
Implements
Operation
using two steps. The second step may rely on the response of the first step.- abstract property first: Operation[RequestT, FirstResponseT]¶
The first step in the compound operation.
- abstract property second: Operation[SecondRequestT, ResponseT]¶
The second step in the compound operation.
- abstract build_first(request)[source]¶
Build the request object for the first step.
- Parameters:
request (CompoundRequestT) – The compound operation request.
- Return type:
- abstract build_second(request, first_response)[source]¶
Build the request object for the second step.
- Parameters:
request (CompoundRequestT) – The compound operation request.
first_response (FirstResponseT) – The response received by the first step.
- Returns:
If the second step should proceed, returns a two-tuple where the first item is the request object for the second step and the second item is ignored.
If the compound request should be aborted, returns a two-tuple where the first item is
None
and the second item can be a response to use instead of executing the second step.If both items in the tuple are
None
, the compound operation raises aRuntimeError
displaying the response to the first step.- Return type:
tuple[SecondRequestT | None, ResponseT | None]
- async execute(request)[source]¶
Execute the operation and return the response.
- Parameters:
request (CompoundRequestT) – The operation request.
- Return type:
pymapadmin.typing
¶
- class pymapadmin.typing.StubT¶
A type variable corresponding to an admin stub object.
alias of TypeVar(‘StubT’)
- class pymapadmin.typing.RequestT¶
A type variable corresponding to an request object.
alias of TypeVar(‘RequestT’)
- class pymapadmin.typing.ResponseT¶
A type variable corresponding to an response object.
alias of TypeVar(‘ResponseT’)
- class pymapadmin.typing.MethodProtocol(*args, **kwargs)[source]¶
Protocol defining an admin method, for a command.