:py:mod:`viam.proto.service.shell` ================================== .. py:module:: viam.proto.service.shell .. autoapi-nested-parse:: @generated by Viam. Do not edit manually! Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: viam.proto.service.shell.ShellServiceBase viam.proto.service.shell.ShellServiceStub viam.proto.service.shell.UnimplementedShellServiceBase viam.proto.service.shell.CopyFilesFromMachineRequest viam.proto.service.shell.CopyFilesFromMachineRequestMetadata viam.proto.service.shell.CopyFilesFromMachineResponse viam.proto.service.shell.CopyFilesFromMachineResponseMetadata viam.proto.service.shell.CopyFilesSourceType viam.proto.service.shell.CopyFilesToMachineRequest viam.proto.service.shell.CopyFilesToMachineRequestMetadata viam.proto.service.shell.CopyFilesToMachineResponse viam.proto.service.shell.FileData viam.proto.service.shell.ShellRequest viam.proto.service.shell.ShellResponse .. py:class:: ShellServiceBase Bases: :py:obj:`abc.ABC` Helper class that provides a standard way to create an ABC using inheritance. .. py:method:: Shell(stream: grpclib.server.Stream[service.shell.v1.shell_pb2.ShellRequest, service.shell.v1.shell_pb2.ShellResponse]) -> None :abstractmethod: :async: .. py:method:: CopyFilesToMachine(stream: grpclib.server.Stream[service.shell.v1.shell_pb2.CopyFilesToMachineRequest, service.shell.v1.shell_pb2.CopyFilesToMachineResponse]) -> None :abstractmethod: :async: .. py:method:: CopyFilesFromMachine(stream: grpclib.server.Stream[service.shell.v1.shell_pb2.CopyFilesFromMachineRequest, service.shell.v1.shell_pb2.CopyFilesFromMachineResponse]) -> None :abstractmethod: :async: .. py:method:: DoCommand(stream: grpclib.server.Stream[common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse]) -> None :abstractmethod: :async: .. py:method:: __mapping__() -> Dict[str, grpclib.const.Handler] .. py:class:: ShellServiceStub(channel: grpclib.client.Channel) .. py:class:: UnimplementedShellServiceBase Bases: :py:obj:`ShellServiceBase` Helper class that provides a standard way to create an ABC using inheritance. .. py:method:: Shell(stream: grpclib.server.Stream[service.shell.v1.shell_pb2.ShellRequest, service.shell.v1.shell_pb2.ShellResponse]) -> None :async: .. py:method:: CopyFilesToMachine(stream: grpclib.server.Stream[service.shell.v1.shell_pb2.CopyFilesToMachineRequest, service.shell.v1.shell_pb2.CopyFilesToMachineResponse]) -> None :async: .. py:method:: CopyFilesFromMachine(stream: grpclib.server.Stream[service.shell.v1.shell_pb2.CopyFilesFromMachineRequest, service.shell.v1.shell_pb2.CopyFilesFromMachineResponse]) -> None :async: .. py:method:: DoCommand(stream: grpclib.server.Stream[common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse]) -> None :async: .. py:class:: CopyFilesFromMachineRequest(*, metadata: global___CopyFilesFromMachineRequestMetadata | None = ..., ack_last_file: bool = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:property:: metadata :type: global___CopyFilesFromMachineRequestMetadata metadata is sent first and only once. .. py:attribute:: ack_last_file :type: bool ack_last_file is sent only after metadata and after each file has been received. The value does not matter. .. py:method:: HasField(field_name: Literal[ack_last_file, b'ack_last_file', metadata, b'metadata', request, b'request']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:method:: WhichOneof(oneof_group: Literal[request, b'request']) -> Literal[metadata, ack_last_file] | None Returns the name of the field that is set inside a oneof group. If no field is set, returns None. :param oneof_group: the name of the oneof group to check. :type oneof_group: str :returns: The name of the group that is set, or None. :rtype: str or None :raises ValueError: no group with the given name exists .. py:class:: CopyFilesFromMachineRequestMetadata(*, name: str = ..., paths: collections.abc.Iterable[str] | None = ..., allow_recursion: bool = ..., preserve: bool = ..., extra: google.protobuf.struct_pb2.Struct | None = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:property:: paths :type: google.protobuf.internal.containers.RepeatedScalarFieldContainer[str] paths are the paths to copy from and send back over the wire. .. py:property:: extra :type: google.protobuf.struct_pb2.Struct Additional arguments to the method .. py:attribute:: name :type: str name is the service name. .. py:attribute:: allow_recursion :type: bool allow_recursion indicates if directories should be recursed into. If a directory is encountered and this is false, an error MUST occur. .. py:attribute:: preserve :type: bool preserve indicates the the receiver should provide the metadata in the file to reflect the same state in the sender's filesystem as applicable. .. py:method:: HasField(field_name: Literal[extra, b'extra']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:class:: CopyFilesFromMachineResponse(*, metadata: global___CopyFilesFromMachineResponseMetadata | None = ..., file_data: global___FileData | None = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:property:: metadata :type: global___CopyFilesFromMachineResponseMetadata metadata is sent first and only once. .. py:property:: file_data :type: global___FileData file_data is sent only after metadata. All data MUST be sent in order per-file. .. py:method:: HasField(field_name: Literal[file_data, b'file_data', metadata, b'metadata', response, b'response']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:method:: WhichOneof(oneof_group: Literal[response, b'response']) -> Literal[metadata, file_data] | None Returns the name of the field that is set inside a oneof group. If no field is set, returns None. :param oneof_group: the name of the oneof group to check. :type oneof_group: str :returns: The name of the group that is set, or None. :rtype: str or None :raises ValueError: no group with the given name exists .. py:class:: CopyFilesFromMachineResponseMetadata(*, source_type: global___CopyFilesSourceType = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: source_type :type: global___CopyFilesSourceType source_type is the type of files that will be transmitted in this response stream. .. py:class:: CopyFilesSourceType Bases: :py:obj:`_CopyFilesSourceType` CopyFilesSourceType indicates what will be copied. It's important to disambiguate the single directory case from the multiple files case in order to indicate that the user's intent is to copy a directory into a single location which may result in a new top-level directory versus the cause of multiples files that always go into the existing target destination. .. py:class:: CopyFilesToMachineRequest(*, metadata: global___CopyFilesToMachineRequestMetadata | None = ..., file_data: global___FileData | None = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:property:: metadata :type: global___CopyFilesToMachineRequestMetadata metadata is sent first and only once. .. py:property:: file_data :type: global___FileData file_data is sent only after metadata. All data MUST be sent in order per-file. .. py:method:: HasField(field_name: Literal[file_data, b'file_data', metadata, b'metadata', request, b'request']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:method:: WhichOneof(oneof_group: Literal[request, b'request']) -> Literal[metadata, file_data] | None Returns the name of the field that is set inside a oneof group. If no field is set, returns None. :param oneof_group: the name of the oneof group to check. :type oneof_group: str :returns: The name of the group that is set, or None. :rtype: str or None :raises ValueError: no group with the given name exists .. py:class:: CopyFilesToMachineRequestMetadata(*, name: str = ..., source_type: global___CopyFilesSourceType = ..., destination: str = ..., preserve: bool = ..., extra: google.protobuf.struct_pb2.Struct | None = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:property:: extra :type: google.protobuf.struct_pb2.Struct Additional arguments to the method .. py:attribute:: name :type: str name is the service name. .. py:attribute:: source_type :type: global___CopyFilesSourceType source_type is the type of files that will be transmitted in this request stream. .. py:attribute:: destination :type: str destination is where the files should be placed. The receiver can choose to reasonably modify this destination based on its implementation semantics. .. py:attribute:: preserve :type: bool preserve indicates the the receiver should use the metadata in the file to reflect the same state in its filesystem as applicable. .. py:method:: HasField(field_name: Literal[extra, b'extra']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:class:: CopyFilesToMachineResponse(*, ack_last_file: bool = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: ack_last_file :type: bool value does not matter here but responses must be sent after every file has been received. .. py:class:: FileData(*, name: str = ..., size: int = ..., is_dir: bool = ..., data: bytes = ..., eof: bool = ..., mod_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., mode: int | None = ...) Bases: :py:obj:`google.protobuf.message.Message` FileData contains partial (sometimes complete) information about a File. When transmitting FileData with CopyFilesToMachine and CopyFilesFromMachine, it MUST initially contain its name, size, and is_dir. Depending on whether preservation is in use, the mod_time and mode fields may be initially set as well. On all transmissions, data and eof must be set. Because files are sent one-by-one, it is currently permitted to exclude the initially set fields. If this ever changes, a new scheme should be used for identifying files (like a number) in order to reduce data transmission while allowing out-of-order transfers. eof must be true and its own message once no more data is to be sent for this file. .. py:property:: mod_time :type: google.protobuf.timestamp_pb2.Timestamp maybe support access time in the future if needed :type: Note(erd) .. py:attribute:: name :type: str .. py:attribute:: size :type: int .. py:attribute:: is_dir :type: bool .. py:attribute:: data :type: bytes .. py:attribute:: eof :type: bool .. py:attribute:: mode :type: int .. py:method:: HasField(field_name: Literal[_mod_time, b'_mod_time', _mode, b'_mode', mod_time, b'mod_time', mode, b'mode']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:method:: WhichOneof(oneof_group: Literal[_mod_time, b'_mod_time']) -> Literal[mod_time] | None WhichOneof(oneof_group: Literal[_mode, b'_mode']) -> Literal[mode] | None Returns the name of the field that is set inside a oneof group. If no field is set, returns None. :param oneof_group: the name of the oneof group to check. :type oneof_group: str :returns: The name of the group that is set, or None. :rtype: str or None :raises ValueError: no group with the given name exists .. py:class:: ShellRequest(*, name: str = ..., data_in: str = ..., extra: google.protobuf.struct_pb2.Struct | None = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:property:: extra :type: google.protobuf.struct_pb2.Struct Additional arguments to the method .. py:attribute:: name :type: str .. py:attribute:: data_in :type: str .. py:method:: HasField(field_name: Literal[extra, b'extra']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:class:: ShellResponse(*, data_out: str = ..., data_err: str = ..., eof: bool = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: data_out :type: str .. py:attribute:: data_err :type: str .. py:attribute:: eof :type: bool