Cloud Shell v1 API - Class CloudShellServiceClient (2.3.0)

public abstract class CloudShellServiceClient

Reference documentation and code samples for the Cloud Shell v1 API class CloudShellServiceClient.

CloudShellService client wrapper, for convenient use.

Inheritance

object > CloudShellServiceClient

Namespace

Google.Cloud.Shell.V1

Assembly

Google.Cloud.Shell.V1.dll

Remarks

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.

Properties

AddPublicKeyOperationsClient

public virtual OperationsClient AddPublicKeyOperationsClient { get; }

The long-running operations client for AddPublicKey.

Property Value
TypeDescription
OperationsClient

AuthorizeEnvironmentOperationsClient

public virtual OperationsClient AuthorizeEnvironmentOperationsClient { get; }

The long-running operations client for AuthorizeEnvironment.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the CloudShellService service, which is a host of "cloudshell.googleapis.com" and a port of 443.

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default CloudShellService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default CloudShellService scopes are:

GrpcClient

public virtual CloudShellService.CloudShellServiceClient GrpcClient { get; }

The underlying gRPC CloudShellService client

Property Value
TypeDescription
CloudShellServiceCloudShellServiceClient

RemovePublicKeyOperationsClient

public virtual OperationsClient RemovePublicKeyOperationsClient { get; }

The long-running operations client for RemovePublicKey.

Property Value
TypeDescription
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

StartEnvironmentOperationsClient

public virtual OperationsClient StartEnvironmentOperationsClient { get; }

The long-running operations client for StartEnvironment.

Property Value
TypeDescription
OperationsClient

Methods

AddPublicKey(AddPublicKeyRequest, CallSettings)

public virtual Operation<AddPublicKeyResponse, AddPublicKeyMetadata> AddPublicKey(AddPublicKeyRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestAddPublicKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationAddPublicKeyResponseAddPublicKeyMetadata

The RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
// Initialize request argument(s)
AddPublicKeyRequest request = new AddPublicKeyRequest
{
    Environment = "",
    Key = "",
};
// Make the request
Operation<AddPublicKeyResponse, AddPublicKeyMetadata> response = cloudShellServiceClient.AddPublicKey(request);

// Poll until the returned long-running operation is complete
Operation<AddPublicKeyResponse, AddPublicKeyMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AddPublicKeyResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddPublicKeyResponse, AddPublicKeyMetadata> retrievedResponse = cloudShellServiceClient.PollOnceAddPublicKey(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddPublicKeyResponse retrievedResult = retrievedResponse.Result;
}

AddPublicKeyAsync(AddPublicKeyRequest, CallSettings)

public virtual Task<Operation<AddPublicKeyResponse, AddPublicKeyMetadata>> AddPublicKeyAsync(AddPublicKeyRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestAddPublicKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationAddPublicKeyResponseAddPublicKeyMetadata

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
AddPublicKeyRequest request = new AddPublicKeyRequest
{
    Environment = "",
    Key = "",
};
// Make the request
Operation<AddPublicKeyResponse, AddPublicKeyMetadata> response = await cloudShellServiceClient.AddPublicKeyAsync(request);

// Poll until the returned long-running operation is complete
Operation<AddPublicKeyResponse, AddPublicKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddPublicKeyResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddPublicKeyResponse, AddPublicKeyMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceAddPublicKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddPublicKeyResponse retrievedResult = retrievedResponse.Result;
}

AddPublicKeyAsync(AddPublicKeyRequest, CancellationToken)

public virtual Task<Operation<AddPublicKeyResponse, AddPublicKeyMetadata>> AddPublicKeyAsync(AddPublicKeyRequest request, CancellationToken cancellationToken)

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.

Parameters
NameDescription
requestAddPublicKeyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationAddPublicKeyResponseAddPublicKeyMetadata

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
AddPublicKeyRequest request = new AddPublicKeyRequest
{
    Environment = "",
    Key = "",
};
// Make the request
Operation<AddPublicKeyResponse, AddPublicKeyMetadata> response = await cloudShellServiceClient.AddPublicKeyAsync(request);

// Poll until the returned long-running operation is complete
Operation<AddPublicKeyResponse, AddPublicKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddPublicKeyResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddPublicKeyResponse, AddPublicKeyMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceAddPublicKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddPublicKeyResponse retrievedResult = retrievedResponse.Result;
}

AuthorizeEnvironment(AuthorizeEnvironmentRequest, CallSettings)

