ProcessService

(-- api-linter: core::0133::method-signature=disabled aip.dev/not-precedent: Method signature includes auto_run field which is a non-standard field for immediate execution workflow. --) Creates a new process.

Authorization: Only the creator of the parent SandboxEngine is allowed to call this method.

post/v1/{parent}/processes

Request

Path parameters

parentstring required

Required. The parent resource where the process will be created. Format: workspaces/{workspace}/sandboxEngines/{sandbox_engine}

Query parameters

processIdstring

Optional. The ID to use for the process.

It must:

  • contain 1-63 characters
  • contain only lowercase alphanumeric characters or hyphen ('-')
  • start with an alphanumeric character
  • end with an alphanumeric character

If not provided, a random UUID will be generated.

autoRunboolean

(-- api-linter: core::0133::request-unknown-fields=disabled aip.dev/not-precedent: auto_run enables immediate execution workflow while maintaining support for deferred execution via StartProcess. --) Optional. If true, the process will start execution immediately after creation (transitioning to STATE_RUNNING). If false or unset, the process will be created in STATE_PENDING and require an explicit StartProcess call to begin execution. This allows clients to establish stream connections before execution starts.

Request body

namestring
commandstring required

Required. The command that will be executed.

argsstring[]

Optional. The arguments for the command.

workingDirectorystring

Optional. The working directory for the process. All paths are rooted at the sandbox filesystem root. The path must start with a forward slash (e.g., "/workspace"). If empty, defaults to the sandbox root directory ("/").

environmentVariablesobject

Optional. A map of environment variables to set for the process. If a variable name exists in both environment_variables and secret_environment_variables, the secret value takes precedence.

secretEnvironmentVariablesobject

Optional. A map of environment variables populated from H2O Secure Store secrets. The key is the environment variable name, and the value contains the secret configuration including the secret version resource name.

These secret-based environment variables will override any variables with the same name specified in the environment_variables field.

Example: { "API_TOKEN": { "secret_version": "workspaces/my-workspace/secrets/api-key/versions/latest" } }

state'STATE_UNSPECIFIED' | 'STATE_PENDING' | 'STATE_RUNNING' | 'STATE_SUCCEEDED' | 'STATE_FAILED'

The state of the process.

  • STATE_UNSPECIFIED: The state is not specified.
  • STATE_PENDING: The process has been created but has not yet started execution. This is the initial state after a successful CreateProcess call. Use StartProcess method to begin execution.
  • STATE_RUNNING: The process is currently executing.
  • STATE_SUCCEEDED: The process completed successfully, typically with an exit code of 0.
  • STATE_FAILED: The process terminated with an error, typically with a non-zero exit code or due to an external signal.
exitCodeinteger

Output only. The exit code of the process.

createTimestring date-time

Output only. The time the process was created.

startTimestring date-time nullable

Output only. The time the process actually started execution. This is set when the process transitions to STATE_RUNNING.

endTimestring date-time nullable

Output only. The time the process finished.

Response

A successful response.

Changes

No recorded changes to this operation across all 1 revision of this API.