pub struct CloudShellService { /* private fields */ }Expand description
Implements a client for 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
CloudShellService has various configuration parameters, the defaults should
work with most applications.
§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 async fn new_with_config(conf: ClientConfig) -> Result<Self>
pub async fn new_with_config(conf: ClientConfig) -> Result<Self>
Creates a new client with the specified configuration.
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 when mocking the client.
Sourcepub fn get_environment(&self, name: impl Into<String>) -> GetEnvironment
pub fn get_environment(&self, name: impl Into<String>) -> GetEnvironment
Gets an environment. Returns NOT_FOUND if the environment does not exist.
Sourcepub fn start_environment(&self, name: impl Into<String>) -> StartEnvironment
pub fn start_environment(&self, name: impl Into<String>) -> 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, environment: impl Into<String>) -> AddPublicKey
pub fn add_public_key(&self, environment: impl Into<String>) -> 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,
environment: impl Into<String>,
) -> RemovePublicKey
pub fn remove_public_key( &self, environment: impl Into<String>, ) -> 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, name: impl Into<String>) -> GetOperation
pub fn get_operation(&self, name: impl Into<String>) -> 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