Skip to content

Commit

Permalink
feat: [orchestration-airflow] added RPCs StopAirflowCommand, ExecuteA…
Browse files Browse the repository at this point in the history
…irflowCommand, PollAirflowCommand, DatabaseFailover, FetchDatabaseProperties (#9543)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 540052133

Source-Link: https://togithub.com/googleapis/googleapis/commit/386f722b6251585d42b1698ce433b1b55010eb11

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/b8b5220bb0ca29e108194248def0dbb38b068769
Copy-Tag: eyJwIjoiamF2YS1vcmNoZXN0cmF0aW9uLWFpcmZsb3cvLk93bEJvdC55YW1sIiwiaCI6ImI4YjUyMjBiYjBjYTI5ZTEwODE5NDI0OGRlZjBkYmIzOGIwNjg3NjkifQ==

feat: added RPCs StopAirflowCommand, ExecuteAirflowCommand, PollAirflowCommand, DatabaseFailover, FetchDatabaseProperties

PiperOrigin-RevId: 540051332

Source-Link: https://togithub.com/googleapis/googleapis/commit/b84c697241488e5dd521b09b7eaf75b081648585

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/02564778c80b7b5dc2ddff413be253ef24b69165
Copy-Tag: eyJwIjoiamF2YS1vcmNoZXN0cmF0aW9uLWFpcmZsb3cvLk93bEJvdC55YW1sIiwiaCI6IjAyNTY0Nzc4YzgwYjdiNWRjMmRkZmY0MTNiZTI1M2VmMjRiNjkxNjUifQ==
  • Loading branch information
gcf-owl-bot[bot] committed Jun 23, 2023
1 parent 1dfd3f3 commit 1a2fab1
Show file tree
Hide file tree
Showing 99 changed files with 29,945 additions and 584 deletions.
2 changes: 1 addition & 1 deletion java-orchestration-airflow/README.md
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.16.0</version>
<version>26.17.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Expand Up @@ -847,6 +847,200 @@ public final UnaryCallable<DeleteEnvironmentRequest, Operation> deleteEnvironmen
return stub.deleteEnvironmentCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Executes Airflow CLI command.
*
* <p>Sample code:
*
* <pre>{@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<String>())
* .build();
* ExecuteAirflowCommandResponse response = environmentsClient.executeAirflowCommand(request);
* }
* }</pre>
*
* @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.
*
* <p>Sample code:
*
* <pre>{@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<String>())
* .build();
* ApiFuture<ExecuteAirflowCommandResponse> future =
* environmentsClient.executeAirflowCommandCallable().futureCall(request);
* // Do something.
* ExecuteAirflowCommandResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<ExecuteAirflowCommandRequest, ExecuteAirflowCommandResponse>
executeAirflowCommandCallable() {
return stub.executeAirflowCommandCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Stops Airflow CLI command execution.
*
* <p>Sample code:
*
* <pre>{@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);
* }
* }</pre>
*
* @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.
*
* <p>Sample code:
*
* <pre>{@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<StopAirflowCommandResponse> future =
* environmentsClient.stopAirflowCommandCallable().futureCall(request);
* // Do something.
* StopAirflowCommandResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<StopAirflowCommandRequest, StopAirflowCommandResponse>
stopAirflowCommandCallable() {
return stub.stopAirflowCommandCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Polls Airflow CLI command execution and fetches logs.
*
* <p>Sample code:
*
* <pre>{@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);
* }
* }</pre>
*
* @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.
*
* <p>Sample code:
*
* <pre>{@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<PollAirflowCommandResponse> future =
* environmentsClient.pollAirflowCommandCallable().futureCall(request);
* // Do something.
* PollAirflowCommandResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<PollAirflowCommandRequest, PollAirflowCommandResponse>
pollAirflowCommandCallable() {
return stub.pollAirflowCommandCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a snapshots of a Cloud Composer environment.
Expand Down Expand Up @@ -1053,6 +1247,148 @@ public final UnaryCallable<LoadSnapshotRequest, Operation> loadSnapshotCallable(
return stub.loadSnapshotCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Triggers database failover (only for highly resilient environments).
*
* <p>Sample code:
*
* <pre>{@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();
* }
* }</pre>
*
* @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<DatabaseFailoverResponse, OperationMetadata> databaseFailoverAsync(
DatabaseFailoverRequest request) {
return databaseFailoverOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Triggers database failover (only for highly resilient environments).
*
* <p>Sample code:
*
* <pre>{@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<DatabaseFailoverResponse, OperationMetadata> future =
* environmentsClient.databaseFailoverOperationCallable().futureCall(request);
* // Do something.
* DatabaseFailoverResponse response = future.get();
* }
* }</pre>
*/
public final OperationCallable<
DatabaseFailoverRequest, DatabaseFailoverResponse, OperationMetadata>
databaseFailoverOperationCallable() {
return stub.databaseFailoverOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Triggers database failover (only for highly resilient environments).
*
* <p>Sample code:
*
* <pre>{@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<Operation> future =
* environmentsClient.databaseFailoverCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<DatabaseFailoverRequest, Operation> databaseFailoverCallable() {
return stub.databaseFailoverCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Fetches database properties.
*
* <p>Sample code:
*
* <pre>{@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);
* }
* }</pre>
*
* @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.
*
* <p>Sample code:
*
* <pre>{@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<FetchDatabasePropertiesResponse> future =
* environmentsClient.fetchDatabasePropertiesCallable().futureCall(request);
* // Do something.
* FetchDatabasePropertiesResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<FetchDatabasePropertiesRequest, FetchDatabasePropertiesResponse>
fetchDatabasePropertiesCallable() {
return stub.fetchDatabasePropertiesCallable();
}

@Override
public final void close() {
stub.close();
Expand Down

0 comments on commit 1a2fab1

Please sign in to comment.