Shell driver

driver: jumpstarter_driver_shell.driver.Shell

The methods of this client are dynamic, and they are generated from the methods field of the exporter driver configuration.

Driver configuration

export:
  example:
    type: jumpstarter_driver_shell.driver.Shell
    config:
      methods:
        ls: "ls"
        method2: "echo 'Hello World 2'"
        #multi line method
        method3: |
          echo 'Hello World $1'
          echo 'Hello World $2'
        env_var: "echo $1,$2,$ENV_VAR"
      # optional parameters
      cwd: "/tmp"
      log_level: "INFO"
      shell:
        - "/bin/bash"
        - "-c"

ShellClient API

Assuming the exporter driver is configured as in the example above, the client methods will be generated dynamically, and they will be available as follows:

class jumpstarter_driver_shell.client.ShellClient(*, uuid: uuid.UUID = <factory>, labels: dict[str, str] = <factory>, channel: grpc.aio._base_channel.Channel, log_level: str = 'INFO', children: 'dict[str, DriverClient]' = <factory>, portal: 'BlockingPortal')
ls()
Returns:

A tuple(stdout, stderr, return_code)

method2()
Returns:

A tuple(stdout, stderr, return_code)

method3(arg1, arg2)
Returns:

A tuple(stdout, stderr, return_code)

env_var(arg1, arg2, ENV_VAR='value')
Returns:

A tuple(stdout, stderr, return_code)