class UsersEnvironments extends Resource (View source)

The "environments" collection of methods.

Typical usage is:

 $cloudshellService = new Google\Service\CloudShell(...);
 $environments = $cloudshellService->users_environments;

Methods

addPublicKey(string $environment, AddPublicKeyRequest $postBody, array $optParams = [])

Adds a public SSH key to an environment, allowing clients with the corresponding private key to connect to that environment via SSH. If a key with the same content already exists, this will error with ALREADY_EXISTS.

authorize(string $name, AuthorizeEnvironmentRequest $postBody, array $optParams = [])

Sends OAuth credentials to a running environment on behalf of a user. When this completes, the environment will be authorized to run various Google Cloud command line tools without requiring the user to manually authenticate.

get(string $name, array $optParams = [])

Gets an environment. Returns NOT_FOUND if the environment does not exist.

removePublicKey(string $environment, RemovePublicKeyRequest $postBody, array $optParams = [])

Removes a public SSH key from an environment. Clients will no longer be able to connect to the environment using the corresponding private key. If a key with the same content is not present, this will error with NOT_FOUND.

start(string $name, StartEnvironmentRequest $postBody, array $optParams = [])

Starts an existing environment, allowing clients to connect to it. The returned operation will contain an instance of StartEnvironmentMetadata in its metadata field. Users can wait for the environment to start by polling this operation via GetOperation. Once the environment has finished starting and is ready to accept connections, the operation will contain a StartEnvironmentResponse in its response field. (environments.start)

Details

Operation addPublicKey(string $environment, AddPublicKeyRequest $postBody, array $optParams = [])

Adds a public SSH key to an environment, allowing clients with the corresponding private key to connect to that environment via SSH. If a key with the same content already exists, this will error with ALREADY_EXISTS.

(environments.addPublicKey)

Parameters

string $environment

Environment this key should be added to, e.g. users/me/environments/default.

AddPublicKeyRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation authorize(string $name, AuthorizeEnvironmentRequest $postBody, array $optParams = [])

Sends OAuth credentials to a running environment on behalf of a user. When this completes, the environment will be authorized to run various Google Cloud command line tools without requiring the user to manually authenticate.

(environments.authorize)

Parameters

string $name

Name of the resource that should receive the credentials, for example users/me/environments/default or users/someone@example.com/environments/default.

AuthorizeEnvironmentRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Environment get(string $name, array $optParams = [])

Gets an environment. Returns NOT_FOUND if the environment does not exist.

(environments.get)

Parameters

string $name

Required. Name of the requested resource, for example users/me/environments/default or users/someone@example.com/environments/default.

array $optParams

Optional parameters.

Return Value

Environment

Exceptions

Exception

Operation removePublicKey(string $environment, RemovePublicKeyRequest $postBody, array $optParams = [])

Removes a public SSH key from an environment. Clients will no longer be able to connect to the environment using the corresponding private key. If a key with the same content is not present, this will error with NOT_FOUND.

(environments.removePublicKey)

Parameters

string $environment

Environment this key should be removed from, e.g. users/me/environments/default.

RemovePublicKeyRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation start(string $name, StartEnvironmentRequest $postBody, array $optParams = [])

Starts an existing environment, allowing clients to connect to it. The returned operation will contain an instance of StartEnvironmentMetadata in its metadata field. Users can wait for the environment to start by polling this operation via GetOperation. Once the environment has finished starting and is ready to accept connections, the operation will contain a StartEnvironmentResponse in its response field. (environments.start)

Parameters

string $name

Name of the resource that should be started, for example users/me/environments/default or users/someone@example.com/environments/default.

StartEnvironmentRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception