Package com.google.cloud.shell.v1 (2.7.0)

The interfaces provided are listed below, along with usage samples.

CloudShellServiceClient

Service Description: API for interacting with Google Cloud Shell. Each user of Cloud Shell has at least one environment, which has the ID "default". Environment consists of a Docker image defining what is installed on the environment and a home directory containing the user's data that will remain across sessions. Clients use this API to start and fetch information about their environment, which can then be used to connect to that environment via a separate SSH client.

Sample for CloudShellServiceClient:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
   EnvironmentName name = EnvironmentName.of("[USER]", "[ENVIRONMENT]");
   Environment response = cloudShellServiceClient.getEnvironment(name);
 }
 

Classes

AddPublicKeyMetadata

Message included in the metadata field of operations returned from AddPublicKey.

Protobuf type google.cloud.shell.v1.AddPublicKeyMetadata

AddPublicKeyMetadata.Builder

Message included in the metadata field of operations returned from AddPublicKey.

Protobuf type google.cloud.shell.v1.AddPublicKeyMetadata

AddPublicKeyRequest

Request message for AddPublicKey.

Protobuf type google.cloud.shell.v1.AddPublicKeyRequest

AddPublicKeyRequest.Builder

Request message for AddPublicKey.

Protobuf type google.cloud.shell.v1.AddPublicKeyRequest

AddPublicKeyResponse

Response message for AddPublicKey.

Protobuf type google.cloud.shell.v1.AddPublicKeyResponse

AddPublicKeyResponse.Builder

Response message for AddPublicKey.

Protobuf type google.cloud.shell.v1.AddPublicKeyResponse

AuthorizeEnvironmentMetadata

Message included in the metadata field of operations returned from AuthorizeEnvironment.

Protobuf type google.cloud.shell.v1.AuthorizeEnvironmentMetadata

AuthorizeEnvironmentMetadata.Builder

Message included in the metadata field of operations returned from AuthorizeEnvironment.

Protobuf type google.cloud.shell.v1.AuthorizeEnvironmentMetadata

AuthorizeEnvironmentRequest

Request message for AuthorizeEnvironment.

Protobuf type google.cloud.shell.v1.AuthorizeEnvironmentRequest

AuthorizeEnvironmentRequest.Builder

Request message for AuthorizeEnvironment.

Protobuf type google.cloud.shell.v1.AuthorizeEnvironmentRequest

AuthorizeEnvironmentResponse

Response message for AuthorizeEnvironment.

Protobuf type google.cloud.shell.v1.AuthorizeEnvironmentResponse

AuthorizeEnvironmentResponse.Builder

Response message for AuthorizeEnvironment.

Protobuf type google.cloud.shell.v1.AuthorizeEnvironmentResponse

CloudShellErrorDetails

Cloud-shell specific information that will be included as details in failure responses.

Protobuf type google.cloud.shell.v1.CloudShellErrorDetails

CloudShellErrorDetails.Builder

Cloud-shell specific information that will be included as details in failure responses.

Protobuf type google.cloud.shell.v1.CloudShellErrorDetails

CloudShellProto

CloudShellServiceClient

Service Description: API for interacting with Google Cloud Shell. Each user of Cloud Shell has at least one environment, which has the ID "default". Environment consists of a Docker image defining what is installed on the environment and a home directory containing the user's data that will remain across sessions. Clients use this API to start and fetch information about their environment, which can then be used to connect to that environment via a separate SSH client.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.create()) {
   EnvironmentName name = EnvironmentName.of("[USER]", "[ENVIRONMENT]");
   Environment response = cloudShellServiceClient.getEnvironment(name);
 }
 