public virtual Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> AuthorizeEnvironment(AuthorizeEnvironmentRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestAuthorizeEnvironmentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationAuthorizeEnvironmentResponseAuthorizeEnvironmentMetadata

The RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
// Initialize request argument(s)
AuthorizeEnvironmentRequest request = new AuthorizeEnvironmentRequest
{
    Name = "",
    AccessToken = "",
    ExpireTime = new Timestamp(),
    IdToken = "",
};
// Make the request
Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> response = cloudShellServiceClient.AuthorizeEnvironment(request);

// Poll until the returned long-running operation is complete
Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AuthorizeEnvironmentResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> retrievedResponse = cloudShellServiceClient.PollOnceAuthorizeEnvironment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AuthorizeEnvironmentResponse retrievedResult = retrievedResponse.Result;
}

AuthorizeEnvironmentAsync(AuthorizeEnvironmentRequest, CallSettings)

public virtual Task<Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata>> AuthorizeEnvironmentAsync(AuthorizeEnvironmentRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestAuthorizeEnvironmentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationAuthorizeEnvironmentResponseAuthorizeEnvironmentMetadata

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
AuthorizeEnvironmentRequest request = new AuthorizeEnvironmentRequest
{
    Name = "",
    AccessToken = "",
    ExpireTime = new Timestamp(),
    IdToken = "",
};
// Make the request
Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> response = await cloudShellServiceClient.AuthorizeEnvironmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AuthorizeEnvironmentResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceAuthorizeEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AuthorizeEnvironmentResponse retrievedResult = retrievedResponse.Result;
}

AuthorizeEnvironmentAsync(AuthorizeEnvironmentRequest, CancellationToken)

public virtual Task<Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata>> AuthorizeEnvironmentAsync(AuthorizeEnvironmentRequest request, CancellationToken cancellationToken)

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.

Parameters
NameDescription
requestAuthorizeEnvironmentRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationAuthorizeEnvironmentResponseAuthorizeEnvironmentMetadata

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
AuthorizeEnvironmentRequest request = new AuthorizeEnvironmentRequest
{
    Name = "",
    AccessToken = "",
    ExpireTime = new Timestamp(),
    IdToken = "",
};
// Make the request
Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> response = await cloudShellServiceClient.AuthorizeEnvironmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AuthorizeEnvironmentResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceAuthorizeEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AuthorizeEnvironmentResponse retrievedResult = retrievedResponse.Result;
}

Create()

public static CloudShellServiceClient Create()

Synchronously creates a CloudShellServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudShellServiceClientBuilder.

Returns
TypeDescription
CloudShellServiceClient

The created CloudShellServiceClient.

CreateAsync(CancellationToken)

public static Task<CloudShellServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a CloudShellServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudShellServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskCloudShellServiceClient

The task representing the created CloudShellServiceClient.

GetEnvironment(EnvironmentName, CallSettings)

public virtual Environment GetEnvironment(EnvironmentName name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameEnvironmentName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Environment

The RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
// Initialize request argument(s)
EnvironmentName name = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]");
// Make the request
Environment response = cloudShellServiceClient.GetEnvironment(name);

GetEnvironment(GetEnvironmentRequest, CallSettings)

public virtual Environment GetEnvironment(GetEnvironmentRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetEnvironmentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Environment

The RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
// Initialize request argument(s)
GetEnvironmentRequest request = new GetEnvironmentRequest
{
    EnvironmentName = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]"),
};
// Make the request
Environment response = cloudShellServiceClient.GetEnvironment(request);

GetEnvironment(string, CallSettings)

public virtual Environment GetEnvironment(string name, CallSettings callSettings = null)

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

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Environment

The RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
// Initialize request argument(s)
string name = "users/[USER]/environments/[ENVIRONMENT]";
// Make the request
Environment response = cloudShellServiceClient.GetEnvironment(name);

GetEnvironmentAsync(EnvironmentName, CallSettings)

public virtual Task<Environment> GetEnvironmentAsync(EnvironmentName name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameEnvironmentName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskEnvironment

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
EnvironmentName name = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]");
// Make the request
Environment response = await cloudShellServiceClient.GetEnvironmentAsync(name);

GetEnvironmentAsync(EnvironmentName, CancellationToken)

public virtual Task<Environment> GetEnvironmentAsync(EnvironmentName name, CancellationToken cancellationToken)

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

Parameters
NameDescription
nameEnvironmentName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskEnvironment

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
EnvironmentName name = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]");
// Make the request
Environment response = await cloudShellServiceClient.GetEnvironmentAsync(name);

