simdb.cli.remote_api module¶
-
class simdb.cli.remote_api.RemoteAPI(remote: str | None, username: str | None, password: str | None, config: Config, use_token: bool | None =
None)[source]¶ Bases:
objectClass to represent connection to remote API.
This is used by the CLI to make all requests to the remote.
- delete(url: str, data: dict[Any, Any], **kwargs) Response[source]¶
Perform an HTTP DELETE request.
@param url: the URL of the request. @param data: the DELETE data to send. @param kwargs: any additional keyword arguments to add to the request. @return:
-
get(url: str, params: dict | None =
None, headers: dict | None =None, authenticate: bool | None =True, stream: bool | None =False) Response[source]¶ Perform an HTTP GET request.
@param url: the URL of the request. @param params: any additional parameters to send along with the request. @param headers: additional headers to send with the request. @param authenticate: True if we should send authentication headers with the
request.
@param stream: True to enable streaming. @return:
- patch(url: str, data: dict, **kwargs) Response[source]¶
Perform an HTTP PATCH request.
@param url: the URL of the request. @param data: the PATCH data to send. @param kwargs: any additional keyword arguments to add to the request. @return:
- post(url: str, data: dict, **kwargs) Response[source]¶
Perform an HTTP POST request.
@param url: the URL of the request. @param data: the POST data to send. @param kwargs: any additional keyword arguments to add to the request. @return:
- put(url: str, data: dict, **kwargs) Response[source]¶
Perform an HTTP PUT request.
@param url: the URL of the request. @param data: the PUT data to send. @param kwargs: any additional keyword arguments to add to the request. @return:
- property remote : str¶
Return the name of the remote.
-
simdb.cli.remote_api.read_bytes(path: Path, compressed: bool =
True) bytes[source]¶