pub struct CloudShellService { /* private fields */ }
Expand description
Implements a client for the Cloud Shell API.
§Example
let client = CloudShellService::builder().build().await?;
// use `client` to make requests to the Cloud Shell API.
§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.
§Configuration
To configure CloudShellService
use the with_*
methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://cloudshell.googleapis.com
). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
CloudShellService
holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap CloudShellService
in
an Rc or Arc to reuse it, because it
already uses an Arc
internally.
Implementations§
Source§impl CloudShellService
impl CloudShellService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for CloudShellService.
let client = CloudShellService::builder().build().await?;
Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: CloudShellService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: CloudShellService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn get_environment(&self) -> GetEnvironment
pub fn get_environment(&self) -> GetEnvironment
Gets an environment. Returns NOT_FOUND if the environment does not exist.
Sourcepub fn start_environment(&self) -> StartEnvironment
pub fn start_environment(&self) -> StartEnvironment
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.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
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.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn add_public_key(&self) -> AddPublicKey
pub fn add_public_key(&self) -> AddPublicKey
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.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn remove_public_key(&self) -> RemovePublicKey
pub fn remove_public_key(&self) -> RemovePublicKey
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.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
Trait Implementations§
Source§impl Clone for CloudShellService
impl Clone for CloudShellService
Source§fn clone(&self) -> CloudShellService
fn clone(&self) -> CloudShellService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more