GetEnvironmentAsync(GetEnvironmentRequest, CallSettings)

public virtual Task<Environment> GetEnvironmentAsync(GetEnvironmentRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetEnvironmentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskEnvironment

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
GetEnvironmentRequest request = new GetEnvironmentRequest
{
    EnvironmentName = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]"),
};
// Make the request
Environment response = await cloudShellServiceClient.GetEnvironmentAsync(request);

GetEnvironmentAsync(GetEnvironmentRequest, CancellationToken)

public virtual Task<Environment> GetEnvironmentAsync(GetEnvironmentRequest request, CancellationToken cancellationToken)

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

Parameters
NameDescription
requestGetEnvironmentRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskEnvironment

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
GetEnvironmentRequest request = new GetEnvironmentRequest
{
    EnvironmentName = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]"),
};
// Make the request
Environment response = await cloudShellServiceClient.GetEnvironmentAsync(request);

GetEnvironmentAsync(string, CallSettings)

public virtual Task<Environment> GetEnvironmentAsync(string name, CallSettings callSettings = null)

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

Parameters
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskEnvironment

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "users/[USER]/environments/[ENVIRONMENT]";
// Make the request
Environment response = await cloudShellServiceClient.GetEnvironmentAsync(name);

GetEnvironmentAsync(string, CancellationToken)

public virtual Task<Environment> GetEnvironmentAsync(string name, CancellationToken cancellationToken)

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

Parameters
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskEnvironment

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "users/[USER]/environments/[ENVIRONMENT]";
// Make the request
Environment response = await cloudShellServiceClient.GetEnvironmentAsync(name);

PollOnceAddPublicKey(string, CallSettings)