Note: close() needs to be called on the CloudShellServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of CloudShellServiceSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 CloudShellServiceSettings cloudShellServiceSettings =
     CloudShellServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 CloudShellServiceClient cloudShellServiceClient =
     CloudShellServiceClient.create(cloudShellServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 CloudShellServiceSettings cloudShellServiceSettings =
     CloudShellServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 CloudShellServiceClient cloudShellServiceClient =
     CloudShellServiceClient.create(cloudShellServiceSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 CloudShellServiceSettings cloudShellServiceSettings =
     CloudShellServiceSettings.newHttpJsonBuilder().build();
 CloudShellServiceClient cloudShellServiceClient =
     CloudShellServiceClient.create(cloudShellServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

CloudShellServiceGrpc

API for interacting with Google Cloud Shell. Each user of Cloud Shell has at least one environment, which has the ID "default". Environment consists of a Docker image defining what is installed on the environment and a home directory containing the user's data that will remain across sessions. Clients use this API to start and fetch information about their environment, which can then be used to connect to that environment via a separate SSH client.

CloudShellServiceGrpc.CloudShellServiceBlockingStub

API for interacting with Google Cloud Shell. Each user of Cloud Shell has at least one environment, which has the ID "default". Environment consists of a Docker image defining what is installed on the environment and a home directory containing the user's data that will remain across sessions. Clients use this API to start and fetch information about their environment, which can then be used to connect to that environment via a separate SSH client.

CloudShellServiceGrpc.CloudShellServiceFutureStub

API for interacting with Google Cloud Shell. Each user of Cloud Shell has at least one environment, which has the ID "default". Environment consists of a Docker image defining what is installed on the environment and a home directory containing the user's data that will remain across sessions. Clients use this API to start and fetch information about their environment, which can then be used to connect to that environment via a separate SSH client.

CloudShellServiceGrpc.CloudShellServiceImplBase

API for interacting with Google Cloud Shell. Each user of Cloud Shell has at least one environment, which has the ID "default". Environment consists of a Docker image defining what is installed on the environment and a home directory containing the user's data that will remain across sessions. Clients use this API to start and fetch information about their environment, which can then be used to connect to that environment via a separate SSH client.

CloudShellServiceGrpc.CloudShellServiceStub

API for interacting with Google Cloud Shell. Each user of Cloud Shell has at least one environment, which has the ID "default". Environment consists of a Docker image defining what is installed on the environment and a home directory containing the user's data that will remain across sessions. Clients use this API to start and fetch information about their environment, which can then be used to connect to that environment via a separate SSH client.

CloudShellServiceSettings

Settings class to configure an instance of CloudShellServiceClient.

The default instance has everything set to sensible defaults:

  • The default service address (cloudshell.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of getEnvironment to 30 seconds:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 CloudShellServiceSettings.Builder cloudShellServiceSettingsBuilder =
     CloudShellServiceSettings.newBuilder();
 cloudShellServiceSettingsBuilder
     .getEnvironmentSettings()
     .setRetrySettings(
         cloudShellServiceSettingsBuilder
             .getEnvironmentSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 CloudShellServiceSettings cloudShellServiceSettings = cloudShellServiceSettingsBuilder.build();
 

CloudShellServiceSettings.Builder

Builder for CloudShellServiceSettings.

CreateEnvironmentMetadata

Message included in the metadata field of operations returned from CreateEnvironment.

Protobuf type google.cloud.shell.v1.CreateEnvironmentMetadata

CreateEnvironmentMetadata.Builder

Message included in the metadata field of operations returned from CreateEnvironment.

Protobuf type google.cloud.shell.v1.CreateEnvironmentMetadata

DeleteEnvironmentMetadata

Message included in the metadata field of operations returned from DeleteEnvironment.

Protobuf type google.cloud.shell.v1.DeleteEnvironmentMetadata

DeleteEnvironmentMetadata.Builder

Message included in the metadata field of operations returned from DeleteEnvironment.

Protobuf type google.cloud.shell.v1.DeleteEnvironmentMetadata

Environment

A Cloud Shell environment, which is defined as the combination of a Docker image specifying what is installed on the environment and a home directory containing the user's data that will remain across sessions. Each user has at least an environment with the ID "default".

Protobuf type google.cloud.shell.v1.Environment

Environment.Builder

A Cloud Shell environment, which is defined as the combination of a Docker image specifying what is installed on the environment and a home directory containing the user's data that will remain across sessions. Each user has at least an environment with the ID "default".

Protobuf type google.cloud.shell.v1.Environment

EnvironmentName

EnvironmentName.Builder

Builder for users/{user}/environments/{environment}.

GetEnvironmentRequest

Request message for GetEnvironment.

Protobuf type google.cloud.shell.v1.GetEnvironmentRequest

GetEnvironmentRequest.Builder

Request message for GetEnvironment.

Protobuf type google.cloud.shell.v1.GetEnvironmentRequest

RemovePublicKeyMetadata

Message included in the metadata field of operations returned from RemovePublicKey.

Protobuf type google.cloud.shell.v1.RemovePublicKeyMetadata

RemovePublicKeyMetadata.Builder

Message included in the metadata field of operations returned from RemovePublicKey.

Protobuf type google.cloud.shell.v1.RemovePublicKeyMetadata

RemovePublicKeyRequest

Request message for RemovePublicKey.

Protobuf type google.cloud.shell.v1.RemovePublicKeyRequest

RemovePublicKeyRequest.Builder

Request message for RemovePublicKey.

Protobuf type google.cloud.shell.v1.RemovePublicKeyRequest

RemovePublicKeyResponse

Response message for RemovePublicKey.

Protobuf type google.cloud.shell.v1.RemovePublicKeyResponse

RemovePublicKeyResponse.Builder

Response message for RemovePublicKey.

Protobuf type google.cloud.shell.v1.RemovePublicKeyResponse

StartEnvironmentMetadata

Message included in the metadata field of operations returned from StartEnvironment.

Protobuf type google.cloud.shell.v1.StartEnvironmentMetadata

StartEnvironmentMetadata.Builder

Message included in the metadata field of operations returned from StartEnvironment.

Protobuf type google.cloud.shell.v1.StartEnvironmentMetadata

StartEnvironmentRequest

Request message for StartEnvironment.

Protobuf type google.cloud.shell.v1.StartEnvironmentRequest

StartEnvironmentRequest.Builder

Request message for StartEnvironment.

Protobuf type google.cloud.shell.v1.StartEnvironmentRequest

StartEnvironmentResponse

Message included in the response field of operations returned from StartEnvironment once the operation is complete.

Protobuf type google.cloud.shell.v1.StartEnvironmentResponse

StartEnvironmentResponse.Builder

Message included in the response field of operations returned from StartEnvironment once the operation is complete.

Protobuf type google.cloud.shell.v1.StartEnvironmentResponse

Interfaces

AddPublicKeyMetadataOrBuilder

AddPublicKeyRequestOrBuilder

AddPublicKeyResponseOrBuilder

AuthorizeEnvironmentMetadataOrBuilder

AuthorizeEnvironmentRequestOrBuilder

AuthorizeEnvironmentResponseOrBuilder

CloudShellErrorDetailsOrBuilder

CreateEnvironmentMetadataOrBuilder

DeleteEnvironmentMetadataOrBuilder

EnvironmentOrBuilder

GetEnvironmentRequestOrBuilder

RemovePublicKeyMetadataOrBuilder

RemovePublicKeyRequestOrBuilder

RemovePublicKeyResponseOrBuilder

StartEnvironmentMetadataOrBuilder

StartEnvironmentRequestOrBuilder

StartEnvironmentResponseOrBuilder

Enums

CloudShellErrorDetails.CloudShellErrorCode

Set of possible errors returned from API calls.

Protobuf enum google.cloud.shell.v1.CloudShellErrorDetails.CloudShellErrorCode

Environment.State

Possible execution states for an environment.

Protobuf enum google.cloud.shell.v1.Environment.State

StartEnvironmentMetadata.State

Possible states an environment might transition between during startup. These states are not normally actionable by clients, but may be used to show a progress message to the user. An environment won't necessarily go through all of these states when starting. More states are likely to be added in the future.

Protobuf enum google.cloud.shell.v1.StartEnvironmentMetadata.State