public abstract class CloudShellServiceClient
CloudShellService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Shell.V1Assembly
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 | |
---|---|
Type | Description |
OperationsClient |
AuthorizeEnvironmentOperationsClient
public virtual OperationsClient AuthorizeEnvironmentOperationsClient { get; }
The long-running operations client for AuthorizeEnvironment
.
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default CloudShellService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default CloudShellService scopes are:
GrpcClient
public virtual CloudShellService.CloudShellServiceClient GrpcClient { get; }
The underlying gRPC CloudShellService client
Property Value | |
---|---|
Type | Description |
CloudShellService.CloudShellServiceClient |
RemovePublicKeyOperationsClient
public virtual OperationsClient RemovePublicKeyOperationsClient { get; }
The long-running operations client for RemovePublicKey
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
StartEnvironmentOperationsClient
public virtual OperationsClient StartEnvironmentOperationsClient { get; }
The long-running operations client for StartEnvironment
.
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | AddPublicKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<AddPublicKeyResponse, AddPublicKeyMetadata> | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | AddPublicKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<AddPublicKeyResponse, AddPublicKeyMetadata>> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | AddPublicKeyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<AddPublicKeyResponse, AddPublicKeyMetadata>> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | AuthorizeEnvironmentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | AuthorizeEnvironmentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata>> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | AuthorizeEnvironmentRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata>> | A Task containing the RPC response. |
// 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 | |
---|---|
Type | Description |
CloudShellServiceClient | The created CloudShellServiceClient. |
CreateAsync(CancellationToken)
public static Task<CloudShellServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a CloudShellServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudShellServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
Task<CloudShellServiceClient> | 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 | |
---|---|
Name | Description |
name | EnvironmentName Required. Name of the requested resource, for example |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Environment | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetEnvironmentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Environment | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | String Required. Name of the requested resource, for example |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Environment | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | EnvironmentName Required. Name of the requested resource, for example |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Environment> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | EnvironmentName Required. Name of the requested resource, for example |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Environment> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetEnvironmentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Environment> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetEnvironmentRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Environment> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | String Required. Name of the requested resource, for example |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Environment> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | String Required. Name of the requested resource, for example |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Environment> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<AddPublicKeyResponse, AddPublicKeyMetadata> | 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 | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<AddPublicKeyResponse, AddPublicKeyMetadata>> | 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 | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> | 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 | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata>> | 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 | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> | 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 | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata>> | 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 | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<StartEnvironmentResponse, StartEnvironmentMetadata> | 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 | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<StartEnvironmentResponse, StartEnvironmentMetadata>> | 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 | |
---|---|
Name | Description |
request | RemovePublicKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | RemovePublicKeyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata>> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | RemovePublicKeyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata>> | A Task containing the RPC response. |
// 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 | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
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 | |
---|---|
Name | Description |
request | StartEnvironmentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<StartEnvironmentResponse, StartEnvironmentMetadata> | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | StartEnvironmentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<StartEnvironmentResponse, StartEnvironmentMetadata>> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | StartEnvironmentRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<StartEnvironmentResponse, StartEnvironmentMetadata>> | A Task containing the RPC response. |
// 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;
}