Class EnvironmentsClient (1.0.0)

public abstract class EnvironmentsClient

Environments client wrapper, for convenient use.

Inheritance

Object > EnvironmentsClient

Derived Types

Namespace

Google.Cloud.Orchestration.Airflow.Service.V1

Assembly

Google.Cloud.Orchestration.Airflow.Service.V1.dll

Remarks

Managed Apache Airflow Environments.

Properties

CreateEnvironmentOperationsClient

public virtual OperationsClient CreateEnvironmentOperationsClient { get; }

The long-running operations client for CreateEnvironment.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Environments scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default Environments scopes are:

DeleteEnvironmentOperationsClient

public virtual OperationsClient DeleteEnvironmentOperationsClient { get; }

The long-running operations client for DeleteEnvironment.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual Environments.EnvironmentsClient GrpcClient { get; }

The underlying gRPC Environments client

Property Value
TypeDescription
Environments.EnvironmentsClient

UpdateEnvironmentOperationsClient

public virtual OperationsClient UpdateEnvironmentOperationsClient { get; }

The long-running operations client for UpdateEnvironment.

Property Value
TypeDescription
OperationsClient

Methods

Create()

public static EnvironmentsClient Create()

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

Returns
TypeDescription
EnvironmentsClient

The created EnvironmentsClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<EnvironmentsClient>

The task representing the created EnvironmentsClient.

CreateEnvironment(CreateEnvironmentRequest, CallSettings)

public virtual Operation<Environment, OperationMetadata> CreateEnvironment(CreateEnvironmentRequest request, CallSettings callSettings = null)

Create a new environment.

Parameters
NameDescription
requestCreateEnvironmentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Environment, OperationMetadata>

The RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = EnvironmentsClient.Create();
// Initialize request argument(s)
CreateEnvironmentRequest request = new CreateEnvironmentRequest
{
    Parent = "",
    Environment = new gcoasv::Environment(),
};
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = environmentsClient.CreateEnvironment(request);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = environmentsClient.PollOnceCreateEnvironment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}

CreateEnvironment(String, Environment, CallSettings)

public virtual Operation<Environment, OperationMetadata> CreateEnvironment(string parent, Environment environment, CallSettings callSettings = null)

Create a new environment.

Parameters
NameDescription
parentString

The parent must be of the form "projects/{projectId}/locations/{locationId}".

environmentEnvironment

The environment to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Environment, OperationMetadata>

The RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = EnvironmentsClient.Create();
// Initialize request argument(s)
string parent = "";
gcoasv::Environment environment = new gcoasv::Environment();
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = environmentsClient.CreateEnvironment(parent, environment);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = environmentsClient.PollOnceCreateEnvironment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}

CreateEnvironmentAsync(CreateEnvironmentRequest, CallSettings)

public virtual Task<Operation<Environment, OperationMetadata>> CreateEnvironmentAsync(CreateEnvironmentRequest request, CallSettings callSettings = null)

Create a new environment.

Parameters
NameDescription
requestCreateEnvironmentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Environment, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
CreateEnvironmentRequest request = new CreateEnvironmentRequest
{
    Parent = "",
    Environment = new gcoasv::Environment(),
};
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = await environmentsClient.CreateEnvironmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceCreateEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}

CreateEnvironmentAsync(CreateEnvironmentRequest, CancellationToken)

public virtual Task<Operation<Environment, OperationMetadata>> CreateEnvironmentAsync(CreateEnvironmentRequest request, CancellationToken cancellationToken)

Create a new environment.

Parameters
NameDescription
requestCreateEnvironmentRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Environment, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
CreateEnvironmentRequest request = new CreateEnvironmentRequest
{
    Parent = "",
    Environment = new gcoasv::Environment(),
};
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = await environmentsClient.CreateEnvironmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceCreateEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}

CreateEnvironmentAsync(String, Environment, CallSettings)

public virtual Task<Operation<Environment, OperationMetadata>> CreateEnvironmentAsync(string parent, Environment environment, CallSettings callSettings = null)

Create a new environment.

Parameters
NameDescription
parentString

The parent must be of the form "projects/{projectId}/locations/{locationId}".

environmentEnvironment

