airflow_pydantic.SSHOperatorArgs

pydantic model airflow_pydantic.SSHOperatorArgs[source]

Bases: _TaskSpecificArgs

Show JSON schema
{
   "title": "SSHOperatorArgs",
   "type": "object",
   "properties": {
      "ssh_hook": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "predefined ssh_hook to use for remote execution. Either ssh_hook or ssh_conn_id needs to be provided.",
         "title": "Ssh Hook"
      },
      "ssh_conn_id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "ssh connection id from airflow Connections. ssh_conn_id will be ignored if ssh_hook is provided.",
         "title": "Ssh Conn Id"
      },
      "remote_host": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "remote host to connect (templated) Nullable. If provided, it will replace the remote_host which was defined in ssh_hook or predefined in the connection of ssh_conn_id.",
         "title": "Remote Host"
      },
      "command": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "command to execute on remote host. (templated)",
         "title": "Command"
      },
      "conn_timeout": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "timeout (in seconds) for maintaining the connection. The default is 10 seconds. Nullable. If provided, it will replace the conn_timeout which was predefined in the connection of ssh_conn_id.",
         "title": "Conn Timeout"
      },
      "cmd_timeout": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "timeout (in seconds) for executing the command. The default is 10 seconds. Nullable, None means no timeout. If provided, it will replace the cmd_timeout which was predefined in the connection of ssh_conn_id.",
         "title": "Cmd Timeout"
      },
      "environment": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "a dict of shell environment variables. Note that the server will reject them silently if AcceptEnv is not set in SSH config. (templated)",
         "title": "Environment"
      },
      "get_pty": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "request a pseudo-terminal from the server. Set to True to have the remote process killed upon task timeout. The default is False but note that get_pty is forced to True when the command starts with sudo.",
         "title": "Get Pty"
      },
      "banner_timeout": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "timeout to wait for banner from the server in seconds",
         "title": "Banner Timeout"
      },
      "skip_on_exit_code": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If command exits with this exit code, leave the task in skipped state (default: None). If set to None, any non-zero exit code will be treated as a failure.",
         "title": "Skip On Exit Code"
      }
   },
   "additionalProperties": true
}

Fields:
  • banner_timeout (int | None)

  • cmd_timeout (int | None)

  • command (str | None)

  • conn_timeout (int | None)

  • environment (Dict[str, str] | None)

  • get_pty (bool | None)

  • remote_host (str | None)

  • skip_on_exit_code (int | None)

  • ssh_conn_id (str | None)

  • ssh_hook (object | None)

field ssh_hook: Annotated[object, BeforeValidator(func=get_import_path, json_schema_input_type=PydanticUndefined)] | None = None

predefined ssh_hook to use for remote execution. Either ssh_hook or ssh_conn_id needs to be provided.

field ssh_conn_id: str | None = None

ssh connection id from airflow Connections. ssh_conn_id will be ignored if ssh_hook is provided.

field remote_host: str | None = None

remote host to connect (templated) Nullable. If provided, it will replace the remote_host which was defined in ssh_hook or predefined in the connection of ssh_conn_id.

field command: str | None = None

command to execute on remote host. (templated)

field conn_timeout: int | None = None

timeout (in seconds) for maintaining the connection. The default is 10 seconds. Nullable. If provided, it will replace the conn_timeout which was predefined in the connection of ssh_conn_id.

field cmd_timeout: int | None = None

timeout (in seconds) for executing the command. The default is 10 seconds. Nullable, None means no timeout. If provided, it will replace the cmd_timeout which was predefined in the connection of ssh_conn_id.

field environment: Dict[str, str] | None = None

a dict of shell environment variables. Note that the server will reject them silently if AcceptEnv is not set in SSH config. (templated)

field get_pty: bool | None = None

request a pseudo-terminal from the server. Set to True to have the remote process killed upon task timeout. The default is False but note that get_pty is forced to True when the command starts with sudo.

field banner_timeout: int | None = None

timeout to wait for banner from the server in seconds

field skip_on_exit_code: int | None = None

If command exits with this exit code, leave the task in skipped state (default: None). If set to None, any non-zero exit code will be treated as a failure.