databaseFailoverAsync(
+ DatabaseFailoverRequest request) {
+ return databaseFailoverOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Triggers database failover (only for highly resilient environments).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * DatabaseFailoverRequest request =
+ * DatabaseFailoverRequest.newBuilder().setEnvironment("environment-85904877").build();
+ * OperationFuture future =
+ * environmentsClient.databaseFailoverOperationCallable().futureCall(request);
+ * // Do something.
+ * DatabaseFailoverResponse response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
+ databaseFailoverOperationCallable() {
+ return stub.databaseFailoverOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Triggers database failover (only for highly resilient environments).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * DatabaseFailoverRequest request =
+ * DatabaseFailoverRequest.newBuilder().setEnvironment("environment-85904877").build();
+ * ApiFuture future =
+ * environmentsClient.databaseFailoverCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable databaseFailoverCallable() {
+ return stub.databaseFailoverCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetches database properties.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * FetchDatabasePropertiesRequest request =
+ * FetchDatabasePropertiesRequest.newBuilder()
+ * .setEnvironment(
+ * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[ENVIRONMENT]").toString())
+ * .build();
+ * FetchDatabasePropertiesResponse response =
+ * environmentsClient.fetchDatabaseProperties(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchDatabasePropertiesResponse fetchDatabaseProperties(
+ FetchDatabasePropertiesRequest request) {
+ return fetchDatabasePropertiesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetches database properties.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * FetchDatabasePropertiesRequest request =
+ * FetchDatabasePropertiesRequest.newBuilder()
+ * .setEnvironment(
+ * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[ENVIRONMENT]").toString())
+ * .build();
+ * ApiFuture future =
+ * environmentsClient.fetchDatabasePropertiesCallable().futureCall(request);
+ * // Do something.
+ * FetchDatabasePropertiesResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ fetchDatabasePropertiesCallable() {
+ return stub.fetchDatabasePropertiesCallable();
+ }
+
@Override
public final void close() {
stub.close();
diff --git a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/EnvironmentsSettings.java b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/EnvironmentsSettings.java
index d5d48b1b58ad..ef1c6dbab570 100644
--- a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/EnvironmentsSettings.java
+++ b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/EnvironmentsSettings.java
@@ -122,6 +122,24 @@ public UnaryCallSettings deleteEnvironmentS
return ((EnvironmentsStubSettings) getStubSettings()).deleteEnvironmentOperationSettings();
}
+ /** Returns the object with the settings used for calls to executeAirflowCommand. */
+ public UnaryCallSettings
+ executeAirflowCommandSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).executeAirflowCommandSettings();
+ }
+
+ /** Returns the object with the settings used for calls to stopAirflowCommand. */
+ public UnaryCallSettings
+ stopAirflowCommandSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).stopAirflowCommandSettings();
+ }
+
+ /** Returns the object with the settings used for calls to pollAirflowCommand. */
+ public UnaryCallSettings
+ pollAirflowCommandSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).pollAirflowCommandSettings();
+ }
+
/** Returns the object with the settings used for calls to saveSnapshot. */
public UnaryCallSettings saveSnapshotSettings() {
return ((EnvironmentsStubSettings) getStubSettings()).saveSnapshotSettings();
@@ -144,6 +162,23 @@ public UnaryCallSettings loadSnapshotSettings()
return ((EnvironmentsStubSettings) getStubSettings()).loadSnapshotOperationSettings();
}
+ /** Returns the object with the settings used for calls to databaseFailover. */
+ public UnaryCallSettings databaseFailoverSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).databaseFailoverSettings();
+ }
+
+ /** Returns the object with the settings used for calls to databaseFailover. */
+ public OperationCallSettings
+ databaseFailoverOperationSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).databaseFailoverOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to fetchDatabaseProperties. */
+ public UnaryCallSettings
+ fetchDatabasePropertiesSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).fetchDatabasePropertiesSettings();
+ }
+
public static final EnvironmentsSettings create(EnvironmentsStubSettings stub)
throws IOException {
return new EnvironmentsSettings.Builder(stub.toBuilder()).build();
@@ -307,6 +342,24 @@ public UnaryCallSettings.Builder getEnvironm
return getStubSettingsBuilder().deleteEnvironmentOperationSettings();
}
+ /** Returns the builder for the settings used for calls to executeAirflowCommand. */
+ public UnaryCallSettings.Builder
+ executeAirflowCommandSettings() {
+ return getStubSettingsBuilder().executeAirflowCommandSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to stopAirflowCommand. */
+ public UnaryCallSettings.Builder
+ stopAirflowCommandSettings() {
+ return getStubSettingsBuilder().stopAirflowCommandSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to pollAirflowCommand. */
+ public UnaryCallSettings.Builder
+ pollAirflowCommandSettings() {
+ return getStubSettingsBuilder().pollAirflowCommandSettings();
+ }
+
/** Returns the builder for the settings used for calls to saveSnapshot. */
public UnaryCallSettings.Builder saveSnapshotSettings() {
return getStubSettingsBuilder().saveSnapshotSettings();
@@ -331,6 +384,26 @@ public UnaryCallSettings.Builder loadSnapshotSet
return getStubSettingsBuilder().loadSnapshotOperationSettings();
}
+ /** Returns the builder for the settings used for calls to databaseFailover. */
+ public UnaryCallSettings.Builder
+ databaseFailoverSettings() {
+ return getStubSettingsBuilder().databaseFailoverSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to databaseFailover. */
+ public OperationCallSettings.Builder<
+ DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
+ databaseFailoverOperationSettings() {
+ return getStubSettingsBuilder().databaseFailoverOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to fetchDatabaseProperties. */
+ public UnaryCallSettings.Builder<
+ FetchDatabasePropertiesRequest, FetchDatabasePropertiesResponse>
+ fetchDatabasePropertiesSettings() {
+ return getStubSettingsBuilder().fetchDatabasePropertiesSettings();
+ }
+
@Override
public EnvironmentsSettings build() throws IOException {
return new EnvironmentsSettings(this);
diff --git a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/gapic_metadata.json b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/gapic_metadata.json
index a1322e3981e6..053720a2033e 100644
--- a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/gapic_metadata.json
+++ b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/gapic_metadata.json
@@ -13,9 +13,18 @@
"CreateEnvironment": {
"methods": ["createEnvironmentAsync", "createEnvironmentAsync", "createEnvironmentOperationCallable", "createEnvironmentCallable"]
},
+ "DatabaseFailover": {
+ "methods": ["databaseFailoverAsync", "databaseFailoverOperationCallable", "databaseFailoverCallable"]
+ },
"DeleteEnvironment": {
"methods": ["deleteEnvironmentAsync", "deleteEnvironmentAsync", "deleteEnvironmentOperationCallable", "deleteEnvironmentCallable"]
},
+ "ExecuteAirflowCommand": {
+ "methods": ["executeAirflowCommand", "executeAirflowCommandCallable"]
+ },
+ "FetchDatabaseProperties": {
+ "methods": ["fetchDatabaseProperties", "fetchDatabasePropertiesCallable"]
+ },
"GetEnvironment": {
"methods": ["getEnvironment", "getEnvironment", "getEnvironmentCallable"]
},
@@ -25,9 +34,15 @@
"LoadSnapshot": {
"methods": ["loadSnapshotAsync", "loadSnapshotOperationCallable", "loadSnapshotCallable"]
},
+ "PollAirflowCommand": {
+ "methods": ["pollAirflowCommand", "pollAirflowCommandCallable"]
+ },
"SaveSnapshot": {
"methods": ["saveSnapshotAsync", "saveSnapshotOperationCallable", "saveSnapshotCallable"]
},
+ "StopAirflowCommand": {
+ "methods": ["stopAirflowCommand", "stopAirflowCommandCallable"]
+ },
"UpdateEnvironment": {
"methods": ["updateEnvironmentAsync", "updateEnvironmentAsync", "updateEnvironmentOperationCallable", "updateEnvironmentCallable"]
}
diff --git a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/EnvironmentsStub.java b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/EnvironmentsStub.java
index ba53e14cb7f2..7462516e641d 100644
--- a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/EnvironmentsStub.java
+++ b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/EnvironmentsStub.java
@@ -22,16 +22,26 @@
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest;
+import com.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest;
+import com.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse;
import com.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1.Environment;
+import com.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse;
+import com.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest;
+import com.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse;
import com.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest;
import com.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsResponse;
import com.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse;
import com.google.cloud.orchestration.airflow.service.v1.OperationMetadata;
+import com.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse;
+import com.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
@@ -99,6 +109,21 @@ public UnaryCallable deleteEnvironmentCalla
throw new UnsupportedOperationException("Not implemented: deleteEnvironmentCallable()");
}
+ public UnaryCallable
+ executeAirflowCommandCallable() {
+ throw new UnsupportedOperationException("Not implemented: executeAirflowCommandCallable()");
+ }
+
+ public UnaryCallable
+ stopAirflowCommandCallable() {
+ throw new UnsupportedOperationException("Not implemented: stopAirflowCommandCallable()");
+ }
+
+ public UnaryCallable
+ pollAirflowCommandCallable() {
+ throw new UnsupportedOperationException("Not implemented: pollAirflowCommandCallable()");
+ }
+
public OperationCallable
saveSnapshotOperationCallable() {
throw new UnsupportedOperationException("Not implemented: saveSnapshotOperationCallable()");
@@ -117,6 +142,20 @@ public UnaryCallable loadSnapshotCallable() {
throw new UnsupportedOperationException("Not implemented: loadSnapshotCallable()");
}
+ public OperationCallable
+ databaseFailoverOperationCallable() {
+ throw new UnsupportedOperationException("Not implemented: databaseFailoverOperationCallable()");
+ }
+
+ public UnaryCallable databaseFailoverCallable() {
+ throw new UnsupportedOperationException("Not implemented: databaseFailoverCallable()");
+ }
+
+ public UnaryCallable
+ fetchDatabasePropertiesCallable() {
+ throw new UnsupportedOperationException("Not implemented: fetchDatabasePropertiesCallable()");
+ }
+
@Override
public abstract void close();
}
diff --git a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/EnvironmentsStubSettings.java b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/EnvironmentsStubSettings.java
index ccc8e7a6aa22..75a0652089c3 100644
--- a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/EnvironmentsStubSettings.java
+++ b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/EnvironmentsStubSettings.java
@@ -48,16 +48,26 @@
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest;
+import com.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest;
+import com.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse;
import com.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1.Environment;
+import com.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse;
+import com.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest;
+import com.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse;
import com.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest;
import com.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsResponse;
import com.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse;
import com.google.cloud.orchestration.airflow.service.v1.OperationMetadata;
+import com.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse;
+import com.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -126,12 +136,24 @@ public class EnvironmentsStubSettings extends StubSettings deleteEnvironmentSettings;
private final OperationCallSettings
deleteEnvironmentOperationSettings;
+ private final UnaryCallSettings
+ executeAirflowCommandSettings;
+ private final UnaryCallSettings
+ stopAirflowCommandSettings;
+ private final UnaryCallSettings
+ pollAirflowCommandSettings;
private final UnaryCallSettings saveSnapshotSettings;
private final OperationCallSettings
saveSnapshotOperationSettings;
private final UnaryCallSettings loadSnapshotSettings;
private final OperationCallSettings
loadSnapshotOperationSettings;
+ private final UnaryCallSettings databaseFailoverSettings;
+ private final OperationCallSettings<
+ DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
+ databaseFailoverOperationSettings;
+ private final UnaryCallSettings
+ fetchDatabasePropertiesSettings;
private static final PagedListDescriptor<
ListEnvironmentsRequest, ListEnvironmentsResponse, Environment>
@@ -237,6 +259,24 @@ public UnaryCallSettings deleteEnvironmentS
return deleteEnvironmentOperationSettings;
}
+ /** Returns the object with the settings used for calls to executeAirflowCommand. */
+ public UnaryCallSettings
+ executeAirflowCommandSettings() {
+ return executeAirflowCommandSettings;
+ }
+
+ /** Returns the object with the settings used for calls to stopAirflowCommand. */
+ public UnaryCallSettings
+ stopAirflowCommandSettings() {
+ return stopAirflowCommandSettings;
+ }
+
+ /** Returns the object with the settings used for calls to pollAirflowCommand. */
+ public UnaryCallSettings
+ pollAirflowCommandSettings() {
+ return pollAirflowCommandSettings;
+ }
+
/** Returns the object with the settings used for calls to saveSnapshot. */
public UnaryCallSettings saveSnapshotSettings() {
return saveSnapshotSettings;
@@ -259,6 +299,23 @@ public UnaryCallSettings loadSnapshotSettings()
return loadSnapshotOperationSettings;
}
+ /** Returns the object with the settings used for calls to databaseFailover. */
+ public UnaryCallSettings databaseFailoverSettings() {
+ return databaseFailoverSettings;
+ }
+
+ /** Returns the object with the settings used for calls to databaseFailover. */
+ public OperationCallSettings
+ databaseFailoverOperationSettings() {
+ return databaseFailoverOperationSettings;
+ }
+
+ /** Returns the object with the settings used for calls to fetchDatabaseProperties. */
+ public UnaryCallSettings
+ fetchDatabasePropertiesSettings() {
+ return fetchDatabasePropertiesSettings;
+ }
+
public EnvironmentsStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
@@ -376,10 +433,16 @@ protected EnvironmentsStubSettings(Builder settingsBuilder) throws IOException {
deleteEnvironmentSettings = settingsBuilder.deleteEnvironmentSettings().build();
deleteEnvironmentOperationSettings =
settingsBuilder.deleteEnvironmentOperationSettings().build();
+ executeAirflowCommandSettings = settingsBuilder.executeAirflowCommandSettings().build();
+ stopAirflowCommandSettings = settingsBuilder.stopAirflowCommandSettings().build();
+ pollAirflowCommandSettings = settingsBuilder.pollAirflowCommandSettings().build();
saveSnapshotSettings = settingsBuilder.saveSnapshotSettings().build();
saveSnapshotOperationSettings = settingsBuilder.saveSnapshotOperationSettings().build();
loadSnapshotSettings = settingsBuilder.loadSnapshotSettings().build();
loadSnapshotOperationSettings = settingsBuilder.loadSnapshotOperationSettings().build();
+ databaseFailoverSettings = settingsBuilder.databaseFailoverSettings().build();
+ databaseFailoverOperationSettings = settingsBuilder.databaseFailoverOperationSettings().build();
+ fetchDatabasePropertiesSettings = settingsBuilder.fetchDatabasePropertiesSettings().build();
}
/** Builder for EnvironmentsStubSettings. */
@@ -404,6 +467,13 @@ public static class Builder extends StubSettings.Builder
deleteEnvironmentOperationSettings;
+ private final UnaryCallSettings.Builder<
+ ExecuteAirflowCommandRequest, ExecuteAirflowCommandResponse>
+ executeAirflowCommandSettings;
+ private final UnaryCallSettings.Builder
+ stopAirflowCommandSettings;
+ private final UnaryCallSettings.Builder
+ pollAirflowCommandSettings;
private final UnaryCallSettings.Builder saveSnapshotSettings;
private final OperationCallSettings.Builder<
SaveSnapshotRequest, SaveSnapshotResponse, OperationMetadata>
@@ -412,6 +482,14 @@ public static class Builder extends StubSettings.Builder
loadSnapshotOperationSettings;
+ private final UnaryCallSettings.Builder
+ databaseFailoverSettings;
+ private final OperationCallSettings.Builder<
+ DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
+ databaseFailoverOperationSettings;
+ private final UnaryCallSettings.Builder<
+ FetchDatabasePropertiesRequest, FetchDatabasePropertiesResponse>
+ fetchDatabasePropertiesSettings;
private static final ImmutableMap>
RETRYABLE_CODE_DEFINITIONS;
@@ -447,10 +525,16 @@ protected Builder(ClientContext clientContext) {
updateEnvironmentOperationSettings = OperationCallSettings.newBuilder();
deleteEnvironmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteEnvironmentOperationSettings = OperationCallSettings.newBuilder();
+ executeAirflowCommandSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ stopAirflowCommandSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ pollAirflowCommandSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
saveSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
saveSnapshotOperationSettings = OperationCallSettings.newBuilder();
loadSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
loadSnapshotOperationSettings = OperationCallSettings.newBuilder();
+ databaseFailoverSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ databaseFailoverOperationSettings = OperationCallSettings.newBuilder();
+ fetchDatabasePropertiesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
@@ -459,8 +543,13 @@ protected Builder(ClientContext clientContext) {
listEnvironmentsSettings,
updateEnvironmentSettings,
deleteEnvironmentSettings,
+ executeAirflowCommandSettings,
+ stopAirflowCommandSettings,
+ pollAirflowCommandSettings,
saveSnapshotSettings,
- loadSnapshotSettings);
+ loadSnapshotSettings,
+ databaseFailoverSettings,
+ fetchDatabasePropertiesSettings);
initDefaults(this);
}
@@ -475,10 +564,16 @@ protected Builder(EnvironmentsStubSettings settings) {
updateEnvironmentOperationSettings = settings.updateEnvironmentOperationSettings.toBuilder();
deleteEnvironmentSettings = settings.deleteEnvironmentSettings.toBuilder();
deleteEnvironmentOperationSettings = settings.deleteEnvironmentOperationSettings.toBuilder();
+ executeAirflowCommandSettings = settings.executeAirflowCommandSettings.toBuilder();
+ stopAirflowCommandSettings = settings.stopAirflowCommandSettings.toBuilder();
+ pollAirflowCommandSettings = settings.pollAirflowCommandSettings.toBuilder();
saveSnapshotSettings = settings.saveSnapshotSettings.toBuilder();
saveSnapshotOperationSettings = settings.saveSnapshotOperationSettings.toBuilder();
loadSnapshotSettings = settings.loadSnapshotSettings.toBuilder();
loadSnapshotOperationSettings = settings.loadSnapshotOperationSettings.toBuilder();
+ databaseFailoverSettings = settings.databaseFailoverSettings.toBuilder();
+ databaseFailoverOperationSettings = settings.databaseFailoverOperationSettings.toBuilder();
+ fetchDatabasePropertiesSettings = settings.fetchDatabasePropertiesSettings.toBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
@@ -487,8 +582,13 @@ protected Builder(EnvironmentsStubSettings settings) {
listEnvironmentsSettings,
updateEnvironmentSettings,
deleteEnvironmentSettings,
+ executeAirflowCommandSettings,
+ stopAirflowCommandSettings,
+ pollAirflowCommandSettings,
saveSnapshotSettings,
- loadSnapshotSettings);
+ loadSnapshotSettings,
+ databaseFailoverSettings,
+ fetchDatabasePropertiesSettings);
}
private static Builder createDefault() {
@@ -543,6 +643,21 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+ builder
+ .executeAirflowCommandSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .stopAirflowCommandSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .pollAirflowCommandSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
builder
.saveSnapshotSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
@@ -553,6 +668,16 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+ builder
+ .databaseFailoverSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .fetchDatabasePropertiesSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
builder
.createEnvironmentOperationSettings()
.setInitialCallSettings(
@@ -673,6 +798,30 @@ private static Builder initDefaults(Builder builder) {
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
+ builder
+ .databaseFailoverOperationSettings()
+ .setInitialCallSettings(
+ UnaryCallSettings
+ .newUnaryCallSettingsBuilder()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"))
+ .build())
+ .setResponseTransformer(
+ ProtoOperationTransformers.ResponseTransformer.create(DatabaseFailoverResponse.class))
+ .setMetadataTransformer(
+ ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
+ .setPollingAlgorithm(
+ OperationTimedPollAlgorithm.create(
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.ofMillis(5000L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(45000L))
+ .setInitialRpcTimeout(Duration.ZERO)
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeout(Duration.ZERO)
+ .setTotalTimeout(Duration.ofMillis(300000L))
+ .build()));
+
return builder;
}
@@ -745,6 +894,24 @@ public UnaryCallSettings.Builder getEnvironm
return deleteEnvironmentOperationSettings;
}
+ /** Returns the builder for the settings used for calls to executeAirflowCommand. */
+ public UnaryCallSettings.Builder
+ executeAirflowCommandSettings() {
+ return executeAirflowCommandSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to stopAirflowCommand. */
+ public UnaryCallSettings.Builder
+ stopAirflowCommandSettings() {
+ return stopAirflowCommandSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to pollAirflowCommand. */
+ public UnaryCallSettings.Builder
+ pollAirflowCommandSettings() {
+ return pollAirflowCommandSettings;
+ }
+
/** Returns the builder for the settings used for calls to saveSnapshot. */
public UnaryCallSettings.Builder saveSnapshotSettings() {
return saveSnapshotSettings;
@@ -773,6 +940,28 @@ public UnaryCallSettings.Builder loadSnapshotSet
return loadSnapshotOperationSettings;
}
+ /** Returns the builder for the settings used for calls to databaseFailover. */
+ public UnaryCallSettings.Builder
+ databaseFailoverSettings() {
+ return databaseFailoverSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to databaseFailover. */
+ @BetaApi(
+ "The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder<
+ DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
+ databaseFailoverOperationSettings() {
+ return databaseFailoverOperationSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to fetchDatabaseProperties. */
+ public UnaryCallSettings.Builder<
+ FetchDatabasePropertiesRequest, FetchDatabasePropertiesResponse>
+ fetchDatabasePropertiesSettings() {
+ return fetchDatabasePropertiesSettings;
+ }
+
@Override
public EnvironmentsStubSettings build() throws IOException {
return new EnvironmentsStubSettings(this);
diff --git a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/GrpcEnvironmentsStub.java b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/GrpcEnvironmentsStub.java
index 5d44a4190e54..a9ebf64cc170 100644
--- a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/GrpcEnvironmentsStub.java
+++ b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/GrpcEnvironmentsStub.java
@@ -27,16 +27,26 @@
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest;
+import com.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest;
+import com.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse;
import com.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1.Environment;
+import com.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse;
+import com.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest;
+import com.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse;
import com.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest;
import com.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsResponse;
import com.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse;
import com.google.cloud.orchestration.airflow.service.v1.OperationMetadata;
+import com.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse;
+import com.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.GrpcOperationsStub;
@@ -111,6 +121,42 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub {
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
+ private static final MethodDescriptor
+ executeAirflowCommandMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.cloud.orchestration.airflow.service.v1.Environments/ExecuteAirflowCommand")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ExecuteAirflowCommandRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ExecuteAirflowCommandResponse.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ stopAirflowCommandMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.cloud.orchestration.airflow.service.v1.Environments/StopAirflowCommand")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(StopAirflowCommandRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(StopAirflowCommandResponse.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ pollAirflowCommandMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.cloud.orchestration.airflow.service.v1.Environments/PollAirflowCommand")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(PollAirflowCommandRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(PollAirflowCommandResponse.getDefaultInstance()))
+ .build();
+
private static final MethodDescriptor
saveSnapshotMethodDescriptor =
MethodDescriptor.newBuilder()
@@ -131,6 +177,31 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub {
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
+ private static final MethodDescriptor
+ databaseFailoverMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.cloud.orchestration.airflow.service.v1.Environments/DatabaseFailover")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(DatabaseFailoverRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor<
+ FetchDatabasePropertiesRequest, FetchDatabasePropertiesResponse>
+ fetchDatabasePropertiesMethodDescriptor =
+ MethodDescriptor
+ .newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.cloud.orchestration.airflow.service.v1.Environments/FetchDatabaseProperties")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(FetchDatabasePropertiesRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(FetchDatabasePropertiesResponse.getDefaultInstance()))
+ .build();
+
private final UnaryCallable createEnvironmentCallable;
private final OperationCallable
createEnvironmentOperationCallable;
@@ -145,12 +216,24 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub {
private final UnaryCallable deleteEnvironmentCallable;
private final OperationCallable
deleteEnvironmentOperationCallable;
+ private final UnaryCallable
+ executeAirflowCommandCallable;
+ private final UnaryCallable
+ stopAirflowCommandCallable;
+ private final UnaryCallable
+ pollAirflowCommandCallable;
private final UnaryCallable saveSnapshotCallable;
private final OperationCallable
saveSnapshotOperationCallable;
private final UnaryCallable loadSnapshotCallable;
private final OperationCallable
loadSnapshotOperationCallable;
+ private final UnaryCallable databaseFailoverCallable;
+ private final OperationCallable<
+ DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
+ databaseFailoverOperationCallable;
+ private final UnaryCallable
+ fetchDatabasePropertiesCallable;
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
@@ -245,6 +328,40 @@ protected GrpcEnvironmentsStub(
return builder.build();
})
.build();
+ GrpcCallSettings
+ executeAirflowCommandTransportSettings =
+ GrpcCallSettings
+ .newBuilder()
+ .setMethodDescriptor(executeAirflowCommandMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("environment", String.valueOf(request.getEnvironment()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings
+ stopAirflowCommandTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(stopAirflowCommandMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("environment", String.valueOf(request.getEnvironment()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings
+ pollAirflowCommandTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(pollAirflowCommandMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("environment", String.valueOf(request.getEnvironment()));
+ return builder.build();
+ })
+ .build();
GrpcCallSettings saveSnapshotTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(saveSnapshotMethodDescriptor)
@@ -265,6 +382,28 @@ protected GrpcEnvironmentsStub(
return builder.build();
})
.build();
+ GrpcCallSettings databaseFailoverTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(databaseFailoverMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("environment", String.valueOf(request.getEnvironment()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings
+ fetchDatabasePropertiesTransportSettings =
+ GrpcCallSettings
+ .newBuilder()
+ .setMethodDescriptor(fetchDatabasePropertiesMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("environment", String.valueOf(request.getEnvironment()));
+ return builder.build();
+ })
+ .build();
this.createEnvironmentCallable =
callableFactory.createUnaryCallable(
@@ -308,6 +447,21 @@ protected GrpcEnvironmentsStub(
settings.deleteEnvironmentOperationSettings(),
clientContext,
operationsStub);
+ this.executeAirflowCommandCallable =
+ callableFactory.createUnaryCallable(
+ executeAirflowCommandTransportSettings,
+ settings.executeAirflowCommandSettings(),
+ clientContext);
+ this.stopAirflowCommandCallable =
+ callableFactory.createUnaryCallable(
+ stopAirflowCommandTransportSettings,
+ settings.stopAirflowCommandSettings(),
+ clientContext);
+ this.pollAirflowCommandCallable =
+ callableFactory.createUnaryCallable(
+ pollAirflowCommandTransportSettings,
+ settings.pollAirflowCommandSettings(),
+ clientContext);
this.saveSnapshotCallable =
callableFactory.createUnaryCallable(
saveSnapshotTransportSettings, settings.saveSnapshotSettings(), clientContext);
@@ -326,6 +480,20 @@ protected GrpcEnvironmentsStub(
settings.loadSnapshotOperationSettings(),
clientContext,
operationsStub);
+ this.databaseFailoverCallable =
+ callableFactory.createUnaryCallable(
+ databaseFailoverTransportSettings, settings.databaseFailoverSettings(), clientContext);
+ this.databaseFailoverOperationCallable =
+ callableFactory.createOperationCallable(
+ databaseFailoverTransportSettings,
+ settings.databaseFailoverOperationSettings(),
+ clientContext,
+ operationsStub);
+ this.fetchDatabasePropertiesCallable =
+ callableFactory.createUnaryCallable(
+ fetchDatabasePropertiesTransportSettings,
+ settings.fetchDatabasePropertiesSettings(),
+ clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
@@ -385,6 +553,24 @@ public UnaryCallable deleteEnvironmentCalla
return deleteEnvironmentOperationCallable;
}
+ @Override
+ public UnaryCallable
+ executeAirflowCommandCallable() {
+ return executeAirflowCommandCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ stopAirflowCommandCallable() {
+ return stopAirflowCommandCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ pollAirflowCommandCallable() {
+ return pollAirflowCommandCallable;
+ }
+
@Override
public UnaryCallable saveSnapshotCallable() {
return saveSnapshotCallable;
@@ -407,6 +593,23 @@ public UnaryCallable loadSnapshotCallable() {
return loadSnapshotOperationCallable;
}
+ @Override
+ public UnaryCallable databaseFailoverCallable() {
+ return databaseFailoverCallable;
+ }
+
+ @Override
+ public OperationCallable
+ databaseFailoverOperationCallable() {
+ return databaseFailoverOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ fetchDatabasePropertiesCallable() {
+ return fetchDatabasePropertiesCallable;
+ }
+
@Override
public final void close() {
try {
diff --git a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/HttpJsonEnvironmentsStub.java b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/HttpJsonEnvironmentsStub.java
index 28d252159b8c..125086b06c30 100644
--- a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/HttpJsonEnvironmentsStub.java
+++ b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1/stub/HttpJsonEnvironmentsStub.java
@@ -36,16 +36,26 @@
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest;
+import com.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverRequest;
+import com.google.cloud.orchestration.airflow.service.v1.DatabaseFailoverResponse;
import com.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1.Environment;
+import com.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.ExecuteAirflowCommandResponse;
+import com.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesRequest;
+import com.google.cloud.orchestration.airflow.service.v1.FetchDatabasePropertiesResponse;
import com.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest;
import com.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsResponse;
import com.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse;
import com.google.cloud.orchestration.airflow.service.v1.OperationMetadata;
+import com.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.PollAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse;
+import com.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1.StopAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest;
import com.google.common.collect.ImmutableMap;
import com.google.longrunning.Operation;
@@ -70,6 +80,7 @@
public class HttpJsonEnvironmentsStub extends EnvironmentsStub {
private static final TypeRegistry typeRegistry =
TypeRegistry.newBuilder()
+ .add(DatabaseFailoverResponse.getDescriptor())
.add(Environment.getDescriptor())
.add(Empty.getDescriptor())
.add(OperationMetadata.getDescriptor())
@@ -270,6 +281,128 @@ public class HttpJsonEnvironmentsStub extends EnvironmentsStub {
HttpJsonOperationSnapshot.create(response))
.build();
+ private static final ApiMethodDescriptor<
+ ExecuteAirflowCommandRequest, ExecuteAirflowCommandResponse>
+ executeAirflowCommandMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName(
+ "google.cloud.orchestration.airflow.service.v1.Environments/ExecuteAirflowCommand")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{environment=projects/*/locations/*/environments/*}:executeAirflowCommand",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "environment", request.getEnvironment());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody(
+ "*", request.toBuilder().clearEnvironment().build(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ExecuteAirflowCommandResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ stopAirflowCommandMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.orchestration.airflow.service.v1.Environments/StopAirflowCommand")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{environment=projects/*/locations/*/environments/*}:stopAirflowCommand",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "environment", request.getEnvironment());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody(
+ "*", request.toBuilder().clearEnvironment().build(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(StopAirflowCommandResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ pollAirflowCommandMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.orchestration.airflow.service.v1.Environments/PollAirflowCommand")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{environment=projects/*/locations/*/environments/*}:pollAirflowCommand",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "environment", request.getEnvironment());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody(
+ "*", request.toBuilder().clearEnvironment().build(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(PollAirflowCommandResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
private static final ApiMethodDescriptor
saveSnapshotMethodDescriptor =
ApiMethodDescriptor.newBuilder()
@@ -356,6 +489,87 @@ public class HttpJsonEnvironmentsStub extends EnvironmentsStub {
HttpJsonOperationSnapshot.create(response))
.build();
+ private static final ApiMethodDescriptor
+ databaseFailoverMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.orchestration.airflow.service.v1.Environments/DatabaseFailover")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{environment=projects/*/locations/*/environments/*}:databaseFailover",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "environment", request.getEnvironment());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody(
+ "*", request.toBuilder().clearEnvironment().build(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DatabaseFailoverRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor<
+ FetchDatabasePropertiesRequest, FetchDatabasePropertiesResponse>
+ fetchDatabasePropertiesMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName(
+ "google.cloud.orchestration.airflow.service.v1.Environments/FetchDatabaseProperties")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{environment=projects/*/locations/*/environments/*}:fetchDatabaseProperties",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "environment", request.getEnvironment());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(FetchDatabasePropertiesResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
private final UnaryCallable createEnvironmentCallable;
private final OperationCallable
createEnvironmentOperationCallable;
@@ -370,12 +584,24 @@ public class HttpJsonEnvironmentsStub extends EnvironmentsStub {
private final UnaryCallable deleteEnvironmentCallable;
private final OperationCallable
deleteEnvironmentOperationCallable;
+ private final UnaryCallable
+ executeAirflowCommandCallable;
+ private final UnaryCallable
+ stopAirflowCommandCallable;
+ private final UnaryCallable
+ pollAirflowCommandCallable;
private final UnaryCallable saveSnapshotCallable;
private final OperationCallable
saveSnapshotOperationCallable;
private final UnaryCallable loadSnapshotCallable;
private final OperationCallable
loadSnapshotOperationCallable;
+ private final UnaryCallable databaseFailoverCallable;
+ private final OperationCallable<
+ DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
+ databaseFailoverOperationCallable;
+ private final UnaryCallable
+ fetchDatabasePropertiesCallable;
private final BackgroundResource backgroundResources;
private final HttpJsonOperationsStub httpJsonOperationsStub;
@@ -498,6 +724,43 @@ protected HttpJsonEnvironmentsStub(
return builder.build();
})
.build();
+ HttpJsonCallSettings
+ executeAirflowCommandTransportSettings =
+ HttpJsonCallSettings
+ .newBuilder()
+ .setMethodDescriptor(executeAirflowCommandMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("environment", String.valueOf(request.getEnvironment()));
+ return builder.build();
+ })
+ .build();
+ HttpJsonCallSettings
+ stopAirflowCommandTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(stopAirflowCommandMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("environment", String.valueOf(request.getEnvironment()));
+ return builder.build();
+ })
+ .build();
+ HttpJsonCallSettings
+ pollAirflowCommandTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(pollAirflowCommandMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("environment", String.valueOf(request.getEnvironment()));
+ return builder.build();
+ })
+ .build();
HttpJsonCallSettings saveSnapshotTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(saveSnapshotMethodDescriptor)
@@ -520,6 +783,30 @@ protected HttpJsonEnvironmentsStub(
return builder.build();
})
.build();
+ HttpJsonCallSettings databaseFailoverTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(databaseFailoverMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("environment", String.valueOf(request.getEnvironment()));
+ return builder.build();
+ })
+ .build();
+ HttpJsonCallSettings
+ fetchDatabasePropertiesTransportSettings =
+ HttpJsonCallSettings
+ .newBuilder()
+ .setMethodDescriptor(fetchDatabasePropertiesMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("environment", String.valueOf(request.getEnvironment()));
+ return builder.build();
+ })
+ .build();
this.createEnvironmentCallable =
callableFactory.createUnaryCallable(
@@ -563,6 +850,21 @@ protected HttpJsonEnvironmentsStub(
settings.deleteEnvironmentOperationSettings(),
clientContext,
httpJsonOperationsStub);
+ this.executeAirflowCommandCallable =
+ callableFactory.createUnaryCallable(
+ executeAirflowCommandTransportSettings,
+ settings.executeAirflowCommandSettings(),
+ clientContext);
+ this.stopAirflowCommandCallable =
+ callableFactory.createUnaryCallable(
+ stopAirflowCommandTransportSettings,
+ settings.stopAirflowCommandSettings(),
+ clientContext);
+ this.pollAirflowCommandCallable =
+ callableFactory.createUnaryCallable(
+ pollAirflowCommandTransportSettings,
+ settings.pollAirflowCommandSettings(),
+ clientContext);
this.saveSnapshotCallable =
callableFactory.createUnaryCallable(
saveSnapshotTransportSettings, settings.saveSnapshotSettings(), clientContext);
@@ -581,6 +883,20 @@ protected HttpJsonEnvironmentsStub(
settings.loadSnapshotOperationSettings(),
clientContext,
httpJsonOperationsStub);
+ this.databaseFailoverCallable =
+ callableFactory.createUnaryCallable(
+ databaseFailoverTransportSettings, settings.databaseFailoverSettings(), clientContext);
+ this.databaseFailoverOperationCallable =
+ callableFactory.createOperationCallable(
+ databaseFailoverTransportSettings,
+ settings.databaseFailoverOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.fetchDatabasePropertiesCallable =
+ callableFactory.createUnaryCallable(
+ fetchDatabasePropertiesTransportSettings,
+ settings.fetchDatabasePropertiesSettings(),
+ clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
@@ -594,8 +910,13 @@ public static List getMethodDescriptors() {
methodDescriptors.add(listEnvironmentsMethodDescriptor);
methodDescriptors.add(updateEnvironmentMethodDescriptor);
methodDescriptors.add(deleteEnvironmentMethodDescriptor);
+ methodDescriptors.add(executeAirflowCommandMethodDescriptor);
+ methodDescriptors.add(stopAirflowCommandMethodDescriptor);
+ methodDescriptors.add(pollAirflowCommandMethodDescriptor);
methodDescriptors.add(saveSnapshotMethodDescriptor);
methodDescriptors.add(loadSnapshotMethodDescriptor);
+ methodDescriptors.add(databaseFailoverMethodDescriptor);
+ methodDescriptors.add(fetchDatabasePropertiesMethodDescriptor);
return methodDescriptors;
}
@@ -653,6 +974,24 @@ public UnaryCallable deleteEnvironmentCalla
return deleteEnvironmentOperationCallable;
}
+ @Override
+ public UnaryCallable
+ executeAirflowCommandCallable() {
+ return executeAirflowCommandCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ stopAirflowCommandCallable() {
+ return stopAirflowCommandCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ pollAirflowCommandCallable() {
+ return pollAirflowCommandCallable;
+ }
+
@Override
public UnaryCallable saveSnapshotCallable() {
return saveSnapshotCallable;
@@ -675,6 +1014,23 @@ public UnaryCallable loadSnapshotCallable() {
return loadSnapshotOperationCallable;
}
+ @Override
+ public UnaryCallable databaseFailoverCallable() {
+ return databaseFailoverCallable;
+ }
+
+ @Override
+ public OperationCallable
+ databaseFailoverOperationCallable() {
+ return databaseFailoverOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ fetchDatabasePropertiesCallable() {
+ return fetchDatabasePropertiesCallable;
+ }
+
@Override
public final void close() {
try {
diff --git a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/EnvironmentsClient.java b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/EnvironmentsClient.java
index 39d8e13064cb..6c9162cd95ee 100644
--- a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/EnvironmentsClient.java
+++ b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/EnvironmentsClient.java
@@ -1038,6 +1038,200 @@ public final UnaryCallable checkUpgradeCallable(
return stub.checkUpgradeCallable();
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Executes Airflow CLI command.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * ExecuteAirflowCommandRequest request =
+ * ExecuteAirflowCommandRequest.newBuilder()
+ * .setEnvironment("environment-85904877")
+ * .setCommand("command950394699")
+ * .setSubcommand("subcommand2099091723")
+ * .addAllParameters(new ArrayList())
+ * .build();
+ * ExecuteAirflowCommandResponse response = environmentsClient.executeAirflowCommand(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ExecuteAirflowCommandResponse executeAirflowCommand(
+ ExecuteAirflowCommandRequest request) {
+ return executeAirflowCommandCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Executes Airflow CLI command.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * ExecuteAirflowCommandRequest request =
+ * ExecuteAirflowCommandRequest.newBuilder()
+ * .setEnvironment("environment-85904877")
+ * .setCommand("command950394699")
+ * .setSubcommand("subcommand2099091723")
+ * .addAllParameters(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * environmentsClient.executeAirflowCommandCallable().futureCall(request);
+ * // Do something.
+ * ExecuteAirflowCommandResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ executeAirflowCommandCallable() {
+ return stub.executeAirflowCommandCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Stops Airflow CLI command execution.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * StopAirflowCommandRequest request =
+ * StopAirflowCommandRequest.newBuilder()
+ * .setEnvironment("environment-85904877")
+ * .setExecutionId("executionId-454906285")
+ * .setPod("pod111173")
+ * .setPodNamespace("podNamespace463962262")
+ * .setForce(true)
+ * .build();
+ * StopAirflowCommandResponse response = environmentsClient.stopAirflowCommand(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final StopAirflowCommandResponse stopAirflowCommand(StopAirflowCommandRequest request) {
+ return stopAirflowCommandCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Stops Airflow CLI command execution.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * StopAirflowCommandRequest request =
+ * StopAirflowCommandRequest.newBuilder()
+ * .setEnvironment("environment-85904877")
+ * .setExecutionId("executionId-454906285")
+ * .setPod("pod111173")
+ * .setPodNamespace("podNamespace463962262")
+ * .setForce(true)
+ * .build();
+ * ApiFuture future =
+ * environmentsClient.stopAirflowCommandCallable().futureCall(request);
+ * // Do something.
+ * StopAirflowCommandResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ stopAirflowCommandCallable() {
+ return stub.stopAirflowCommandCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Polls Airflow CLI command execution and fetches logs.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * PollAirflowCommandRequest request =
+ * PollAirflowCommandRequest.newBuilder()
+ * .setEnvironment("environment-85904877")
+ * .setExecutionId("executionId-454906285")
+ * .setPod("pod111173")
+ * .setPodNamespace("podNamespace463962262")
+ * .setNextLineNumber(1176642216)
+ * .build();
+ * PollAirflowCommandResponse response = environmentsClient.pollAirflowCommand(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PollAirflowCommandResponse pollAirflowCommand(PollAirflowCommandRequest request) {
+ return pollAirflowCommandCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Polls Airflow CLI command execution and fetches logs.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * PollAirflowCommandRequest request =
+ * PollAirflowCommandRequest.newBuilder()
+ * .setEnvironment("environment-85904877")
+ * .setExecutionId("executionId-454906285")
+ * .setPod("pod111173")
+ * .setPodNamespace("podNamespace463962262")
+ * .setNextLineNumber(1176642216)
+ * .build();
+ * ApiFuture future =
+ * environmentsClient.pollAirflowCommandCallable().futureCall(request);
+ * // Do something.
+ * PollAirflowCommandResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ pollAirflowCommandCallable() {
+ return stub.pollAirflowCommandCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a snapshots of a Cloud Composer environment.
@@ -1244,6 +1438,148 @@ public final UnaryCallable loadSnapshotCallable(
return stub.loadSnapshotCallable();
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Triggers database failover (only for highly resilient environments).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * DatabaseFailoverRequest request =
+ * DatabaseFailoverRequest.newBuilder().setEnvironment("environment-85904877").build();
+ * DatabaseFailoverResponse response = environmentsClient.databaseFailoverAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture databaseFailoverAsync(
+ DatabaseFailoverRequest request) {
+ return databaseFailoverOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Triggers database failover (only for highly resilient environments).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * DatabaseFailoverRequest request =
+ * DatabaseFailoverRequest.newBuilder().setEnvironment("environment-85904877").build();
+ * OperationFuture future =
+ * environmentsClient.databaseFailoverOperationCallable().futureCall(request);
+ * // Do something.
+ * DatabaseFailoverResponse response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
+ databaseFailoverOperationCallable() {
+ return stub.databaseFailoverOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Triggers database failover (only for highly resilient environments).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * DatabaseFailoverRequest request =
+ * DatabaseFailoverRequest.newBuilder().setEnvironment("environment-85904877").build();
+ * ApiFuture future =
+ * environmentsClient.databaseFailoverCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable databaseFailoverCallable() {
+ return stub.databaseFailoverCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetches database properties.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * FetchDatabasePropertiesRequest request =
+ * FetchDatabasePropertiesRequest.newBuilder()
+ * .setEnvironment(
+ * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[ENVIRONMENT]").toString())
+ * .build();
+ * FetchDatabasePropertiesResponse response =
+ * environmentsClient.fetchDatabaseProperties(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchDatabasePropertiesResponse fetchDatabaseProperties(
+ FetchDatabasePropertiesRequest request) {
+ return fetchDatabasePropertiesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetches database properties.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
+ * FetchDatabasePropertiesRequest request =
+ * FetchDatabasePropertiesRequest.newBuilder()
+ * .setEnvironment(
+ * EnvironmentName.of("[PROJECT]", "[LOCATION]", "[ENVIRONMENT]").toString())
+ * .build();
+ * ApiFuture future =
+ * environmentsClient.fetchDatabasePropertiesCallable().futureCall(request);
+ * // Do something.
+ * FetchDatabasePropertiesResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ fetchDatabasePropertiesCallable() {
+ return stub.fetchDatabasePropertiesCallable();
+ }
+
@Override
public final void close() {
stub.close();
diff --git a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/EnvironmentsSettings.java b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/EnvironmentsSettings.java
index 54627d184b90..16e8d07d0be4 100644
--- a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/EnvironmentsSettings.java
+++ b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/EnvironmentsSettings.java
@@ -145,6 +145,24 @@ public UnaryCallSettings checkUpgradeSettings()
return ((EnvironmentsStubSettings) getStubSettings()).checkUpgradeOperationSettings();
}
+ /** Returns the object with the settings used for calls to executeAirflowCommand. */
+ public UnaryCallSettings
+ executeAirflowCommandSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).executeAirflowCommandSettings();
+ }
+
+ /** Returns the object with the settings used for calls to stopAirflowCommand. */
+ public UnaryCallSettings
+ stopAirflowCommandSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).stopAirflowCommandSettings();
+ }
+
+ /** Returns the object with the settings used for calls to pollAirflowCommand. */
+ public UnaryCallSettings
+ pollAirflowCommandSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).pollAirflowCommandSettings();
+ }
+
/** Returns the object with the settings used for calls to saveSnapshot. */
public UnaryCallSettings saveSnapshotSettings() {
return ((EnvironmentsStubSettings) getStubSettings()).saveSnapshotSettings();
@@ -167,6 +185,23 @@ public UnaryCallSettings loadSnapshotSettings()
return ((EnvironmentsStubSettings) getStubSettings()).loadSnapshotOperationSettings();
}
+ /** Returns the object with the settings used for calls to databaseFailover. */
+ public UnaryCallSettings databaseFailoverSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).databaseFailoverSettings();
+ }
+
+ /** Returns the object with the settings used for calls to databaseFailover. */
+ public OperationCallSettings
+ databaseFailoverOperationSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).databaseFailoverOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to fetchDatabaseProperties. */
+ public UnaryCallSettings
+ fetchDatabasePropertiesSettings() {
+ return ((EnvironmentsStubSettings) getStubSettings()).fetchDatabasePropertiesSettings();
+ }
+
public static final EnvironmentsSettings create(EnvironmentsStubSettings stub)
throws IOException {
return new EnvironmentsSettings.Builder(stub.toBuilder()).build();
@@ -354,6 +389,24 @@ public UnaryCallSettings.Builder checkUpgradeSet
return getStubSettingsBuilder().checkUpgradeOperationSettings();
}
+ /** Returns the builder for the settings used for calls to executeAirflowCommand. */
+ public UnaryCallSettings.Builder
+ executeAirflowCommandSettings() {
+ return getStubSettingsBuilder().executeAirflowCommandSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to stopAirflowCommand. */
+ public UnaryCallSettings.Builder
+ stopAirflowCommandSettings() {
+ return getStubSettingsBuilder().stopAirflowCommandSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to pollAirflowCommand. */
+ public UnaryCallSettings.Builder
+ pollAirflowCommandSettings() {
+ return getStubSettingsBuilder().pollAirflowCommandSettings();
+ }
+
/** Returns the builder for the settings used for calls to saveSnapshot. */
public UnaryCallSettings.Builder saveSnapshotSettings() {
return getStubSettingsBuilder().saveSnapshotSettings();
@@ -378,6 +431,26 @@ public UnaryCallSettings.Builder loadSnapshotSet
return getStubSettingsBuilder().loadSnapshotOperationSettings();
}
+ /** Returns the builder for the settings used for calls to databaseFailover. */
+ public UnaryCallSettings.Builder
+ databaseFailoverSettings() {
+ return getStubSettingsBuilder().databaseFailoverSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to databaseFailover. */
+ public OperationCallSettings.Builder<
+ DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
+ databaseFailoverOperationSettings() {
+ return getStubSettingsBuilder().databaseFailoverOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to fetchDatabaseProperties. */
+ public UnaryCallSettings.Builder<
+ FetchDatabasePropertiesRequest, FetchDatabasePropertiesResponse>
+ fetchDatabasePropertiesSettings() {
+ return getStubSettingsBuilder().fetchDatabasePropertiesSettings();
+ }
+
@Override
public EnvironmentsSettings build() throws IOException {
return new EnvironmentsSettings(this);
diff --git a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/gapic_metadata.json b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/gapic_metadata.json
index 7dc984174935..a622da8ed259 100644
--- a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/gapic_metadata.json
+++ b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/gapic_metadata.json
@@ -16,9 +16,18 @@
"CreateEnvironment": {
"methods": ["createEnvironmentAsync", "createEnvironmentAsync", "createEnvironmentOperationCallable", "createEnvironmentCallable"]
},
+ "DatabaseFailover": {
+ "methods": ["databaseFailoverAsync", "databaseFailoverOperationCallable", "databaseFailoverCallable"]
+ },
"DeleteEnvironment": {
"methods": ["deleteEnvironmentAsync", "deleteEnvironmentAsync", "deleteEnvironmentOperationCallable", "deleteEnvironmentCallable"]
},
+ "ExecuteAirflowCommand": {
+ "methods": ["executeAirflowCommand", "executeAirflowCommandCallable"]
+ },
+ "FetchDatabaseProperties": {
+ "methods": ["fetchDatabaseProperties", "fetchDatabasePropertiesCallable"]
+ },
"GetEnvironment": {
"methods": ["getEnvironment", "getEnvironment", "getEnvironmentCallable"]
},
@@ -28,12 +37,18 @@
"LoadSnapshot": {
"methods": ["loadSnapshotAsync", "loadSnapshotOperationCallable", "loadSnapshotCallable"]
},
+ "PollAirflowCommand": {
+ "methods": ["pollAirflowCommand", "pollAirflowCommandCallable"]
+ },
"RestartWebServer": {
"methods": ["restartWebServerAsync", "restartWebServerOperationCallable", "restartWebServerCallable"]
},
"SaveSnapshot": {
"methods": ["saveSnapshotAsync", "saveSnapshotOperationCallable", "saveSnapshotCallable"]
},
+ "StopAirflowCommand": {
+ "methods": ["stopAirflowCommand", "stopAirflowCommandCallable"]
+ },
"UpdateEnvironment": {
"methods": ["updateEnvironmentAsync", "updateEnvironmentAsync", "updateEnvironmentOperationCallable", "updateEnvironmentCallable"]
}
diff --git a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/stub/EnvironmentsStub.java b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/stub/EnvironmentsStub.java
index 3f54f7cca523..9aa91c367bb6 100644
--- a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/stub/EnvironmentsStub.java
+++ b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/stub/EnvironmentsStub.java
@@ -25,17 +25,27 @@
import com.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.Environment;
+import com.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse;
+import com.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata;
+import com.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse;
+import com.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
@@ -122,6 +132,21 @@ public UnaryCallable checkUpgradeCallable() {
throw new UnsupportedOperationException("Not implemented: checkUpgradeCallable()");
}
+ public UnaryCallable
+ executeAirflowCommandCallable() {
+ throw new UnsupportedOperationException("Not implemented: executeAirflowCommandCallable()");
+ }
+
+ public UnaryCallable
+ stopAirflowCommandCallable() {
+ throw new UnsupportedOperationException("Not implemented: stopAirflowCommandCallable()");
+ }
+
+ public UnaryCallable
+ pollAirflowCommandCallable() {
+ throw new UnsupportedOperationException("Not implemented: pollAirflowCommandCallable()");
+ }
+
public OperationCallable
saveSnapshotOperationCallable() {
throw new UnsupportedOperationException("Not implemented: saveSnapshotOperationCallable()");
@@ -140,6 +165,20 @@ public UnaryCallable loadSnapshotCallable() {
throw new UnsupportedOperationException("Not implemented: loadSnapshotCallable()");
}
+ public OperationCallable
+ databaseFailoverOperationCallable() {
+ throw new UnsupportedOperationException("Not implemented: databaseFailoverOperationCallable()");
+ }
+
+ public UnaryCallable databaseFailoverCallable() {
+ throw new UnsupportedOperationException("Not implemented: databaseFailoverCallable()");
+ }
+
+ public UnaryCallable
+ fetchDatabasePropertiesCallable() {
+ throw new UnsupportedOperationException("Not implemented: fetchDatabasePropertiesCallable()");
+ }
+
@Override
public abstract void close();
}
diff --git a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/stub/EnvironmentsStubSettings.java b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/stub/EnvironmentsStubSettings.java
index 8f494a5ea217..5c7ad30cd3f3 100644
--- a/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/stub/EnvironmentsStubSettings.java
+++ b/java-orchestration-airflow/google-cloud-orchestration-airflow/src/main/java/com/google/cloud/orchestration/airflow/service/v1beta1/stub/EnvironmentsStubSettings.java
@@ -50,17 +50,27 @@
import com.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.DatabaseFailoverResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.Environment;
+import com.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse;
+import com.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.FetchDatabasePropertiesResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata;
+import com.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest;
import com.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse;
+import com.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandRequest;
+import com.google.cloud.orchestration.airflow.service.v1beta1.StopAirflowCommandResponse;
import com.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -136,12 +146,24 @@ public class EnvironmentsStubSettings extends StubSettings checkUpgradeSettings;
private final OperationCallSettings
checkUpgradeOperationSettings;
+ private final UnaryCallSettings
+ executeAirflowCommandSettings;
+ private final UnaryCallSettings
+ stopAirflowCommandSettings;
+ private final UnaryCallSettings
+ pollAirflowCommandSettings;
private final UnaryCallSettings saveSnapshotSettings;
private final OperationCallSettings
saveSnapshotOperationSettings;
private final UnaryCallSettings loadSnapshotSettings;
private final OperationCallSettings
loadSnapshotOperationSettings;
+ private final UnaryCallSettings databaseFailoverSettings;
+ private final OperationCallSettings<
+ DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
+ databaseFailoverOperationSettings;
+ private final UnaryCallSettings
+ fetchDatabasePropertiesSettings;
private static final PagedListDescriptor<
ListEnvironmentsRequest, ListEnvironmentsResponse, Environment>
@@ -269,6 +291,24 @@ public UnaryCallSettings checkUpgradeSettings()
return checkUpgradeOperationSettings;
}
+ /** Returns the object with the settings used for calls to executeAirflowCommand. */
+ public UnaryCallSettings
+ executeAirflowCommandSettings() {
+ return executeAirflowCommandSettings;
+ }
+
+ /** Returns the object with the settings used for calls to stopAirflowCommand. */
+ public UnaryCallSettings
+ stopAirflowCommandSettings() {
+ return stopAirflowCommandSettings;
+ }
+
+ /** Returns the object with the settings used for calls to pollAirflowCommand. */
+ public UnaryCallSettings
+ pollAirflowCommandSettings() {
+ return pollAirflowCommandSettings;
+ }
+
/** Returns the object with the settings used for calls to saveSnapshot. */
public UnaryCallSettings saveSnapshotSettings() {
return saveSnapshotSettings;
@@ -291,6 +331,23 @@ public UnaryCallSettings loadSnapshotSettings()
return loadSnapshotOperationSettings;
}
+ /** Returns the object with the settings used for calls to databaseFailover. */
+ public UnaryCallSettings databaseFailoverSettings() {
+ return databaseFailoverSettings;
+ }
+
+ /** Returns the object with the settings used for calls to databaseFailover. */
+ public OperationCallSettings
+ databaseFailoverOperationSettings() {
+ return databaseFailoverOperationSettings;
+ }
+
+ /** Returns the object with the settings used for calls to fetchDatabaseProperties. */
+ public UnaryCallSettings
+ fetchDatabasePropertiesSettings() {
+ return fetchDatabasePropertiesSettings;
+ }
+
public EnvironmentsStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
@@ -412,10 +469,16 @@ protected EnvironmentsStubSettings(Builder settingsBuilder) throws IOException {
restartWebServerOperationSettings = settingsBuilder.restartWebServerOperationSettings().build();
checkUpgradeSettings = settingsBuilder.checkUpgradeSettings().build();
checkUpgradeOperationSettings = settingsBuilder.checkUpgradeOperationSettings().build();
+ executeAirflowCommandSettings = settingsBuilder.executeAirflowCommandSettings().build();
+ stopAirflowCommandSettings = settingsBuilder.stopAirflowCommandSettings().build();
+ pollAirflowCommandSettings = settingsBuilder.pollAirflowCommandSettings().build();
saveSnapshotSettings = settingsBuilder.saveSnapshotSettings().build();
saveSnapshotOperationSettings = settingsBuilder.saveSnapshotOperationSettings().build();
loadSnapshotSettings = settingsBuilder.loadSnapshotSettings().build();
loadSnapshotOperationSettings = settingsBuilder.loadSnapshotOperationSettings().build();
+ databaseFailoverSettings = settingsBuilder.databaseFailoverSettings().build();
+ databaseFailoverOperationSettings = settingsBuilder.databaseFailoverOperationSettings().build();
+ fetchDatabasePropertiesSettings = settingsBuilder.fetchDatabasePropertiesSettings().build();
}
/** Builder for EnvironmentsStubSettings. */
@@ -449,6 +512,13 @@ public static class Builder extends StubSettings.Builder
checkUpgradeOperationSettings;
+ private final UnaryCallSettings.Builder<
+ ExecuteAirflowCommandRequest, ExecuteAirflowCommandResponse>
+ executeAirflowCommandSettings;
+ private final UnaryCallSettings.Builder
+ stopAirflowCommandSettings;
+ private final UnaryCallSettings.Builder
+ pollAirflowCommandSettings;
private final UnaryCallSettings.Builder saveSnapshotSettings;
private final OperationCallSettings.Builder<
SaveSnapshotRequest, SaveSnapshotResponse, OperationMetadata>
@@ -457,6 +527,14 @@ public static class Builder extends StubSettings.Builder
loadSnapshotOperationSettings;
+ private final UnaryCallSettings.Builder
+ databaseFailoverSettings;
+ private final OperationCallSettings.Builder<
+ DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
+ databaseFailoverOperationSettings;
+ private final UnaryCallSettings.Builder<
+ FetchDatabasePropertiesRequest, FetchDatabasePropertiesResponse>
+ fetchDatabasePropertiesSettings;
private static final ImmutableMap>
RETRYABLE_CODE_DEFINITIONS;
@@ -496,10 +574,16 @@ protected Builder(ClientContext clientContext) {
restartWebServerOperationSettings = OperationCallSettings.newBuilder();
checkUpgradeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
checkUpgradeOperationSettings = OperationCallSettings.newBuilder();
+ executeAirflowCommandSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ stopAirflowCommandSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ pollAirflowCommandSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
saveSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
saveSnapshotOperationSettings = OperationCallSettings.newBuilder();
loadSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
loadSnapshotOperationSettings = OperationCallSettings.newBuilder();
+ databaseFailoverSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ databaseFailoverOperationSettings = OperationCallSettings.newBuilder();
+ fetchDatabasePropertiesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
@@ -510,8 +594,13 @@ protected Builder(ClientContext clientContext) {
deleteEnvironmentSettings,
restartWebServerSettings,
checkUpgradeSettings,
+ executeAirflowCommandSettings,
+ stopAirflowCommandSettings,
+ pollAirflowCommandSettings,
saveSnapshotSettings,
- loadSnapshotSettings);
+ loadSnapshotSettings,
+ databaseFailoverSettings,
+ fetchDatabasePropertiesSettings);
initDefaults(this);
}
@@ -530,10 +619,16 @@ protected Builder(EnvironmentsStubSettings settings) {
restartWebServerOperationSettings = settings.restartWebServerOperationSettings.toBuilder();
checkUpgradeSettings = settings.checkUpgradeSettings.toBuilder();
checkUpgradeOperationSettings = settings.checkUpgradeOperationSettings.toBuilder();
+ executeAirflowCommandSettings = settings.executeAirflowCommandSettings.toBuilder();
+ stopAirflowCommandSettings = settings.stopAirflowCommandSettings.toBuilder();
+ pollAirflowCommandSettings = settings.pollAirflowCommandSettings.toBuilder();
saveSnapshotSettings = settings.saveSnapshotSettings.toBuilder();
saveSnapshotOperationSettings = settings.saveSnapshotOperationSettings.toBuilder();
loadSnapshotSettings = settings.loadSnapshotSettings.toBuilder();
loadSnapshotOperationSettings = settings.loadSnapshotOperationSettings.toBuilder();
+ databaseFailoverSettings = settings.databaseFailoverSettings.toBuilder();
+ databaseFailoverOperationSettings = settings.databaseFailoverOperationSettings.toBuilder();
+ fetchDatabasePropertiesSettings = settings.fetchDatabasePropertiesSettings.toBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
@@ -544,8 +639,13 @@ protected Builder(EnvironmentsStubSettings settings) {
deleteEnvironmentSettings,
restartWebServerSettings,
checkUpgradeSettings,
+ executeAirflowCommandSettings,
+ stopAirflowCommandSettings,
+ pollAirflowCommandSettings,
saveSnapshotSettings,
- loadSnapshotSettings);
+ loadSnapshotSettings,
+ databaseFailoverSettings,
+ fetchDatabasePropertiesSettings);
}
private static Builder createDefault() {
@@ -610,6 +710,21 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+ builder
+ .executeAirflowCommandSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .stopAirflowCommandSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .pollAirflowCommandSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
builder
.saveSnapshotSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
@@ -620,6 +735,16 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+ builder
+ .databaseFailoverSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .fetchDatabasePropertiesSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
builder
.createEnvironmentOperationSettings()
.setInitialCallSettings(
@@ -788,6 +913,30 @@ private static Builder initDefaults(Builder builder) {
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));
+ builder
+ .databaseFailoverOperationSettings()
+ .setInitialCallSettings(
+ UnaryCallSettings
+ .newUnaryCallSettingsBuilder()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"))
+ .build())
+ .setResponseTransformer(
+ ProtoOperationTransformers.ResponseTransformer.create(DatabaseFailoverResponse.class))
+ .setMetadataTransformer(
+ ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
+ .setPollingAlgorithm(
+ OperationTimedPollAlgorithm.create(
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.ofMillis(5000L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(45000L))
+ .setInitialRpcTimeout(Duration.ZERO)
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeout(Duration.ZERO)
+ .setTotalTimeout(Duration.ofMillis(300000L))
+ .build()));
+
return builder;
}
@@ -888,6 +1037,24 @@ public UnaryCallSettings.Builder checkUpgradeSet
return checkUpgradeOperationSettings;
}
+ /** Returns the builder for the settings used for calls to executeAirflowCommand. */
+ public UnaryCallSettings.Builder