daemon.clients.workspaces module

class daemon.clients.workspaces.FormData(paths=None, logger=None, complete=False)[source]

Bases: aiohttp.formdata.FormData

FormData used to upload files to remote

  • add(path)[source]

    add a field to Form

    • Parameters

      path (Path) – filepath

  • property fields: List[Any]

    all fields in current Form

    • Return type

      List[Any]

      Returns

      list of fields

  • property filenames: List[str]

    all filenames in current Form

    • Return type

      List[str]

      Returns

      list of filenames

class daemon.clients.workspaces.AsyncWorkspaceClient(uri, logger, timeout=None)[source]

Bases: daemon.clients.base.AsyncBaseClient

Async Client to create/update/delete Workspaces on remote JinaD

  • async create(\args, **kwargs*)

    Create a Workspace/Flow/Pod/Deployment on remote. Must be implemented by the inherited class.

    # noqa: DAR101 # noqa: DAR102

  • async wait(id, status, logs=True, sleep=2)[source]

    Wait until workspace creation completes

    • Parameters

      • id (DaemonID) – workspace id

      • status (Status) – rich.console.status object to update

      • logs (bool) – True if logs need to be streamed, defaults to True

      • sleep (int) – sleep time between each check, defaults to 2

      Return type

      bool

      Returns

      True if workspace creation succeeds

  • async update(\args, **kwargs*)

    Update a Workspace/Flow/Pod/Deployment on remote. Must be implemented by the inherited class.

    # noqa: DAR101 # noqa: DAR102

  • async delete(\args, **kwargs*)

    Delete a Workspace/Flow/Pod/Deployment on remote. Must be implemented by the inherited class.

    # noqa: DAR101 # noqa: DAR102

class daemon.clients.workspaces.WorkspaceClient(uri, logger, timeout=None)[source]

Bases: daemon.clients.mixin.AsyncToSyncMixin, daemon.clients.workspaces.AsyncWorkspaceClient

Client to create/update/delete workspaces on remote JinaD