Class EnvironmentsClient (2.18.0)

Managed Apache Airflow Environments.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

EnvironmentsClient(EnvironmentsClient const &)

Copy and move support

Parameter
Name Description
EnvironmentsClient const &

EnvironmentsClient(EnvironmentsClient &&)

Copy and move support

Parameter
Name Description
EnvironmentsClient &&

EnvironmentsClient(std::shared_ptr< EnvironmentsConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< EnvironmentsConnection >
opts Options

Operators

operator=(EnvironmentsClient const &)

Copy and move support

Parameter
Name Description
EnvironmentsClient const &
Returns
Type Description
EnvironmentsClient &

operator=(EnvironmentsClient &&)

Copy and move support

Parameter
Name Description
EnvironmentsClient &&
Returns
Type Description
EnvironmentsClient &

Functions

CreateEnvironment(std::string const &, google::cloud::orchestration::airflow::service::v1::Environment const &, Options)

Create a new environment.

Parameters
Name Description
parent std::string const &

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

environment google::cloud::orchestration::airflow::service::v1::Environment const &

The environment to create.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::orchestration::airflow::service::v1::Environment > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.orchestration.airflow.service.v1.Environment proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateEnvironment(google::cloud::orchestration::airflow::service::v1::CreateEnvironmentRequest const &, Options)

Create a new environment.

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::CreateEnvironmentRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::orchestration::airflow::service::v1::Environment > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.orchestration.airflow.service.v1.Environment proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

GetEnvironment(std::string const &, Options)

Get an existing environment.

Parameters
Name Description
name std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::orchestration::airflow::service::v1::Environment >

the result of the RPC. The response message type (google.cloud.orchestration.airflow.service.v1.Environment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetEnvironment(google::cloud::orchestration::airflow::service::v1::GetEnvironmentRequest const &, Options)

Get an existing environment.

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::GetEnvironmentRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::orchestration::airflow::service::v1::Environment >

the result of the RPC. The response message type (google.cloud.orchestration.airflow.service.v1.Environment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListEnvironments(std::string const &, Options)

List environments.

Parameters
Name Description
parent std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::orchestration::airflow::service::v1::Environment >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.orchestration.airflow.service.v1.Environment, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListEnvironments(google::cloud::orchestration::airflow::service::v1::ListEnvironmentsRequest, Options)

List environments.

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::ListEnvironmentsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::orchestration::airflow::service::v1::Environment >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.orchestration.airflow.service.v1.Environment, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

UpdateEnvironment(std::string const &, google::cloud::orchestration::airflow::service::v1::Environment const &, google::protobuf::FieldMask const &, Options)

Update an environment.

Parameters
Name Description
name std::string const &

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

environment google::cloud::orchestration::airflow::service::v1::Environment const &

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

update_mask google::protobuf::FieldMask const &

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".
For more information, see UpdateEnvironmentRequest.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::orchestration::airflow::service::v1::Environment > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.orchestration.airflow.service.v1.Environment proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateEnvironment(google::cloud::orchestration::airflow::service::v1::UpdateEnvironmentRequest const &, Options)

Update an environment.

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::UpdateEnvironmentRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::orchestration::airflow::service::v1::Environment > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.orchestration.airflow.service.v1.Environment proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteEnvironment(std::string const &, Options)

Delete an environment.

Parameters
Name Description
name std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::orchestration::airflow::service::v1::OperationMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.orchestration.airflow.service.v1.OperationMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteEnvironment(google::cloud::orchestration::airflow::service::v1::DeleteEnvironmentRequest const &, Options)

Delete an environment.

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::DeleteEnvironmentRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::orchestration::airflow::service::v1::OperationMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.orchestration.airflow.service.v1.OperationMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

ExecuteAirflowCommand(google::cloud::orchestration::airflow::service::v1::ExecuteAirflowCommandRequest const &, Options)

Executes Airflow CLI command.

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::ExecuteAirflowCommandRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::orchestration::airflow::service::v1::ExecuteAirflowCommandResponse >

the result of the RPC. The response message type (google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

StopAirflowCommand(google::cloud::orchestration::airflow::service::v1::StopAirflowCommandRequest const &, Options)

Stops Airflow CLI command execution.

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::StopAirflowCommandRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::orchestration::airflow::service::v1::StopAirflowCommandResponse >

the result of the RPC. The response message type (google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

PollAirflowCommand(google::cloud::orchestration::airflow::service::v1::PollAirflowCommandRequest const &, Options)

Polls Airflow CLI command execution and fetches logs.

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::PollAirflowCommandRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::orchestration::airflow::service::v1::PollAirflowCommandResponse >

the result of the RPC. The response message type (google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

SaveSnapshot(google::cloud::orchestration::airflow::service::v1::SaveSnapshotRequest const &, Options)

Creates a snapshots of a Cloud Composer environment.

As a result of this operation, snapshot of environment's state is stored in a location specified in the SaveSnapshotRequest.

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::SaveSnapshotRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::orchestration::airflow::service::v1::SaveSnapshotResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

LoadSnapshot(google::cloud::orchestration::airflow::service::v1::LoadSnapshotRequest const &, Options)

Loads a snapshot of a Cloud Composer environment.

As a result of this operation, a snapshot of environment's specified in LoadSnapshotRequest is loaded into the environment.

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::LoadSnapshotRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::orchestration::airflow::service::v1::LoadSnapshotResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DatabaseFailover(google::cloud::orchestration::airflow::service::v1::DatabaseFailoverRequest const &, Options)

Triggers database failover (only for highly resilient environments).

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::DatabaseFailoverRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::orchestration::airflow::service::v1::DatabaseFailoverResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

FetchDatabaseProperties(google::cloud::orchestration::airflow::service::v1::FetchDatabasePropertiesRequest const &, Options)

Fetches database properties.

Parameters
Name Description
request google::cloud::orchestration::airflow::service::v1::FetchDatabasePropertiesRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::orchestration::airflow::service::v1::FetchDatabasePropertiesResponse >

the result of the RPC. The response message type (google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.