public virtual Operation<AddPublicKeyResponse, AddPublicKeyMetadata> PollOnceAddPublicKey(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of AddPublicKey.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationAddPublicKeyResponseAddPublicKeyMetadata

The result of polling the operation.

PollOnceAddPublicKeyAsync(string, CallSettings)

public virtual Task<Operation<AddPublicKeyResponse, AddPublicKeyMetadata>> PollOnceAddPublicKeyAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of AddPublicKey.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationAddPublicKeyResponseAddPublicKeyMetadata

A task representing the result of polling the operation.

PollOnceAuthorizeEnvironment(string, CallSettings)

public virtual Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> PollOnceAuthorizeEnvironment(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of AuthorizeEnvironment .

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationAuthorizeEnvironmentResponseAuthorizeEnvironmentMetadata

The result of polling the operation.

PollOnceAuthorizeEnvironmentAsync(string, CallSettings)

public virtual Task<Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata>> PollOnceAuthorizeEnvironmentAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of AuthorizeEnvironment.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationAuthorizeEnvironmentResponseAuthorizeEnvironmentMetadata

A task representing the result of polling the operation.

PollOnceRemovePublicKey(string, CallSettings)

public virtual Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> PollOnceRemovePublicKey(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of RemovePublicKey.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationRemovePublicKeyResponseRemovePublicKeyMetadata

The result of polling the operation.

PollOnceRemovePublicKeyAsync(string, CallSettings)

public virtual Task<Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata>> PollOnceRemovePublicKeyAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of RemovePublicKey.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationRemovePublicKeyResponseRemovePublicKeyMetadata

A task representing the result of polling the operation.

PollOnceStartEnvironment(string, CallSettings)

public virtual Operation<StartEnvironmentResponse, StartEnvironmentMetadata> PollOnceStartEnvironment(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of StartEnvironment.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationStartEnvironmentResponseStartEnvironmentMetadata

The result of polling the operation.

PollOnceStartEnvironmentAsync(string, CallSettings)

public virtual Task<Operation<StartEnvironmentResponse, StartEnvironmentMetadata>> PollOnceStartEnvironmentAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of StartEnvironment.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationStartEnvironmentResponseStartEnvironmentMetadata

A task representing the result of polling the operation.

RemovePublicKey(RemovePublicKeyRequest, CallSettings)

public virtual Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> RemovePublicKey(RemovePublicKeyRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestRemovePublicKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationRemovePublicKeyResponseRemovePublicKeyMetadata

The RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
// Initialize request argument(s)
RemovePublicKeyRequest request = new RemovePublicKeyRequest
{
    Environment = "",
    Key = "",
};
// Make the request
Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> response = cloudShellServiceClient.RemovePublicKey(request);

// Poll until the returned long-running operation is complete
Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
RemovePublicKeyResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> retrievedResponse = cloudShellServiceClient.PollOnceRemovePublicKey(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemovePublicKeyResponse retrievedResult = retrievedResponse.Result;
}

RemovePublicKeyAsync(RemovePublicKeyRequest, CallSettings)

public virtual Task<Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata>> RemovePublicKeyAsync(RemovePublicKeyRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestRemovePublicKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationRemovePublicKeyResponseRemovePublicKeyMetadata

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
RemovePublicKeyRequest request = new RemovePublicKeyRequest
{
    Environment = "",
    Key = "",
};
// Make the request
Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> response = await cloudShellServiceClient.RemovePublicKeyAsync(request);

// Poll until the returned long-running operation is complete
Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemovePublicKeyResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceRemovePublicKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemovePublicKeyResponse retrievedResult = retrievedResponse.Result;
}

RemovePublicKeyAsync(RemovePublicKeyRequest, CancellationToken)

public virtual Task<Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata>> RemovePublicKeyAsync(RemovePublicKeyRequest request, CancellationToken cancellationToken)

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.

Parameters
NameDescription
requestRemovePublicKeyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationRemovePublicKeyResponseRemovePublicKeyMetadata

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
RemovePublicKeyRequest request = new RemovePublicKeyRequest
{
    Environment = "",
    Key = "",
};
// Make the request
Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> response = await cloudShellServiceClient.RemovePublicKeyAsync(request);

// Poll until the returned long-running operation is complete
Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemovePublicKeyResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceRemovePublicKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemovePublicKeyResponse retrievedResult = retrievedResponse.Result;
}

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

StartEnvironment(StartEnvironmentRequest, CallSettings)

public virtual Operation<StartEnvironmentResponse, StartEnvironmentMetadata> StartEnvironment(StartEnvironmentRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestStartEnvironmentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationStartEnvironmentResponseStartEnvironmentMetadata

The RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
// Initialize request argument(s)
StartEnvironmentRequest request = new StartEnvironmentRequest
{
    Name = "",
    AccessToken = "",
    PublicKeys = { "", },
};
// Make the request
Operation<StartEnvironmentResponse, StartEnvironmentMetadata> response = cloudShellServiceClient.StartEnvironment(request);

// Poll until the returned long-running operation is complete
Operation<StartEnvironmentResponse, StartEnvironmentMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
StartEnvironmentResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<StartEnvironmentResponse, StartEnvironmentMetadata> retrievedResponse = cloudShellServiceClient.PollOnceStartEnvironment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    StartEnvironmentResponse retrievedResult = retrievedResponse.Result;
}

StartEnvironmentAsync(StartEnvironmentRequest, CallSettings)

public virtual Task<Operation<StartEnvironmentResponse, StartEnvironmentMetadata>> StartEnvironmentAsync(StartEnvironmentRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestStartEnvironmentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationStartEnvironmentResponseStartEnvironmentMetadata

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
StartEnvironmentRequest request = new StartEnvironmentRequest
{
    Name = "",
    AccessToken = "",
    PublicKeys = { "", },
};
// Make the request
Operation<StartEnvironmentResponse, StartEnvironmentMetadata> response = await cloudShellServiceClient.StartEnvironmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<StartEnvironmentResponse, StartEnvironmentMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
StartEnvironmentResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<StartEnvironmentResponse, StartEnvironmentMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceStartEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    StartEnvironmentResponse retrievedResult = retrievedResponse.Result;
}

StartEnvironmentAsync(StartEnvironmentRequest, CancellationToken)

public virtual Task<Operation<StartEnvironmentResponse, StartEnvironmentMetadata>> StartEnvironmentAsync(StartEnvironmentRequest request, CancellationToken cancellationToken)

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.

Parameters
NameDescription
requestStartEnvironmentRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationStartEnvironmentResponseStartEnvironmentMetadata

A Task containing the RPC response.

Example
// Create client
CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
// Initialize request argument(s)
StartEnvironmentRequest request = new StartEnvironmentRequest
{
    Name = "",
    AccessToken = "",
    PublicKeys = { "", },
};
// Make the request
Operation<StartEnvironmentResponse, StartEnvironmentMetadata> response = await cloudShellServiceClient.StartEnvironmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<StartEnvironmentResponse, StartEnvironmentMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
StartEnvironmentResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<StartEnvironmentResponse, StartEnvironmentMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceStartEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    StartEnvironmentResponse retrievedResult = retrievedResponse.Result;
}