The environment to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Environment, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
string parent = "";
gcoasv::Environment environment = new gcoasv::Environment();
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = await environmentsClient.CreateEnvironmentAsync(parent, environment);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceCreateEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}

CreateEnvironmentAsync(String, Environment, CancellationToken)

public virtual Task<Operation<Environment, OperationMetadata>> CreateEnvironmentAsync(string parent, Environment environment, CancellationToken cancellationToken)

Create a new environment.

Parameters
NameDescription
parentString

The parent must be of the form "projects/{projectId}/locations/{locationId}".

environmentEnvironment

The environment to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Environment, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
string parent = "";
gcoasv::Environment environment = new gcoasv::Environment();
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = await environmentsClient.CreateEnvironmentAsync(parent, environment);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceCreateEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}

DeleteEnvironment(DeleteEnvironmentRequest, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteEnvironment(DeleteEnvironmentRequest request, CallSettings callSettings = null)

Delete an environment.

Parameters
NameDescription
requestDeleteEnvironmentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, OperationMetadata>

The RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = EnvironmentsClient.Create();
// Initialize request argument(s)
DeleteEnvironmentRequest request = new DeleteEnvironmentRequest { Name = "", };
// Make the request
Operation<Empty, OperationMetadata> response = environmentsClient.DeleteEnvironment(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = environmentsClient.PollOnceDeleteEnvironment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteEnvironment(String, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteEnvironment(string name, CallSettings callSettings = null)

Delete an environment.

Parameters
NameDescription
nameString

The environment to delete, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, OperationMetadata>

The RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = EnvironmentsClient.Create();
// Initialize request argument(s)
string name = "";
// Make the request
Operation<Empty, OperationMetadata> response = environmentsClient.DeleteEnvironment(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = environmentsClient.PollOnceDeleteEnvironment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteEnvironmentAsync(DeleteEnvironmentRequest, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteEnvironmentAsync(DeleteEnvironmentRequest request, CallSettings callSettings = null)

Delete an environment.

Parameters
NameDescription
requestDeleteEnvironmentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
DeleteEnvironmentRequest request = new DeleteEnvironmentRequest { Name = "", };
// Make the request
Operation<Empty, OperationMetadata> response = await environmentsClient.DeleteEnvironmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceDeleteEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteEnvironmentAsync(DeleteEnvironmentRequest, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteEnvironmentAsync(DeleteEnvironmentRequest request, CancellationToken cancellationToken)

Delete an environment.

Parameters
NameDescription
requestDeleteEnvironmentRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
DeleteEnvironmentRequest request = new DeleteEnvironmentRequest { Name = "", };
// Make the request
Operation<Empty, OperationMetadata> response = await environmentsClient.DeleteEnvironmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceDeleteEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteEnvironmentAsync(String, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteEnvironmentAsync(string name, CallSettings callSettings = null)

Delete an environment.

Parameters
NameDescription
nameString

The environment to delete, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
Operation<Empty, OperationMetadata> response = await environmentsClient.DeleteEnvironmentAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceDeleteEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteEnvironmentAsync(String, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteEnvironmentAsync(string name, CancellationToken cancellationToken)

Delete an environment.

Parameters
NameDescription
nameString

The environment to delete, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
Operation<Empty, OperationMetadata> response = await environmentsClient.DeleteEnvironmentAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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<Empty, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceDeleteEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

GetEnvironment(GetEnvironmentRequest, CallSettings)

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

Get an existing environment.

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
EnvironmentsClient environmentsClient = EnvironmentsClient.Create();
// Initialize request argument(s)
GetEnvironmentRequest request = new GetEnvironmentRequest { Name = "", };
// Make the request
gcoasv::Environment response = environmentsClient.GetEnvironment(request);

GetEnvironment(String, CallSettings)

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

Get an existing environment.

Parameters
NameDescription
nameString

The resource name of the environment to get, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Environment

The RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = EnvironmentsClient.Create();
// Initialize request argument(s)
string name = "";
// Make the request
gcoasv::Environment response = environmentsClient.GetEnvironment(name);

GetEnvironmentAsync(GetEnvironmentRequest, CallSettings)

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

Get an existing environment.

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
Task<Environment>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
GetEnvironmentRequest request = new GetEnvironmentRequest { Name = "", };
// Make the request
gcoasv::Environment response = await environmentsClient.GetEnvironmentAsync(request);

GetEnvironmentAsync(GetEnvironmentRequest, CancellationToken)

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

Get an existing environment.

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
Task<Environment>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
GetEnvironmentRequest request = new GetEnvironmentRequest { Name = "", };
// Make the request
gcoasv::Environment response = await environmentsClient.GetEnvironmentAsync(request);

GetEnvironmentAsync(String, CallSettings)

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

Get an existing environment.

Parameters
NameDescription
nameString

The resource name of the environment to get, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Environment>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
gcoasv::Environment response = await environmentsClient.GetEnvironmentAsync(name);

GetEnvironmentAsync(String, CancellationToken)

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

Get an existing environment.

Parameters
NameDescription
nameString

The resource name of the environment to get, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Environment>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
gcoasv::Environment response = await environmentsClient.GetEnvironmentAsync(name);

ListEnvironments(ListEnvironmentsRequest, CallSettings)

public virtual PagedEnumerable<ListEnvironmentsResponse, Environment> ListEnvironments(ListEnvironmentsRequest request, CallSettings callSettings = null)

List environments.

Parameters
NameDescription
requestListEnvironmentsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListEnvironmentsResponse, Environment>

A pageable sequence of Environment resources.

Example
// Create client
EnvironmentsClient environmentsClient = EnvironmentsClient.Create();
// Initialize request argument(s)
ListEnvironmentsRequest request = new ListEnvironmentsRequest { Parent = "", };
// Make the request
PagedEnumerable<ListEnvironmentsResponse, gcoasv::Environment> response = environmentsClient.ListEnvironments(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (gcoasv::Environment item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListEnvironmentsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gcoasv::Environment item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcoasv::Environment> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcoasv::Environment item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListEnvironments(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListEnvironmentsResponse, Environment> ListEnvironments(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

List environments.

Parameters
NameDescription
parentString

List environments in the given project and location, in the form: "projects/{projectId}/locations/{locationId}"

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListEnvironmentsResponse, Environment>

A pageable sequence of Environment resources.

Example
// Create client
EnvironmentsClient environmentsClient = EnvironmentsClient.Create();
// Initialize request argument(s)
string parent = "";
// Make the request
PagedEnumerable<ListEnvironmentsResponse, gcoasv::Environment> response = environmentsClient.ListEnvironments(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (gcoasv::Environment item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListEnvironmentsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gcoasv::Environment item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcoasv::Environment> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcoasv::Environment item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListEnvironmentsAsync(ListEnvironmentsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListEnvironmentsResponse, Environment> ListEnvironmentsAsync(ListEnvironmentsRequest request, CallSettings callSettings = null)

List environments.

Parameters
NameDescription
requestListEnvironmentsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListEnvironmentsResponse, Environment>

A pageable asynchronous sequence of Environment resources.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
ListEnvironmentsRequest request = new ListEnvironmentsRequest { Parent = "", };
// Make the request
PagedAsyncEnumerable<ListEnvironmentsResponse, gcoasv::Environment> response = environmentsClient.ListEnvironmentsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gcoasv::Environment item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListEnvironmentsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gcoasv::Environment item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcoasv::Environment> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcoasv::Environment item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListEnvironmentsAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListEnvironmentsResponse, Environment> ListEnvironmentsAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

List environments.

Parameters
NameDescription
parentString

List environments in the given project and location, in the form: "projects/{projectId}/locations/{locationId}"

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListEnvironmentsResponse, Environment>

A pageable asynchronous sequence of Environment resources.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
string parent = "";
// Make the request
PagedAsyncEnumerable<ListEnvironmentsResponse, gcoasv::Environment> response = environmentsClient.ListEnvironmentsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gcoasv::Environment item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListEnvironmentsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gcoasv::Environment item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcoasv::Environment> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcoasv::Environment item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PollOnceCreateEnvironment(String, CallSettings)

public virtual Operation<Environment, OperationMetadata> PollOnceCreateEnvironment(string operationName, CallSettings callSettings = null)

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

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
Operation<Environment, OperationMetadata>

The result of polling the operation.

PollOnceCreateEnvironmentAsync(String, CallSettings)

public virtual Task<Operation<Environment, OperationMetadata>> PollOnceCreateEnvironmentAsync(string operationName, CallSettings callSettings = null)

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

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
Task<Operation<Environment, OperationMetadata>>

A task representing the result of polling the operation.

PollOnceDeleteEnvironment(String, CallSettings)

public virtual Operation<Empty, OperationMetadata> PollOnceDeleteEnvironment(string operationName, CallSettings callSettings = null)

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

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
Operation<Empty, OperationMetadata>

The result of polling the operation.

PollOnceDeleteEnvironmentAsync(String, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> PollOnceDeleteEnvironmentAsync(string operationName, CallSettings callSettings = null)

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

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
Task<Operation<Empty, OperationMetadata>>

A task representing the result of polling the operation.

PollOnceUpdateEnvironment(String, CallSettings)

public virtual Operation<Environment, OperationMetadata> PollOnceUpdateEnvironment(string operationName, CallSettings callSettings = null)

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

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
Operation<Environment, OperationMetadata>

The result of polling the operation.

PollOnceUpdateEnvironmentAsync(String, CallSettings)

public virtual Task<Operation<Environment, OperationMetadata>> PollOnceUpdateEnvironmentAsync(string operationName, CallSettings callSettings = null)

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

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
Task<Operation<Environment, OperationMetadata>>

A task representing the result of polling the operation.

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.

UpdateEnvironment(UpdateEnvironmentRequest, CallSettings)

public virtual Operation<Environment, OperationMetadata> UpdateEnvironment(UpdateEnvironmentRequest request, CallSettings callSettings = null)

Update an environment.

Parameters
NameDescription
requestUpdateEnvironmentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Environment, OperationMetadata>

The RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = EnvironmentsClient.Create();
// Initialize request argument(s)
UpdateEnvironmentRequest request = new UpdateEnvironmentRequest
{
    Environment = new gcoasv::Environment(),
    Name = "",
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = environmentsClient.UpdateEnvironment(request);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = environmentsClient.PollOnceUpdateEnvironment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}

UpdateEnvironment(String, Environment, FieldMask, CallSettings)

public virtual Operation<Environment, OperationMetadata> UpdateEnvironment(string name, Environment environment, FieldMask updateMask, CallSettings callSettings = null)

Update an environment.

Parameters
NameDescription
nameString

The relative resource name of the environment to update, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

environmentEnvironment

A patch environment. Fields specified by the updateMask will be copied from the patch environment into the environment under update.

updateMaskFieldMask

Required. A comma-separated list of paths, relative to Environment, of fields to update. For example, to set the version of scikit-learn to install in the environment to 0.19.0 and to remove an existing installation of numpy, the updateMask parameter would include the following two paths values: "config.softwareConfig.pypiPackages.scikit-learn" and "config.softwareConfig.pypiPackages.numpy". The included patch environment would specify the scikit-learn version as follows:

{ "config":{ "softwareConfig":{ "pypiPackages":{ "scikit-learn":"==0.19.0" } } } }

Note that in the above example, any existing PyPI packages other than scikit-learn and numpy will be unaffected.

Only one update type may be included in a single request's updateMask. For example, one cannot update both the PyPI packages and labels in the same request. However, it is possible to update multiple members of a map field simultaneously in the same request. For example, to set the labels "label1" and "label2" while clearing "label3" (assuming it already exists), one can provide the paths "labels.label1", "labels.label2", and "labels.label3" and populate the patch environment as follows:

{ "labels":{ "label1":"new-label1-value" "label2":"new-label2-value" } }

Note that in the above example, any existing labels that are not included in the updateMask will be unaffected.

It is also possible to replace an entire map field by providing the map field's path in the updateMask. The new value of the field will be that which is provided in the patch environment. For example, to delete all pre-existing user-specified PyPI packages and install botocore at version 1.7.14, the updateMask would contain the path "config.softwareConfig.pypiPackages", and the patch environment would be the following:

{ "config":{ "softwareConfig":{ "pypiPackages":{ "botocore":"==1.7.14" } } } }

Note: Only the following fields can be updated:

  • config.softwareConfig.pypiPackages
  • Replace all custom custom PyPI packages. If a replacement package map is not included in environment, all custom PyPI packages are cleared. It is an error to provide both this mask and a mask specifying an individual package.
  • config.softwareConfig.pypiPackages.packagename
  • Update the custom PyPI package packagename, preserving other packages. To delete the package, include it in updateMask, and omit the mapping for it in environment.config.softwareConfig.pypiPackages. It is an error to provide both a mask of this form and the config.softwareConfig.pypiPackages mask.
  • labels
  • Replace all environment labels. If a replacement labels map is not included in environment, all labels are cleared. It is an error to provide both this mask and a mask specifying one or more individual labels.
  • labels.labelName
  • Set the label named labelName, while preserving other labels. To delete the label, include it in updateMask and omit its mapping in environment.labels. It is an error to provide both a mask of this form and the labels mask.
  • config.nodeCount
  • Horizontally scale the number of nodes in the environment. An integer greater than or equal to 3 must be provided in the config.nodeCount field.
  • config.webServerNetworkAccessControl
  • Replace the environment's current WebServerNetworkAccessControl.
  • config.databaseConfig
  • Replace the environment's current DatabaseConfig.
  • config.webServerConfig
  • Replace the environment's current WebServerConfig.
  • config.softwareConfig.airflowConfigOverrides
  • Replace all Apache Airflow config overrides. If a replacement config overrides map is not included in environment, all config overrides are cleared. It is an error to provide both this mask and a mask specifying one or more individual config overrides.
  • config.softwareConfig.airflowConfigOverrides.section-name
  • Override the Apache Airflow config property name in the section named section, preserving other properties. To delete the property override, include it in updateMask and omit its mapping in environment.config.softwareConfig.airflowConfigOverrides. It is an error to provide both a mask of this form and the config.softwareConfig.airflowConfigOverrides mask.
  • config.softwareConfig.envVariables
  • Replace all environment variables. If a replacement environment variable map is not included in environment, all custom environment variables are cleared. It is an error to provide both this mask and a mask specifying one or more individual environment variables.
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Environment, OperationMetadata>

The RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = EnvironmentsClient.Create();
// Initialize request argument(s)
string name = "";
gcoasv::Environment environment = new gcoasv::Environment();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = environmentsClient.UpdateEnvironment(name, environment, updateMask);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = environmentsClient.PollOnceUpdateEnvironment(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}

UpdateEnvironmentAsync(UpdateEnvironmentRequest, CallSettings)

public virtual Task<Operation<Environment, OperationMetadata>> UpdateEnvironmentAsync(UpdateEnvironmentRequest request, CallSettings callSettings = null)

Update an environment.

Parameters
NameDescription
requestUpdateEnvironmentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Environment, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
UpdateEnvironmentRequest request = new UpdateEnvironmentRequest
{
    Environment = new gcoasv::Environment(),
    Name = "",
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = await environmentsClient.UpdateEnvironmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceUpdateEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}

UpdateEnvironmentAsync(UpdateEnvironmentRequest, CancellationToken)

public virtual Task<Operation<Environment, OperationMetadata>> UpdateEnvironmentAsync(UpdateEnvironmentRequest request, CancellationToken cancellationToken)

Update an environment.

Parameters
NameDescription
requestUpdateEnvironmentRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Environment, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
UpdateEnvironmentRequest request = new UpdateEnvironmentRequest
{
    Environment = new gcoasv::Environment(),
    Name = "",
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = await environmentsClient.UpdateEnvironmentAsync(request);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceUpdateEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}

UpdateEnvironmentAsync(String, Environment, FieldMask, CallSettings)

public virtual Task<Operation<Environment, OperationMetadata>> UpdateEnvironmentAsync(string name, Environment environment, FieldMask updateMask, CallSettings callSettings = null)

Update an environment.

Parameters
NameDescription
nameString

The relative resource name of the environment to update, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

environmentEnvironment

A patch environment. Fields specified by the updateMask will be copied from the patch environment into the environment under update.

updateMaskFieldMask

Required. A comma-separated list of paths, relative to Environment, of fields to update. For example, to set the version of scikit-learn to install in the environment to 0.19.0 and to remove an existing installation of numpy, the updateMask parameter would include the following two paths values: "config.softwareConfig.pypiPackages.scikit-learn" and "config.softwareConfig.pypiPackages.numpy". The included patch environment would specify the scikit-learn version as follows:

{ "config":{ "softwareConfig":{ "pypiPackages":{ "scikit-learn":"==0.19.0" } } } }

Note that in the above example, any existing PyPI packages other than scikit-learn and numpy will be unaffected.

Only one update type may be included in a single request's updateMask. For example, one cannot update both the PyPI packages and labels in the same request. However, it is possible to update multiple members of a map field simultaneously in the same request. For example, to set the labels "label1" and "label2" while clearing "label3" (assuming it already exists), one can provide the paths "labels.label1", "labels.label2", and "labels.label3" and populate the patch environment as follows:

{ "labels":{ "label1":"new-label1-value" "label2":"new-label2-value" } }

Note that in the above example, any existing labels that are not included in the updateMask will be unaffected.

It is also possible to replace an entire map field by providing the map field's path in the updateMask. The new value of the field will be that which is provided in the patch environment. For example, to delete all pre-existing user-specified PyPI packages and install botocore at version 1.7.14, the updateMask would contain the path "config.softwareConfig.pypiPackages", and the patch environment would be the following:

{ "config":{ "softwareConfig":{ "pypiPackages":{ "botocore":"==1.7.14" } } } }

Note: Only the following fields can be updated:

  • config.softwareConfig.pypiPackages
  • Replace all custom custom PyPI packages. If a replacement package map is not included in environment, all custom PyPI packages are cleared. It is an error to provide both this mask and a mask specifying an individual package.
  • config.softwareConfig.pypiPackages.packagename
  • Update the custom PyPI package packagename, preserving other packages. To delete the package, include it in updateMask, and omit the mapping for it in environment.config.softwareConfig.pypiPackages. It is an error to provide both a mask of this form and the config.softwareConfig.pypiPackages mask.
  • labels
  • Replace all environment labels. If a replacement labels map is not included in environment, all labels are cleared. It is an error to provide both this mask and a mask specifying one or more individual labels.
  • labels.labelName
  • Set the label named labelName, while preserving other labels. To delete the label, include it in updateMask and omit its mapping in environment.labels. It is an error to provide both a mask of this form and the labels mask.
  • config.nodeCount
  • Horizontally scale the number of nodes in the environment. An integer greater than or equal to 3 must be provided in the config.nodeCount field.
  • config.webServerNetworkAccessControl
  • Replace the environment's current WebServerNetworkAccessControl.
  • config.databaseConfig
  • Replace the environment's current DatabaseConfig.
  • config.webServerConfig
  • Replace the environment's current WebServerConfig.
  • config.softwareConfig.airflowConfigOverrides
  • Replace all Apache Airflow config overrides. If a replacement config overrides map is not included in environment, all config overrides are cleared. It is an error to provide both this mask and a mask specifying one or more individual config overrides.
  • config.softwareConfig.airflowConfigOverrides.section-name
  • Override the Apache Airflow config property name in the section named section, preserving other properties. To delete the property override, include it in updateMask and omit its mapping in environment.config.softwareConfig.airflowConfigOverrides. It is an error to provide both a mask of this form and the config.softwareConfig.airflowConfigOverrides mask.
  • config.softwareConfig.envVariables
  • Replace all environment variables. If a replacement environment variable map is not included in environment, all custom environment variables are cleared. It is an error to provide both this mask and a mask specifying one or more individual environment variables.
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Environment, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
string name = "";
gcoasv::Environment environment = new gcoasv::Environment();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = await environmentsClient.UpdateEnvironmentAsync(name, environment, updateMask);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceUpdateEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}

UpdateEnvironmentAsync(String, Environment, FieldMask, CancellationToken)

public virtual Task<Operation<Environment, OperationMetadata>> UpdateEnvironmentAsync(string name, Environment environment, FieldMask updateMask, CancellationToken cancellationToken)

Update an environment.

Parameters
NameDescription
nameString

The relative resource name of the environment to update, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

environmentEnvironment

A patch environment. Fields specified by the updateMask will be copied from the patch environment into the environment under update.

updateMaskFieldMask

Required. A comma-separated list of paths, relative to Environment, of fields to update. For example, to set the version of scikit-learn to install in the environment to 0.19.0 and to remove an existing installation of numpy, the updateMask parameter would include the following two paths values: "config.softwareConfig.pypiPackages.scikit-learn" and "config.softwareConfig.pypiPackages.numpy". The included patch environment would specify the scikit-learn version as follows:

{ "config":{ "softwareConfig":{ "pypiPackages":{ "scikit-learn":"==0.19.0" } } } }

Note that in the above example, any existing PyPI packages other than scikit-learn and numpy will be unaffected.

Only one update type may be included in a single request's updateMask. For example, one cannot update both the PyPI packages and labels in the same request. However, it is possible to update multiple members of a map field simultaneously in the same request. For example, to set the labels "label1" and "label2" while clearing "label3" (assuming it already exists), one can provide the paths "labels.label1", "labels.label2", and "labels.label3" and populate the patch environment as follows:

{ "labels":{ "label1":"new-label1-value" "label2":"new-label2-value" } }

Note that in the above example, any existing labels that are not included in the updateMask will be unaffected.

It is also possible to replace an entire map field by providing the map field's path in the updateMask. The new value of the field will be that which is provided in the patch environment. For example, to delete all pre-existing user-specified PyPI packages and install botocore at version 1.7.14, the updateMask would contain the path "config.softwareConfig.pypiPackages", and the patch environment would be the following:

{ "config":{ "softwareConfig":{ "pypiPackages":{ "botocore":"==1.7.14" } } } }

Note: Only the following fields can be updated:

  • config.softwareConfig.pypiPackages
  • Replace all custom custom PyPI packages. If a replacement package map is not included in environment, all custom PyPI packages are cleared. It is an error to provide both this mask and a mask specifying an individual package.
  • config.softwareConfig.pypiPackages.packagename
  • Update the custom PyPI package packagename, preserving other packages. To delete the package, include it in updateMask, and omit the mapping for it in environment.config.softwareConfig.pypiPackages. It is an error to provide both a mask of this form and the config.softwareConfig.pypiPackages mask.
  • labels
  • Replace all environment labels. If a replacement labels map is not included in environment, all labels are cleared. It is an error to provide both this mask and a mask specifying one or more individual labels.
  • labels.labelName
  • Set the label named labelName, while preserving other labels. To delete the label, include it in updateMask and omit its mapping in environment.labels. It is an error to provide both a mask of this form and the labels mask.
  • config.nodeCount
  • Horizontally scale the number of nodes in the environment. An integer greater than or equal to 3 must be provided in the config.nodeCount field.
  • config.webServerNetworkAccessControl
  • Replace the environment's current WebServerNetworkAccessControl.
  • config.databaseConfig
  • Replace the environment's current DatabaseConfig.
  • config.webServerConfig
  • Replace the environment's current WebServerConfig.
  • config.softwareConfig.airflowConfigOverrides
  • Replace all Apache Airflow config overrides. If a replacement config overrides map is not included in environment, all config overrides are cleared. It is an error to provide both this mask and a mask specifying one or more individual config overrides.
  • config.softwareConfig.airflowConfigOverrides.section-name
  • Override the Apache Airflow config property name in the section named section, preserving other properties. To delete the property override, include it in updateMask and omit its mapping in environment.config.softwareConfig.airflowConfigOverrides. It is an error to provide both a mask of this form and the config.softwareConfig.airflowConfigOverrides mask.
  • config.softwareConfig.envVariables
  • Replace all environment variables. If a replacement environment variable map is not included in environment, all custom environment variables are cleared. It is an error to provide both this mask and a mask specifying one or more individual environment variables.
cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Environment, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
string name = "";
gcoasv::Environment environment = new gcoasv::Environment();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<gcoasv::Environment, OperationMetadata> response = await environmentsClient.UpdateEnvironmentAsync(name, environment, updateMask);

// Poll until the returned long-running operation is complete
Operation<gcoasv::Environment, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcoasv::Environment 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<gcoasv::Environment, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceUpdateEnvironmentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcoasv::Environment retrievedResult = retrievedResponse.Result;
}