From 6dc418f51ff507021cc2c50ec6765a85f8f4f5f3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 3 Sep 2020 18:45:28 -0700 Subject: [PATCH 01/23] chore: regen readme (#324) autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- README.md | 1 + synth.metadata | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e5677f8..bd808434 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | | Create Scheduled Query | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/CreateScheduledQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/CreateScheduledQuery.java) | +| Create Scheduled Query With Service Account | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/CreateScheduledQueryWithServiceAccount.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/CreateScheduledQueryWithServiceAccount.java) | | Delete Scheduled Query | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/DeleteScheduledQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/DeleteScheduledQuery.java) | | Get Transfer Config Info | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/GetTransferConfigInfo.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/GetTransferConfigInfo.java) | | List Transfer Configs | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/ListTransferConfigs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/ListTransferConfigs.java) | diff --git a/synth.metadata b/synth.metadata index ebf60296..e5503781 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,7 +11,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerydatatransfer.git", - "sha": "7cd3ed41bde68947a24619b44ebbc8e0b008d3da" + "sha": "9863bd6f9f121e6f472ddf9bcb2e5596c7a5415f" } }, { From 16ef1ad315aa2a8accbf41e2bd2a2a1c56d49c59 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 4 Sep 2020 01:52:04 +0000 Subject: [PATCH 02/23] chore: release 1.0.11-SNAPSHOT (#325) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- google-cloud-bigquerydatatransfer-bom/pom.xml | 8 ++++---- google-cloud-bigquerydatatransfer/pom.xml | 4 ++-- grpc-google-cloud-bigquerydatatransfer-v1/pom.xml | 4 ++-- pom.xml | 8 ++++---- proto-google-cloud-bigquerydatatransfer-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/google-cloud-bigquerydatatransfer-bom/pom.xml b/google-cloud-bigquerydatatransfer-bom/pom.xml index 4bec87fa..02753b50 100644 --- a/google-cloud-bigquerydatatransfer-bom/pom.xml +++ b/google-cloud-bigquerydatatransfer-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquerydatatransfer-bom - 1.0.9 + 1.0.10-SNAPSHOT pom com.google.cloud @@ -64,17 +64,17 @@ com.google.cloud google-cloud-bigquerydatatransfer - 1.0.9 + 1.0.10-SNAPSHOT com.google.api.grpc proto-google-cloud-bigquerydatatransfer-v1 - 1.0.9 + 1.0.10-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerydatatransfer-v1 - 1.0.9 + 1.0.10-SNAPSHOT diff --git a/google-cloud-bigquerydatatransfer/pom.xml b/google-cloud-bigquerydatatransfer/pom.xml index 7267dcfb..901b5637 100644 --- a/google-cloud-bigquerydatatransfer/pom.xml +++ b/google-cloud-bigquerydatatransfer/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquerydatatransfer - 1.0.9 + 1.0.10-SNAPSHOT jar BigQuery DataTransfer https://github.com/googleapis/java-bigquerydatatransfer @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquerydatatransfer-parent - 1.0.9 + 1.0.10-SNAPSHOT google-cloud-bigquerydatatransfer diff --git a/grpc-google-cloud-bigquerydatatransfer-v1/pom.xml b/grpc-google-cloud-bigquerydatatransfer-v1/pom.xml index 2d3f49f0..c24f5929 100644 --- a/grpc-google-cloud-bigquerydatatransfer-v1/pom.xml +++ b/grpc-google-cloud-bigquerydatatransfer-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerydatatransfer-v1 - 1.0.9 + 1.0.10-SNAPSHOT grpc-google-cloud-bigquerydatatransfer-v1 GRPC library for grpc-google-cloud-bigquerydatatransfer-v1 com.google.cloud google-cloud-bigquerydatatransfer-parent - 1.0.9 + 1.0.10-SNAPSHOT diff --git a/pom.xml b/pom.xml index 4d270118..5a599134 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquerydatatransfer-parent pom - 1.0.9 + 1.0.10-SNAPSHOT BigQuery DataTransfer Parent https://github.com/googleapis/java-bigquerydatatransfer @@ -77,17 +77,17 @@ com.google.api.grpc proto-google-cloud-bigquerydatatransfer-v1 - 1.0.9 + 1.0.10-SNAPSHOT com.google.api.grpc grpc-google-cloud-bigquerydatatransfer-v1 - 1.0.9 + 1.0.10-SNAPSHOT com.google.cloud google-cloud-bigquerydatatransfer - 1.0.9 + 1.0.10-SNAPSHOT diff --git a/proto-google-cloud-bigquerydatatransfer-v1/pom.xml b/proto-google-cloud-bigquerydatatransfer-v1/pom.xml index 8faebe6c..be9ec45e 100644 --- a/proto-google-cloud-bigquerydatatransfer-v1/pom.xml +++ b/proto-google-cloud-bigquerydatatransfer-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerydatatransfer-v1 - 1.0.9 + 1.0.10-SNAPSHOT proto-google-cloud-bigquerydatatransfer-v1 PROTO library for proto-google-cloud-bigquerydatatransfer-v1 com.google.cloud google-cloud-bigquerydatatransfer-parent - 1.0.9 + 1.0.10-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6825396f..496df4a3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigquerydatatransfer - 1.0.9 + 1.0.10-SNAPSHOT diff --git a/versions.txt b/versions.txt index 3b1a0bca..01971c6b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -proto-google-cloud-bigquerydatatransfer-v1:1.0.9:1.0.9 -grpc-google-cloud-bigquerydatatransfer-v1:1.0.9:1.0.9 -google-cloud-bigquerydatatransfer:1.0.9:1.0.9 +proto-google-cloud-bigquerydatatransfer-v1:1.0.9:1.0.10-SNAPSHOT +grpc-google-cloud-bigquerydatatransfer-v1:1.0.9:1.0.10-SNAPSHOT +google-cloud-bigquerydatatransfer:1.0.9:1.0.10-SNAPSHOT From 2670cb1080c879fc8eb23d86b5d5e42b23a4aa37 Mon Sep 17 00:00:00 2001 From: Praful Makani Date: Tue, 8 Sep 2020 21:28:33 +0530 Subject: [PATCH 03/23] docs(samples): add run notification (#328) * docs(samples): add run notification * docs(samples): add region tag * docs(samples): lint --- samples/install-without-bom/pom.xml | 6 + samples/snapshot/pom.xml | 6 + samples/snippets/pom.xml | 6 + .../bigquerydatatransfer/RunNotification.java | 78 +++++++++ .../RunNotificationIT.java | 159 ++++++++++++++++++ 5 files changed, 255 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunNotification.java create mode 100644 samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunNotificationIT.java diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 07c50e86..fd86833e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -51,6 +51,12 @@ 1.117.1 test + + com.google.cloud + google-cloud-pubsub + 1.108.1 + test + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 496df4a3..3fa303f4 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,6 +50,12 @@ 1.117.1 test + + com.google.cloud + google-cloud-pubsub + 1.108.1 + test + diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 63eb613a..64caee96 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -63,5 +63,11 @@ 1.117.1 test + + com.google.cloud + google-cloud-pubsub + 1.108.1 + test + diff --git a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunNotification.java b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunNotification.java new file mode 100644 index 00000000..e3cf9a32 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunNotification.java @@ -0,0 +1,78 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquerydatatransfer; + +// [START bigquerydatatransfer_run_notification] +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; +import com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient; +import com.google.cloud.bigquery.datatransfer.v1.ProjectName; +import com.google.cloud.bigquery.datatransfer.v1.TransferConfig; +import com.google.protobuf.Struct; +import com.google.protobuf.Value; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +// Sample to get run notification +public class RunNotification { + + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + final String projectId = "MY_PROJECT_ID"; + final String datasetId = "MY_DATASET_ID"; + final String pubsubTopicName = "MY_TOPIC_NAME"; + final String query = + "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, " + + "@run_date as intended_run_date, 17 as some_integer"; + Map params = new HashMap<>(); + params.put("query", Value.newBuilder().setStringValue(query).build()); + params.put( + "destination_table_name_template", + Value.newBuilder().setStringValue("my_destination_table_{run_date}").build()); + params.put("write_disposition", Value.newBuilder().setStringValue("WRITE_TRUNCATE").build()); + params.put("partitioning_field", Value.newBuilder().build()); + TransferConfig transferConfig = + TransferConfig.newBuilder() + .setDestinationDatasetId(datasetId) + .setDisplayName("Your Scheduled Query Name") + .setDataSourceId("scheduled_query") + .setParams(Struct.newBuilder().putAllFields(params).build()) + .setSchedule("every 24 hours") + .setNotificationPubsubTopic(pubsubTopicName) + .build(); + runNotification(projectId, transferConfig); + } + + public static void runNotification(String projectId, TransferConfig transferConfig) + throws IOException { + try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) { + ProjectName parent = ProjectName.of(projectId); + CreateTransferConfigRequest request = + CreateTransferConfigRequest.newBuilder() + .setParent(parent.toString()) + .setTransferConfig(transferConfig) + .build(); + TransferConfig config = dataTransferServiceClient.createTransferConfig(request); + System.out.println( + "\nScheduled query with run notification created successfully :" + config.getName()); + } catch (ApiException ex) { + System.out.print("\nScheduled query with run notification was not created." + ex.toString()); + } + } +} +// [END bigquerydatatransfer_run_notification] diff --git a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunNotificationIT.java b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunNotificationIT.java new file mode 100644 index 00000000..433824e7 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunNotificationIT.java @@ -0,0 +1,159 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquerydatatransfer; + +import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertNotNull; + +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.DatasetInfo; +import com.google.cloud.bigquery.datatransfer.v1.TransferConfig; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.protobuf.Struct; +import com.google.protobuf.Value; +import com.google.pubsub.v1.ProjectSubscriptionName; +import com.google.pubsub.v1.ProjectTopicName; +import com.google.pubsub.v1.Subscription; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class RunNotificationIT { + + private static final Logger LOG = Logger.getLogger(RunNotificationIT.class.getName()); + private BigQuery bigquery; + private ByteArrayOutputStream bout; + private String name; + private String displayName; + private String datasetName; + private String topicName; + private String formattedTopicName; + private String subscriberName; + private PrintStream out; + private PrintStream originalPrintStream; + + private static final String PROJECT_ID = requireEnvVar("GOOGLE_CLOUD_PROJECT"); + + private static String requireEnvVar(String varName) { + String value = System.getenv(varName); + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + return value; + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("GOOGLE_CLOUD_PROJECT"); + } + + @Before + public void setUp() throws IOException { + String id = UUID.randomUUID().toString().substring(0, 8); + displayName = "MY_SCHEDULE_NAME_TEST_" + id; + datasetName = "MY_DATASET_NAME_TEST_" + id; + topicName = "MY_TOPIC_TEST_" + id; + formattedTopicName = String.format("projects/%s/topics/%s", PROJECT_ID, topicName); + subscriberName = "MY_SUBSCRIBER_TEST_" + id; + // create a temporary dataset + bigquery = BigQueryOptions.getDefaultInstance().getService(); + bigquery.create(DatasetInfo.of(datasetName)); + // create a temporary pubsub topic + try (TopicAdminClient client = TopicAdminClient.create()) { + client.createTopic(formattedTopicName); + } + // create a temporary subscriber + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ProjectTopicName projectTopicName = ProjectTopicName.of(PROJECT_ID, topicName); + ProjectSubscriptionName subscriptionName = + ProjectSubscriptionName.of(PROJECT_ID, subscriberName); + subscriptionAdminClient.createSubscription( + Subscription.newBuilder() + .setName(subscriptionName.toString()) + .setTopic(projectTopicName.toString()) + .setEnableMessageOrdering(true) + .build()); + } + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + } + + @After + public void tearDown() throws IOException { + // Clean up + // delete a temporary subscriber + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String formatSubscriberName = + String.format("projects/%s/subscriptions/%s", PROJECT_ID, subscriberName); + subscriptionAdminClient.deleteSubscription(formatSubscriberName); + } + // delete a temporary pubsub topic + try (TopicAdminClient client = TopicAdminClient.create()) { + client.deleteTopic(formattedTopicName); + } + DeleteScheduledQuery.deleteScheduledQuery(name); + // delete a temporary dataset + bigquery.delete(datasetName, BigQuery.DatasetDeleteOption.deleteContents()); + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + LOG.log(Level.INFO, bout.toString()); + } + + @Test + public void testRunNotification() throws IOException { + String query = + "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, " + + "@run_date as intended_run_date, 17 as some_integer"; + String destinationTableName = + "MY_DESTINATION_TABLE_" + UUID.randomUUID().toString().substring(0, 8) + "_{run_date}"; + Map params = new HashMap<>(); + params.put("query", Value.newBuilder().setStringValue(query).build()); + params.put( + "destination_table_name_template", + Value.newBuilder().setStringValue(destinationTableName).build()); + params.put("write_disposition", Value.newBuilder().setStringValue("WRITE_TRUNCATE").build()); + params.put("partitioning_field", Value.newBuilder().setStringValue("").build()); + TransferConfig transferConfig = + TransferConfig.newBuilder() + .setDestinationDatasetId(datasetName) + .setDisplayName(displayName) + .setDataSourceId("scheduled_query") + .setParams(Struct.newBuilder().putAllFields(params).build()) + .setSchedule("every 24 hours") + .setNotificationPubsubTopic(formattedTopicName) + .build(); + RunNotification.runNotification(PROJECT_ID, transferConfig); + String result = bout.toString(); + name = result.substring(result.indexOf(":") + 1, result.length() - 1); + assertThat(result).contains("Scheduled query with run notification created successfully"); + assertThat(bout.toString()).contains(name); + } +} From 1aeb817c1335b704b3f6f81b86b5aa183cf30e6e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Sep 2020 17:58:55 +0200 Subject: [PATCH 04/23] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.1.1 (#326) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5a599134..b2c2de06 100644 --- a/pom.xml +++ b/pom.xml @@ -126,7 +126,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.1.0 + 3.1.1 From 0e592a99afee4140ed2369e3f6ba9189af8ad4f2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Sep 2020 17:59:11 +0200 Subject: [PATCH 05/23] chore(deps): update dependency com.google.cloud:google-cloud-bigquerydatatransfer to v1.0.9 (#327) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fd86833e..75492404 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-bigquerydatatransfer - 1.0.8 + 1.0.9 From b79c44c720a487926673bdb8f7570c1135f6d951 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Tue, 8 Sep 2020 12:57:19 -0400 Subject: [PATCH 06/23] build(ci): add Documentation to not-autorelease script (#330) --- .github/workflows/auto-release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index fd5d674c..d26427e4 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -27,6 +27,7 @@ jobs: if ( context.payload.pull_request.body.includes("Fix") || context.payload.pull_request.body.includes("Build") || + context.payload.pull_request.body.includes("Documentation") || context.payload.pull_request.body.includes("BREAKING CHANGES") || context.payload.pull_request.body.includes("Features") ) { From 5a09efbdb7b4481e9fb9ac0d80f130dbcee3e418 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 9 Sep 2020 08:17:06 -0700 Subject: [PATCH 07/23] docs: changes without context (#332) autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- README.md | 3 ++- synth.metadata | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bd808434..2e9aa8d3 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquerydatatransfer - 1.0.8 + 1.0.9 ``` @@ -99,6 +99,7 @@ has instructions for running the samples. | Get Transfer Config Info | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/GetTransferConfigInfo.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/GetTransferConfigInfo.java) | | List Transfer Configs | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/ListTransferConfigs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/ListTransferConfigs.java) | | Quickstart Sample | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/QuickstartSample.java) | +| Run Notification | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunNotification.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunNotification.java) | diff --git a/synth.metadata b/synth.metadata index e5503781..182764c5 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,7 +11,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerydatatransfer.git", - "sha": "9863bd6f9f121e6f472ddf9bcb2e5596c7a5415f" + "sha": "b79c44c720a487926673bdb8f7570c1135f6d951" } }, { From ddf567acbf57e61c83fe2af6a49520a54cd324eb Mon Sep 17 00:00:00 2001 From: Praful Makani Date: Wed, 9 Sep 2020 21:24:30 +0530 Subject: [PATCH 08/23] docs(samples): add run history (#333) --- .../bigquerydatatransfer/RunHistory.java | 49 +++++++ .../bigquerydatatransfer/RunHistoryIT.java | 134 ++++++++++++++++++ 2 files changed, 183 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunHistory.java create mode 100644 samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunHistoryIT.java diff --git a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunHistory.java b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunHistory.java new file mode 100644 index 00000000..a554afbb --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunHistory.java @@ -0,0 +1,49 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquerydatatransfer; + +// [START bigquerydatatransfer_get_run_history] +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient; +import com.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest; +import java.io.IOException; + +// Sample to get run history from transfer config. +public class RunHistory { + + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + String configId = "MY_CONFIG_ID"; + // i.e projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` + runHistory(configId); + } + + public static void runHistory(String configId) throws IOException { + try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) { + ListTransferRunsRequest request = + ListTransferRunsRequest.newBuilder().setParent(configId).build(); + dataTransferServiceClient + .listTransferRuns(request) + .iterateAll() + .forEach(run -> System.out.print("Success! Run ID :" + run.getName() + "\n")); + } catch (ApiException ex) { + System.out.println("Run history not found due to error." + ex.toString()); + } + } +} +// [END bigquerydatatransfer_get_run_history] diff --git a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunHistoryIT.java b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunHistoryIT.java new file mode 100644 index 00000000..3bae3734 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunHistoryIT.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquerydatatransfer; + +import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertNotNull; + +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.DatasetInfo; +import com.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; +import com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient; +import com.google.cloud.bigquery.datatransfer.v1.ProjectName; +import com.google.cloud.bigquery.datatransfer.v1.TransferConfig; +import com.google.protobuf.Struct; +import com.google.protobuf.Value; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class RunHistoryIT { + + private static final Logger LOG = Logger.getLogger(GetTransferConfigInfoIT.class.getName()); + private static final String ID = UUID.randomUUID().toString().substring(0, 8); + private BigQuery bigquery; + private ByteArrayOutputStream bout; + private String name; + private String displayName; + private String datasetName; + private PrintStream out; + private PrintStream originalPrintStream; + + private static final String PROJECT_ID = requireEnvVar("GOOGLE_CLOUD_PROJECT"); + + private static String requireEnvVar(String varName) { + String value = System.getenv(varName); + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + return value; + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("GOOGLE_CLOUD_PROJECT"); + } + + @Before + public void setUp() throws IOException { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + + displayName = "MY_SCHEDULE_NAME_TEST_" + ID; + datasetName = "MY_DATASET_NAME_TEST_" + ID; + // create a temporary dataset + bigquery = BigQueryOptions.getDefaultInstance().getService(); + bigquery.create(DatasetInfo.of(datasetName)); + // create a scheduled query + String query = + "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, " + + "@run_date as intended_run_date, 17 as some_integer"; + String destinationTableName = + "MY_DESTINATION_TABLE_" + UUID.randomUUID().toString().substring(0, 8) + "_{run_date}"; + Map params = new HashMap<>(); + params.put("query", Value.newBuilder().setStringValue(query).build()); + params.put( + "destination_table_name_template", + Value.newBuilder().setStringValue(destinationTableName).build()); + params.put("write_disposition", Value.newBuilder().setStringValue("WRITE_TRUNCATE").build()); + params.put("partitioning_field", Value.newBuilder().setStringValue("").build()); + TransferConfig transferConfig = + TransferConfig.newBuilder() + .setDestinationDatasetId(datasetName) + .setDisplayName(displayName) + .setDataSourceId("scheduled_query") + .setParams(Struct.newBuilder().putAllFields(params).build()) + .setSchedule("every 24 hours") + .build(); + try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) { + ProjectName parent = ProjectName.of(PROJECT_ID); + CreateTransferConfigRequest request = + CreateTransferConfigRequest.newBuilder() + .setParent(parent.toString()) + .setTransferConfig(transferConfig) + .build(); + name = dataTransferServiceClient.createTransferConfig(request).getName(); + System.out.println("\nScheduled query created successfully :" + name); + } + } + + @After + public void tearDown() throws IOException { + // delete scheduled query that was just created + DeleteScheduledQuery.deleteScheduledQuery(name); + // delete a temporary dataset + bigquery.delete(datasetName, BigQuery.DatasetDeleteOption.deleteContents()); + + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + LOG.log(Level.INFO, bout.toString()); + } + + @Test + public void testRunHistory() throws IOException { + RunHistory.runHistory(name); + assertThat(bout.toString()).contains("Success! Run ID :"); + } +} From b217728a4ef9b2ff535304bb28db0ab0d61900f0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 10 Sep 2020 14:00:21 +0200 Subject: [PATCH 09/23] chore(deps): update dependency com.google.cloud:libraries-bom to v10.1.0 (#335) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 64caee96..abaa8799 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 10.0.0 + 10.1.0 pom import From c5f8b2c23325fd7f2bdef5f1d9bd2056f493ca60 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 10 Sep 2020 05:01:30 -0700 Subject: [PATCH 10/23] changes without context (#336) autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- README.md | 1 + synth.metadata | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e9aa8d3..85266752 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ has instructions for running the samples. | Get Transfer Config Info | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/GetTransferConfigInfo.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/GetTransferConfigInfo.java) | | List Transfer Configs | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/ListTransferConfigs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/ListTransferConfigs.java) | | Quickstart Sample | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/QuickstartSample.java) | +| Run History | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunHistory.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunHistory.java) | | Run Notification | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunNotification.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunNotification.java) | diff --git a/synth.metadata b/synth.metadata index 182764c5..6891be66 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,7 +11,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerydatatransfer.git", - "sha": "b79c44c720a487926673bdb8f7570c1135f6d951" + "sha": "ddf567acbf57e61c83fe2af6a49520a54cd324eb" } }, { From a370ccde96208062e424bd896e743a919ae7a9da Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 11 Sep 2020 04:27:26 -0700 Subject: [PATCH 11/23] docs: changes without context (#337) autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- README.md | 2 +- synth.metadata | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 85266752..1ac8c3f2 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 10.0.0 + 10.1.0 pom import diff --git a/synth.metadata b/synth.metadata index 6891be66..55e6f0a6 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,7 +11,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerydatatransfer.git", - "sha": "ddf567acbf57e61c83fe2af6a49520a54cd324eb" + "sha": "c5f8b2c23325fd7f2bdef5f1d9bd2056f493ca60" } }, { From 96f24fb057302717c21474532faaa01a8ee172b8 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Mon, 14 Sep 2020 14:28:06 -0400 Subject: [PATCH 12/23] chore: generate CODEOWNERS from templates (#338) --- .repo-metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.repo-metadata.json b/.repo-metadata.json index 4e979487..1e76de28 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -10,6 +10,7 @@ "repo": "googleapis/java-bigquerydatatransfer", "repo_short": "java-bigquerydatatransfer", "distribution_name": "com.google.cloud:google-cloud-bigquerydatatransfer", + "codeowner_team": "@googleapis/api-bigquery", "api_id": "bigquerydatatransfer.googleapis.com", "transport": "grpc", "requires_billing": true From 8a85859a1b259cd574e331b2fc3a0edc58b1a73c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 15 Sep 2020 08:24:15 -0700 Subject: [PATCH 13/23] chore: regen common template (#339) autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- .github/CODEOWNERS | 3 +++ synth.metadata | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6137bef2..c0955441 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,5 +4,8 @@ # For syntax help see: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax +# The @googleapis/api-bigquery is the default owner for changes in this repo +**/*.java @googleapis/api-bigquery + # The java-samples-reviewers team is the default owner for samples changes samples/**/*.java @googleapis/java-samples-reviewers diff --git a/synth.metadata b/synth.metadata index 55e6f0a6..db533e42 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,7 +11,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerydatatransfer.git", - "sha": "c5f8b2c23325fd7f2bdef5f1d9bd2056f493ca60" + "sha": "96f24fb057302717c21474532faaa01a8ee172b8" } }, { From 108ad965d7012308a6aa773a9560d5e64954cc0f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 15 Sep 2020 17:24:50 +0200 Subject: [PATCH 14/23] deps: update dependency com.google.cloud:google-cloud-bigquery to v1.117.2 (#340) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 75492404..ab50a08d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -48,7 +48,7 @@ com.google.cloud google-cloud-bigquery - 1.117.1 + 1.117.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3fa303f4..14a0988d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -47,7 +47,7 @@ com.google.cloud google-cloud-bigquery - 1.117.1 + 1.117.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index abaa8799..9adbbbed 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -60,7 +60,7 @@ com.google.cloud google-cloud-bigquery - 1.117.1 + 1.117.2 test From 4b3e2ebec4682c1e69cd5e3b27d9903e007eb174 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 17 Sep 2020 18:41:07 +0200 Subject: [PATCH 15/23] deps: update dependency com.google.cloud:google-cloud-bigquery to v1.118.0 (#342) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ab50a08d..df097e24 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -48,7 +48,7 @@ com.google.cloud google-cloud-bigquery - 1.117.2 + 1.118.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 14a0988d..0c4d233d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -47,7 +47,7 @@ com.google.cloud google-cloud-bigquery - 1.117.2 + 1.118.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9adbbbed..63e9f308 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -60,7 +60,7 @@ com.google.cloud google-cloud-bigquery - 1.117.2 + 1.118.0 test From 2b8680336612559aa4a396e329e7b9c55fa229d8 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 17 Sep 2020 15:49:52 -0400 Subject: [PATCH 16/23] build(ci): set up secrets(env vars) for samples ITs (#344) --- .kokoro/build.sh | 5 +++++ .kokoro/nightly/samples.cfg | 2 +- .kokoro/presubmit/samples.cfg | 2 +- synth.py | 6 +++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 59677e83..77c73321 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -71,6 +71,11 @@ integration) samples) if [[ -f samples/pom.xml ]] then + if [ -f "${KOKORO_GFILE_DIR}/secret_manager/java-bigquerydatatransfer-samples-secrets" ] + then + source "${KOKORO_GFILE_DIR}/secret_manager/java-bigquerydatatransfer-samples-secrets" + fi + pushd samples mvn -B \ -Penable-samples \ diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg index f2542931..c78fe9bd 100644 --- a/.kokoro/nightly/samples.cfg +++ b/.kokoro/nightly/samples.cfg @@ -29,7 +29,7 @@ env_vars: { env_vars: { key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" + value: "java-docs-samples-service-account, java-bigquerydatatransfer-samples-secrets" } env_vars: { diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg index 01e09600..b146e9f6 100644 --- a/.kokoro/presubmit/samples.cfg +++ b/.kokoro/presubmit/samples.cfg @@ -29,5 +29,5 @@ env_vars: { env_vars: { key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" + value: "java-docs-samples-service-account, java-bigquerydatatransfer-samples-secrets" } \ No newline at end of file diff --git a/synth.py b/synth.py index 5c11ca66..acb74100 100644 --- a/synth.py +++ b/synth.py @@ -34,4 +34,8 @@ destination_name='bigquerydatatransfer', ) -java.common_templates() +java.common_templates(excludes=[ + '.kokoro/build.sh', + '.kokoro/nightly/samples.cfg', + '.kokoro/presubmit/samples.cfg', +]) From 8824cc55cb3f5cb2ca88f2505e6c580e58cf575a Mon Sep 17 00:00:00 2001 From: Praful Makani Date: Fri, 18 Sep 2020 01:29:42 +0530 Subject: [PATCH 17/23] docs(samples): add run details (#334) * docs(samples): add run details * docs(samples): address feedback * docs(samples): add envvar --- .../bigquerydatatransfer/RunDetails.java | 48 +++++++++++ .../bigquerydatatransfer/RunDetailsIT.java | 80 +++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunDetails.java create mode 100644 samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunDetailsIT.java diff --git a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunDetails.java b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunDetails.java new file mode 100644 index 00000000..ccb36270 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunDetails.java @@ -0,0 +1,48 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquerydatatransfer; + +// [START bigquerydatatransfer_get_run_details] +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient; +import com.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest; +import com.google.cloud.bigquery.datatransfer.v1.TransferRun; +import java.io.IOException; + +// Sample to get run details from transfer config. +public class RunDetails { + + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + // runId examples: + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` + String runId = "MY_RUN_ID"; + runDetails(runId); + } + + public static void runDetails(String runId) throws IOException { + try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) { + GetTransferRunRequest request = GetTransferRunRequest.newBuilder().setName(runId).build(); + TransferRun run = dataTransferServiceClient.getTransferRun(request); + System.out.print("Run details retrieved successfully :" + run.getName() + "\n"); + } catch (ApiException ex) { + System.out.print("Run details not found." + ex.toString()); + } + } +} +// [END bigquerydatatransfer_get_run_details] diff --git a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunDetailsIT.java b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunDetailsIT.java new file mode 100644 index 00000000..e7f8850f --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunDetailsIT.java @@ -0,0 +1,80 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquerydatatransfer; + +import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertNotNull; + +import com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class RunDetailsIT { + + private static final Logger LOG = Logger.getLogger(GetTransferConfigInfoIT.class.getName()); + private ByteArrayOutputStream bout; + private String runName; + private PrintStream out; + private PrintStream originalPrintStream; + + private static final String CONFIG_NAME = requireEnvVar("DTS_TRANSFER_CONFIG_NAME"); + + private static String requireEnvVar(String varName) { + String value = System.getenv(varName); + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + return value; + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("DTS_TRANSFER_CONFIG_NAME"); + } + + @Before + public void setUp() throws IOException { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + try (DataTransferServiceClient client = DataTransferServiceClient.create()) { + client.listTransferRuns(CONFIG_NAME).iterateAll().forEach(run -> runName = run.getName()); + } + } + + @After + public void tearDown() throws IOException { + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + LOG.log(Level.INFO, bout.toString()); + } + + @Test + public void testRunDetails() throws IOException { + RunDetails.runDetails(runName); + assertThat(bout.toString()).contains("Run details retrieved successfully :"); + } +} From e2f07037ff2abc620ff296f1a0e89ecb5732e504 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 18 Sep 2020 05:32:09 -0700 Subject: [PATCH 18/23] chore: regen readme (#345) autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- README.md | 1 + synth.metadata | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1ac8c3f2..f24e5af9 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ has instructions for running the samples. | Get Transfer Config Info | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/GetTransferConfigInfo.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/GetTransferConfigInfo.java) | | List Transfer Configs | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/ListTransferConfigs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/ListTransferConfigs.java) | | Quickstart Sample | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/QuickstartSample.java) | +| Run Details | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunDetails.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunDetails.java) | | Run History | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunHistory.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunHistory.java) | | Run Notification | [source code](https://github.com/googleapis/java-bigquerydatatransfer/blob/master/samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunNotification.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquerydatatransfer&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquerydatatransfer/RunNotification.java) | diff --git a/synth.metadata b/synth.metadata index db533e42..1a4afbe0 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,7 +11,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerydatatransfer.git", - "sha": "96f24fb057302717c21474532faaa01a8ee172b8" + "sha": "8824cc55cb3f5cb2ca88f2505e6c580e58cf575a" } }, { @@ -52,7 +52,6 @@ ".github/workflows/ci.yaml", ".github/workflows/samples.yaml", ".kokoro/build.bat", - ".kokoro/build.sh", ".kokoro/coerce_logs.sh", ".kokoro/common.cfg", ".kokoro/common.sh", @@ -67,7 +66,6 @@ ".kokoro/nightly/java8-osx.cfg", ".kokoro/nightly/java8-win.cfg", ".kokoro/nightly/java8.cfg", - ".kokoro/nightly/samples.cfg", ".kokoro/populate-secrets.sh", ".kokoro/presubmit/clirr.cfg", ".kokoro/presubmit/common.cfg", @@ -80,7 +78,6 @@ ".kokoro/presubmit/java8.cfg", ".kokoro/presubmit/linkage-monitor.cfg", ".kokoro/presubmit/lint.cfg", - ".kokoro/presubmit/samples.cfg", ".kokoro/release/bump_snapshot.cfg", ".kokoro/release/common.cfg", ".kokoro/release/common.sh", From 3a901f39ac66124ae4eb705f08fd4d4459846644 Mon Sep 17 00:00:00 2001 From: Praful Makani Date: Fri, 18 Sep 2020 21:22:44 +0530 Subject: [PATCH 19/23] refactor(samples): use env variable (#341) * refactor(samples): use env variable * docs(samples): update env var for listtransferconfig --- .../GetTransferConfigInfoIT.java | 68 ++----------------- .../ListTransferConfigsIT.java | 65 +----------------- 2 files changed, 8 insertions(+), 125 deletions(-) diff --git a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/GetTransferConfigInfoIT.java b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/GetTransferConfigInfoIT.java index 0d3de100..d3e2d6d9 100644 --- a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/GetTransferConfigInfoIT.java +++ b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/GetTransferConfigInfoIT.java @@ -19,21 +19,9 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; -import com.google.cloud.bigquery.BigQuery; -import com.google.cloud.bigquery.BigQueryOptions; -import com.google.cloud.bigquery.DatasetInfo; -import com.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; -import com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient; -import com.google.cloud.bigquery.datatransfer.v1.ProjectName; -import com.google.cloud.bigquery.datatransfer.v1.TransferConfig; -import com.google.protobuf.Struct; -import com.google.protobuf.Value; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; import org.junit.After; @@ -44,15 +32,11 @@ public class GetTransferConfigInfoIT { private static final Logger LOG = Logger.getLogger(GetTransferConfigInfoIT.class.getName()); - private BigQuery bigquery; private ByteArrayOutputStream bout; - private String name; - private String displayName; - private String datasetName; private PrintStream out; private PrintStream originalPrintStream; - private static final String PROJECT_ID = requireEnvVar("GOOGLE_CLOUD_PROJECT"); + private static final String CONFIG_NAME = requireEnvVar("DTS_TRANSFER_CONFIG_NAME"); private static String requireEnvVar(String varName) { String value = System.getenv(varName); @@ -64,61 +48,19 @@ private static String requireEnvVar(String varName) { @BeforeClass public static void checkRequirements() { - requireEnvVar("GOOGLE_CLOUD_PROJECT"); + requireEnvVar("DTS_TRANSFER_CONFIG_NAME"); } @Before - public void setUp() throws IOException { + public void setUp() { bout = new ByteArrayOutputStream(); out = new PrintStream(bout); originalPrintStream = System.out; System.setOut(out); - - displayName = "MY_SCHEDULE_NAME_TEST_" + UUID.randomUUID().toString().substring(0, 8); - datasetName = "MY_DATASET_NAME_TEST_" + UUID.randomUUID().toString().substring(0, 8); - // create a temporary dataset - bigquery = BigQueryOptions.getDefaultInstance().getService(); - bigquery.create(DatasetInfo.of(datasetName)); - // create a scheduled query - String query = - "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, " - + "@run_date as intended_run_date, 17 as some_integer"; - String destinationTableName = - "MY_DESTINATION_TABLE_" + UUID.randomUUID().toString().substring(0, 8) + "_{run_date}"; - Map params = new HashMap<>(); - params.put("query", Value.newBuilder().setStringValue(query).build()); - params.put( - "destination_table_name_template", - Value.newBuilder().setStringValue(destinationTableName).build()); - params.put("write_disposition", Value.newBuilder().setStringValue("WRITE_TRUNCATE").build()); - params.put("partitioning_field", Value.newBuilder().setStringValue("").build()); - TransferConfig transferConfig = - TransferConfig.newBuilder() - .setDestinationDatasetId(datasetName) - .setDisplayName(displayName) - .setDataSourceId("scheduled_query") - .setParams(Struct.newBuilder().putAllFields(params).build()) - .setSchedule("every 24 hours") - .build(); - try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) { - ProjectName parent = ProjectName.of(PROJECT_ID); - CreateTransferConfigRequest request = - CreateTransferConfigRequest.newBuilder() - .setParent(parent.toString()) - .setTransferConfig(transferConfig) - .build(); - name = dataTransferServiceClient.createTransferConfig(request).getName(); - System.out.println("\nScheduled query created successfully :" + name); - } } @After - public void tearDown() throws IOException { - // delete scheduled query that was just created - DeleteScheduledQuery.deleteScheduledQuery(name); - // delete a temporary dataset - bigquery.delete(datasetName, BigQuery.DatasetDeleteOption.deleteContents()); - + public void tearDown() { // restores print statements in the original method System.out.flush(); System.setOut(originalPrintStream); @@ -127,7 +69,7 @@ public void tearDown() throws IOException { @Test public void testGetTransferConfigInfo() throws IOException { - GetTransferConfigInfo.getTransferConfigInfo(name); + GetTransferConfigInfo.getTransferConfigInfo(CONFIG_NAME); assertThat(bout.toString()).contains("Config info retrieved successfully."); } } diff --git a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/ListTransferConfigsIT.java b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/ListTransferConfigsIT.java index ac0c5a49..f3b64843 100644 --- a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/ListTransferConfigsIT.java +++ b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/ListTransferConfigsIT.java @@ -19,21 +19,9 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; -import com.google.cloud.bigquery.BigQuery; -import com.google.cloud.bigquery.BigQueryOptions; -import com.google.cloud.bigquery.DatasetInfo; -import com.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; -import com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient; -import com.google.cloud.bigquery.datatransfer.v1.ProjectName; -import com.google.cloud.bigquery.datatransfer.v1.TransferConfig; -import com.google.protobuf.Struct; -import com.google.protobuf.Value; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; import org.junit.After; @@ -44,11 +32,7 @@ public class ListTransferConfigsIT { private static final Logger LOG = Logger.getLogger(ListTransferConfigsIT.class.getName()); - private BigQuery bigquery; private ByteArrayOutputStream bout; - private String name; - private String displayName; - private String datasetName; private PrintStream out; private PrintStream originalPrintStream; @@ -64,62 +48,19 @@ private static String requireEnvVar(String varName) { @BeforeClass public static void checkRequirements() { - requireEnvVar("GOOGLE_CLOUD_PROJECT"); + requireEnvVar("DTS_TRANSFER_CONFIG_NAME"); } @Before - public void setUp() throws IOException { + public void setUp() { bout = new ByteArrayOutputStream(); out = new PrintStream(bout); originalPrintStream = System.out; System.setOut(out); - - displayName = "MY_SCHEDULE_NAME_TEST_" + UUID.randomUUID().toString().substring(0, 8); - datasetName = "MY_DATASET_NAME_TEST_" + UUID.randomUUID().toString().substring(0, 8); - // create a temporary dataset - bigquery = BigQueryOptions.getDefaultInstance().getService(); - bigquery.create(DatasetInfo.of(datasetName)); - - // create a scheduled query - String query = - "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, " - + "@run_date as intended_run_date, 17 as some_integer"; - String destinationTableName = - "MY_DESTINATION_TABLE_" + UUID.randomUUID().toString().substring(0, 8) + "_{run_date}"; - Map params = new HashMap<>(); - params.put("query", Value.newBuilder().setStringValue(query).build()); - params.put( - "destination_table_name_template", - Value.newBuilder().setStringValue(destinationTableName).build()); - params.put("write_disposition", Value.newBuilder().setStringValue("WRITE_TRUNCATE").build()); - params.put("partitioning_field", Value.newBuilder().setStringValue("").build()); - TransferConfig transferConfig = - TransferConfig.newBuilder() - .setDestinationDatasetId(datasetName) - .setDisplayName(displayName) - .setDataSourceId("scheduled_query") - .setParams(Struct.newBuilder().putAllFields(params).build()) - .setSchedule("every 24 hours") - .build(); - try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) { - ProjectName parent = ProjectName.of(PROJECT_ID); - CreateTransferConfigRequest request = - CreateTransferConfigRequest.newBuilder() - .setParent(parent.toString()) - .setTransferConfig(transferConfig) - .build(); - name = dataTransferServiceClient.createTransferConfig(request).getName(); - System.out.println("\nScheduled query created successfully :" + name); - } } @After - public void tearDown() throws IOException { - // delete scheduled query that was just created - DeleteScheduledQuery.deleteScheduledQuery(name); - // delete a temporary dataset - bigquery.delete(datasetName, BigQuery.DatasetDeleteOption.deleteContents()); - + public void tearDown() { // restores print statements in the original method System.out.flush(); System.setOut(originalPrintStream); From ac78f78e3bc865309c158f8a6e8d7f34c18086e7 Mon Sep 17 00:00:00 2001 From: Praful Makani Date: Fri, 18 Sep 2020 21:35:33 +0530 Subject: [PATCH 20/23] docs(samples): add update transfer config (#347) --- .../UpdateTransferConfig.java | 56 ++++++++++++++ .../UpdateTransferConfigIT.java | 75 +++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquerydatatransfer/UpdateTransferConfig.java create mode 100644 samples/snippets/src/test/java/com/example/bigquerydatatransfer/UpdateTransferConfigIT.java diff --git a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/UpdateTransferConfig.java b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/UpdateTransferConfig.java new file mode 100644 index 00000000..a75dff20 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/UpdateTransferConfig.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquerydatatransfer; + +// [START bigquerydatatransfer_update_config] +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient; +import com.google.cloud.bigquery.datatransfer.v1.TransferConfig; +import com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest; +import com.google.protobuf.FieldMask; +import java.io.IOException; + +// Sample to update transfer config. +public class UpdateTransferConfig { + + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + String configId = "MY_CONFIG_ID"; + updateTransferConfig(configId); + } + + public static void updateTransferConfig(String configId) throws IOException { + try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) { + TransferConfig transferConfig = + TransferConfig.newBuilder() + .setName(configId) + .setDisplayName("UPDATED_DISPLAY_NAME") + .build(); + FieldMask updateMask = FieldMask.newBuilder().addPaths("display_name").build(); + UpdateTransferConfigRequest request = + UpdateTransferConfigRequest.newBuilder() + .setTransferConfig(transferConfig) + .setUpdateMask(updateMask) + .build(); + TransferConfig updateConfig = dataTransferServiceClient.updateTransferConfig(request); + System.out.println("Transfer config updated successfully :" + updateConfig.getDisplayName()); + } catch (ApiException ex) { + System.out.print("Transfer config was not updated." + ex.toString()); + } + } +} +// [END bigquerydatatransfer_update_config] diff --git a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/UpdateTransferConfigIT.java b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/UpdateTransferConfigIT.java new file mode 100644 index 00000000..bbba090b --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/UpdateTransferConfigIT.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquerydatatransfer; + +import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertNotNull; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class UpdateTransferConfigIT { + + private static final Logger LOG = Logger.getLogger(DeleteScheduledQueryIT.class.getName()); + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + + private static final String CONFIG_NAME = requireEnvVar("DTS_TRANSFER_CONFIG_NAME"); + + private static String requireEnvVar(String varName) { + String value = System.getenv(varName); + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + return value; + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("DTS_TRANSFER_CONFIG_NAME"); + } + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + } + + @After + public void tearDown() { + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + LOG.log(Level.INFO, bout.toString()); + } + + @Test + public void testUpdateTransferConfig() throws IOException { + UpdateTransferConfig.updateTransferConfig(CONFIG_NAME); + assertThat(bout.toString()).contains("Transfer config updated successfully"); + } +} From 486f677dfd7e2ff40a7043c88bc58e8f50b1f8c5 Mon Sep 17 00:00:00 2001 From: Praful Makani Date: Fri, 18 Sep 2020 22:05:42 +0530 Subject: [PATCH 21/23] refactor(samples): update run history it (#348) --- .../bigquerydatatransfer/RunHistoryIT.java | 69 ++----------------- 1 file changed, 5 insertions(+), 64 deletions(-) diff --git a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunHistoryIT.java b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunHistoryIT.java index 3bae3734..3324c00e 100644 --- a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunHistoryIT.java +++ b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/RunHistoryIT.java @@ -19,21 +19,9 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; -import com.google.cloud.bigquery.BigQuery; -import com.google.cloud.bigquery.BigQueryOptions; -import com.google.cloud.bigquery.DatasetInfo; -import com.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest; -import com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient; -import com.google.cloud.bigquery.datatransfer.v1.ProjectName; -import com.google.cloud.bigquery.datatransfer.v1.TransferConfig; -import com.google.protobuf.Struct; -import com.google.protobuf.Value; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; import org.junit.After; @@ -44,16 +32,11 @@ public class RunHistoryIT { private static final Logger LOG = Logger.getLogger(GetTransferConfigInfoIT.class.getName()); - private static final String ID = UUID.randomUUID().toString().substring(0, 8); - private BigQuery bigquery; private ByteArrayOutputStream bout; - private String name; - private String displayName; - private String datasetName; private PrintStream out; private PrintStream originalPrintStream; - private static final String PROJECT_ID = requireEnvVar("GOOGLE_CLOUD_PROJECT"); + private static final String CONFIG_NAME = requireEnvVar("DTS_TRANSFER_CONFIG_NAME"); private static String requireEnvVar(String varName) { String value = System.getenv(varName); @@ -65,61 +48,19 @@ private static String requireEnvVar(String varName) { @BeforeClass public static void checkRequirements() { - requireEnvVar("GOOGLE_CLOUD_PROJECT"); + requireEnvVar("DTS_TRANSFER_CONFIG_NAME"); } @Before - public void setUp() throws IOException { + public void setUp() { bout = new ByteArrayOutputStream(); out = new PrintStream(bout); originalPrintStream = System.out; System.setOut(out); - - displayName = "MY_SCHEDULE_NAME_TEST_" + ID; - datasetName = "MY_DATASET_NAME_TEST_" + ID; - // create a temporary dataset - bigquery = BigQueryOptions.getDefaultInstance().getService(); - bigquery.create(DatasetInfo.of(datasetName)); - // create a scheduled query - String query = - "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, " - + "@run_date as intended_run_date, 17 as some_integer"; - String destinationTableName = - "MY_DESTINATION_TABLE_" + UUID.randomUUID().toString().substring(0, 8) + "_{run_date}"; - Map params = new HashMap<>(); - params.put("query", Value.newBuilder().setStringValue(query).build()); - params.put( - "destination_table_name_template", - Value.newBuilder().setStringValue(destinationTableName).build()); - params.put("write_disposition", Value.newBuilder().setStringValue("WRITE_TRUNCATE").build()); - params.put("partitioning_field", Value.newBuilder().setStringValue("").build()); - TransferConfig transferConfig = - TransferConfig.newBuilder() - .setDestinationDatasetId(datasetName) - .setDisplayName(displayName) - .setDataSourceId("scheduled_query") - .setParams(Struct.newBuilder().putAllFields(params).build()) - .setSchedule("every 24 hours") - .build(); - try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) { - ProjectName parent = ProjectName.of(PROJECT_ID); - CreateTransferConfigRequest request = - CreateTransferConfigRequest.newBuilder() - .setParent(parent.toString()) - .setTransferConfig(transferConfig) - .build(); - name = dataTransferServiceClient.createTransferConfig(request).getName(); - System.out.println("\nScheduled query created successfully :" + name); - } } @After - public void tearDown() throws IOException { - // delete scheduled query that was just created - DeleteScheduledQuery.deleteScheduledQuery(name); - // delete a temporary dataset - bigquery.delete(datasetName, BigQuery.DatasetDeleteOption.deleteContents()); - + public void tearDown() { // restores print statements in the original method System.out.flush(); System.setOut(originalPrintStream); @@ -128,7 +69,7 @@ public void tearDown() throws IOException { @Test public void testRunHistory() throws IOException { - RunHistory.runHistory(name); + RunHistory.runHistory(CONFIG_NAME); assertThat(bout.toString()).contains("Success! Run ID :"); } } From ad32b5f50bede5c56bdaf6c8c79508ab44130c70 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 18 Sep 2020 12:49:32 -0400 Subject: [PATCH 22/23] docs(samples): add protobuf.util dependency to enable FieldMaskUtil (#349) * docs(samples): add protobuf.util dependency to enable FieldMaskUtil * revert back samples module --- samples/install-without-bom/pom.xml | 6 ++++++ samples/snapshot/pom.xml | 6 ++++++ samples/snippets/pom.xml | 5 +++++ .../example/bigquerydatatransfer/UpdateTransferConfig.java | 3 ++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index df097e24..d36cf346 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -33,6 +33,12 @@ + + com.google.protobuf + protobuf-java-util + 3.13.0 + + junit junit diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0c4d233d..c297314f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -32,6 +32,12 @@ + + com.google.protobuf + protobuf-java-util + 3.13.0 + + junit junit diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 63e9f308..e37ab9ee 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -44,6 +44,11 @@ + + com.google.protobuf + protobuf-java-util + + junit diff --git a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/UpdateTransferConfig.java b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/UpdateTransferConfig.java index a75dff20..7d45ed69 100644 --- a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/UpdateTransferConfig.java +++ b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/UpdateTransferConfig.java @@ -22,6 +22,7 @@ import com.google.cloud.bigquery.datatransfer.v1.TransferConfig; import com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest; import com.google.protobuf.FieldMask; +import com.google.protobuf.util.FieldMaskUtil; import java.io.IOException; // Sample to update transfer config. @@ -40,7 +41,7 @@ public static void updateTransferConfig(String configId) throws IOException { .setName(configId) .setDisplayName("UPDATED_DISPLAY_NAME") .build(); - FieldMask updateMask = FieldMask.newBuilder().addPaths("display_name").build(); + FieldMask updateMask = FieldMaskUtil.fromString("display_name"); UpdateTransferConfigRequest request = UpdateTransferConfigRequest.newBuilder() .setTransferConfig(transferConfig) From a4a5aa17c941d2f0fb38840fc2c841b38e2e0b70 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 18 Sep 2020 18:01:00 -0400 Subject: [PATCH 23/23] chore: release 1.0.11 (#331) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 19 +++++++++++++++++++ README.md | 4 ++-- google-cloud-bigquerydatatransfer-bom/pom.xml | 8 ++++---- google-cloud-bigquerydatatransfer/pom.xml | 4 ++-- .../pom.xml | 4 ++-- pom.xml | 8 ++++---- .../pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 6 +++--- 9 files changed, 39 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 329cef8f..4a7755fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +### [1.0.11](https://www.github.com/googleapis/java-bigquerydatatransfer/compare/v1.0.10...v1.0.11) (2020-09-18) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigquery to v1.117.2 ([#340](https://www.github.com/googleapis/java-bigquerydatatransfer/issues/340)) ([108ad96](https://www.github.com/googleapis/java-bigquerydatatransfer/commit/108ad965d7012308a6aa773a9560d5e64954cc0f)) +* update dependency com.google.cloud:google-cloud-bigquery to v1.118.0 ([#342](https://www.github.com/googleapis/java-bigquerydatatransfer/issues/342)) ([4b3e2eb](https://www.github.com/googleapis/java-bigquerydatatransfer/commit/4b3e2ebec4682c1e69cd5e3b27d9903e007eb174)) + + +### Documentation + +* **samples:** add protobuf.util dependency to enable FieldMaskUtil ([#349](https://www.github.com/googleapis/java-bigquerydatatransfer/issues/349)) ([ad32b5f](https://www.github.com/googleapis/java-bigquerydatatransfer/commit/ad32b5f50bede5c56bdaf6c8c79508ab44130c70)) +* **samples:** add run details ([#334](https://www.github.com/googleapis/java-bigquerydatatransfer/issues/334)) ([8824cc5](https://www.github.com/googleapis/java-bigquerydatatransfer/commit/8824cc55cb3f5cb2ca88f2505e6c580e58cf575a)) +* **samples:** add run history ([#333](https://www.github.com/googleapis/java-bigquerydatatransfer/issues/333)) ([ddf567a](https://www.github.com/googleapis/java-bigquerydatatransfer/commit/ddf567acbf57e61c83fe2af6a49520a54cd324eb)) +* **samples:** add run notification ([#328](https://www.github.com/googleapis/java-bigquerydatatransfer/issues/328)) ([2670cb1](https://www.github.com/googleapis/java-bigquerydatatransfer/commit/2670cb1080c879fc8eb23d86b5d5e42b23a4aa37)) +* **samples:** add update transfer config ([#347](https://www.github.com/googleapis/java-bigquerydatatransfer/issues/347)) ([ac78f78](https://www.github.com/googleapis/java-bigquerydatatransfer/commit/ac78f78e3bc865309c158f8a6e8d7f34c18086e7)) +* changes without context ([#332](https://www.github.com/googleapis/java-bigquerydatatransfer/issues/332)) ([5a09efb](https://www.github.com/googleapis/java-bigquerydatatransfer/commit/5a09efbdb7b4481e9fb9ac0d80f130dbcee3e418)) +* changes without context ([#337](https://www.github.com/googleapis/java-bigquerydatatransfer/issues/337)) ([a370ccd](https://www.github.com/googleapis/java-bigquerydatatransfer/commit/a370ccde96208062e424bd896e743a919ae7a9da)) + ### [1.0.10](https://www.github.com/googleapis/java-bigquerydatatransfer/compare/v1.0.9...v1.0.10) (2020-09-03) diff --git a/README.md b/README.md index f24e5af9..ca02f4d6 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,11 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquerydatatransfer:1.0.9' +compile 'com.google.cloud:google-cloud-bigquerydatatransfer:1.0.10' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquerydatatransfer" % "1.0.9" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquerydatatransfer" % "1.0.10" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-bigquerydatatransfer-bom/pom.xml b/google-cloud-bigquerydatatransfer-bom/pom.xml index 02753b50..5722aaff 100644 --- a/google-cloud-bigquerydatatransfer-bom/pom.xml +++ b/google-cloud-bigquerydatatransfer-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquerydatatransfer-bom - 1.0.10-SNAPSHOT + 1.0.10 pom com.google.cloud @@ -64,17 +64,17 @@ com.google.cloud google-cloud-bigquerydatatransfer - 1.0.10-SNAPSHOT + 1.0.10 com.google.api.grpc proto-google-cloud-bigquerydatatransfer-v1 - 1.0.10-SNAPSHOT + 1.0.10 com.google.api.grpc grpc-google-cloud-bigquerydatatransfer-v1 - 1.0.10-SNAPSHOT + 1.0.10 diff --git a/google-cloud-bigquerydatatransfer/pom.xml b/google-cloud-bigquerydatatransfer/pom.xml index 901b5637..b2880762 100644 --- a/google-cloud-bigquerydatatransfer/pom.xml +++ b/google-cloud-bigquerydatatransfer/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquerydatatransfer - 1.0.10-SNAPSHOT + 1.0.10 jar BigQuery DataTransfer https://github.com/googleapis/java-bigquerydatatransfer @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquerydatatransfer-parent - 1.0.10-SNAPSHOT + 1.0.10 google-cloud-bigquerydatatransfer diff --git a/grpc-google-cloud-bigquerydatatransfer-v1/pom.xml b/grpc-google-cloud-bigquerydatatransfer-v1/pom.xml index c24f5929..4b2437cc 100644 --- a/grpc-google-cloud-bigquerydatatransfer-v1/pom.xml +++ b/grpc-google-cloud-bigquerydatatransfer-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigquerydatatransfer-v1 - 1.0.10-SNAPSHOT + 1.0.10 grpc-google-cloud-bigquerydatatransfer-v1 GRPC library for grpc-google-cloud-bigquerydatatransfer-v1 com.google.cloud google-cloud-bigquerydatatransfer-parent - 1.0.10-SNAPSHOT + 1.0.10 diff --git a/pom.xml b/pom.xml index b2c2de06..3f5cef07 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquerydatatransfer-parent pom - 1.0.10-SNAPSHOT + 1.0.10 BigQuery DataTransfer Parent https://github.com/googleapis/java-bigquerydatatransfer @@ -77,17 +77,17 @@ com.google.api.grpc proto-google-cloud-bigquerydatatransfer-v1 - 1.0.10-SNAPSHOT + 1.0.10 com.google.api.grpc grpc-google-cloud-bigquerydatatransfer-v1 - 1.0.10-SNAPSHOT + 1.0.10 com.google.cloud google-cloud-bigquerydatatransfer - 1.0.10-SNAPSHOT + 1.0.10 diff --git a/proto-google-cloud-bigquerydatatransfer-v1/pom.xml b/proto-google-cloud-bigquerydatatransfer-v1/pom.xml index be9ec45e..dc2719d7 100644 --- a/proto-google-cloud-bigquerydatatransfer-v1/pom.xml +++ b/proto-google-cloud-bigquerydatatransfer-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigquerydatatransfer-v1 - 1.0.10-SNAPSHOT + 1.0.10 proto-google-cloud-bigquerydatatransfer-v1 PROTO library for proto-google-cloud-bigquerydatatransfer-v1 com.google.cloud google-cloud-bigquerydatatransfer-parent - 1.0.10-SNAPSHOT + 1.0.10 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c297314f..943482ab 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigquerydatatransfer - 1.0.10-SNAPSHOT + 1.0.10 diff --git a/versions.txt b/versions.txt index 01971c6b..31bccfc3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -proto-google-cloud-bigquerydatatransfer-v1:1.0.9:1.0.10-SNAPSHOT -grpc-google-cloud-bigquerydatatransfer-v1:1.0.9:1.0.10-SNAPSHOT -google-cloud-bigquerydatatransfer:1.0.9:1.0.10-SNAPSHOT +proto-google-cloud-bigquerydatatransfer-v1:1.0.10:1.0.10 +grpc-google-cloud-bigquerydatatransfer-v1:1.0.10:1.0.10 +google-cloud-bigquerydatatransfer:1.0.10:1.0.10