Skip to content

Commit adea168

Browse files
authored
Updated bigquery, cloud-tasks, and compute folders. (GoogleCloudPlatform#985)
* Updated bigquery/cloud-client * Updated datatransfer/cloud-client * Updated bigquery/rest * Updated cloud-tasks. * Updated compute/cmdline. * Updated compute/cmdline * Updated compute/mailjet * Updated compute/signed-metadata. * Updated compute README. * Fixed datatransfer/cloud-client. * Fixed bigquery/rest
1 parent b0ad772 commit adea168

File tree

48 files changed

+557
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+557
-448
lines changed

bigquery/cloud-client/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Getting Started with BigQuery and the Google Java API Client library
22

3+
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=bigquery/cloud-client/README.md">
4+
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>
5+
36
[Google's BigQuery Service][BigQuery] features a REST-based API that allows
47
developers to create applications to run ad-hoc queries on massive datasets.
58
These sample Java applications demonstrate how to access the BigQuery API using

bigquery/cloud-client/pom.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
<artifactId>bigquery-google-cloud-samples</artifactId>
2020
<packaging>jar</packaging>
2121

22-
<!-- Parent defines config for testing & linting. -->
22+
<!--
23+
The parent pom defines common style checks and testing strategies for our samples.
24+
Removing or replacing it should not affect the execution of the samples in anyway.
25+
-->
2326
<parent>
24-
<artifactId>doc-samples</artifactId>
25-
<groupId>com.google.cloud</groupId>
26-
<version>1.0.0</version>
27-
<relativePath>../..</relativePath>
27+
<groupId>com.google.cloud.samples</groupId>
28+
<artifactId>shared-configuration</artifactId>
29+
<version>1.0.8</version>
2830
</parent>
2931

3032
<properties>

bigquery/cloud-client/src/main/java/com/example/bigquery/AuthSnippets.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
2-
Copyright 2017, Google, Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
2+
* Copyright 2017 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
package com.example.bigquery;
1818

@@ -21,7 +21,6 @@
2121
import com.google.cloud.bigquery.BigQuery;
2222
import com.google.cloud.bigquery.BigQueryOptions;
2323
import com.google.cloud.bigquery.Dataset;
24-
2524
import java.io.File;
2625
import java.io.FileInputStream;
2726
import java.io.IOException;

bigquery/cloud-client/src/main/java/com/example/bigquery/QueryParametersSample.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
/*
2-
Copyright 2016 Google Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
2+
* Copyright 2016 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
package com.example.bigquery;
1818

1919
import com.google.cloud.bigquery.BigQuery;
2020
import com.google.cloud.bigquery.BigQueryOptions;
2121
import com.google.cloud.bigquery.FieldValue;
22-
import com.google.cloud.bigquery.QueryParameterValue;
2322
import com.google.cloud.bigquery.QueryJobConfiguration;
23+
import com.google.cloud.bigquery.QueryParameterValue;
2424
import com.google.cloud.bigquery.QueryResponse;
2525
import com.google.cloud.bigquery.QueryResult;
26+
import java.io.IOException;
27+
import java.util.Arrays;
28+
import java.util.List;
2629
import org.joda.time.DateTime;
2730
import org.joda.time.DateTimeZone;
2831
import org.joda.time.format.DateTimeFormatter;
2932
import org.joda.time.format.ISODateTimeFormat;
3033

31-
import java.io.IOException;
32-
import java.util.Arrays;
33-
import java.util.List;
34-
3534
/** A sample that demonstrates use of query parameters. */
3635
public class QueryParametersSample {
3736
private static final int ERROR_CODE = 1;

bigquery/cloud-client/src/main/java/com/example/bigquery/QuerySample.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
2-
Copyright 2016, Google, Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
2+
* Copyright 2016 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
package com.example.bigquery;
1818

@@ -26,6 +26,10 @@
2626
import com.google.cloud.bigquery.QueryResponse;
2727
import com.google.cloud.bigquery.QueryResult;
2828
import com.google.cloud.bigquery.TableId;
29+
import java.io.IOException;
30+
import java.util.List;
31+
import java.util.UUID;
32+
import java.util.concurrent.TimeoutException;
2933
import org.apache.commons.cli.CommandLine;
3034
import org.apache.commons.cli.CommandLineParser;
3135
import org.apache.commons.cli.DefaultParser;
@@ -34,11 +38,6 @@
3438
import org.apache.commons.cli.Options;
3539
import org.apache.commons.cli.ParseException;
3640

37-
import java.io.IOException;
38-
import java.util.List;
39-
import java.util.UUID;
40-
import java.util.concurrent.TimeoutException;
41-
4241
/** Runs a query against BigQuery. */
4342
public class QuerySample {
4443
// [START query_config_simple]
@@ -158,8 +157,9 @@ public static void runQuery(QueryJobConfiguration queryConfig)
158157
/** Prompts the user for the required parameters to perform a query. */
159158
public static void main(final String[] args)
160159
throws IOException, InterruptedException, TimeoutException, ParseException {
160+
//CHECKSTYLE OFF: VariableDeclarationUsageDistance - improves readability
161161
Options options = new Options();
162-
162+
//CHECKSTLYE ON: VariableDeclarationUsageDistance
163163
// Use an OptionsGroup to choose which sample to run.
164164
OptionGroup samples = new OptionGroup();
165165
samples.addOption(Option.builder().longOpt("runSimpleQuery").build());

bigquery/cloud-client/src/main/java/com/example/bigquery/QuickstartSample.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
2-
Copyright 2016, Google, Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
2+
* Copyright 2016 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
package com.example.bigquery;
1818

bigquery/cloud-client/src/main/java/com/example/bigquery/SimpleApp.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
/*
2-
Copyright 2016, Google, Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
2+
* Copyright 2016 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
package com.example.bigquery;
1818

1919
// [START bigquery_simple_app_all]
2020
// [START bigquery_simple_app_deps]
21+
2122
import com.google.cloud.bigquery.BigQuery;
2223
import com.google.cloud.bigquery.BigQueryOptions;
23-
import com.google.cloud.bigquery.FieldValue;
2424
import com.google.cloud.bigquery.FieldValueList;
2525
import com.google.cloud.bigquery.Job;
2626
import com.google.cloud.bigquery.JobId;
2727
import com.google.cloud.bigquery.JobInfo;
2828
import com.google.cloud.bigquery.QueryJobConfiguration;
2929
import com.google.cloud.bigquery.QueryResponse;
3030
import com.google.cloud.bigquery.QueryResult;
31-
import java.util.List;
3231
import java.util.UUID;
3332
// [END bigquery_simple_app_deps]
3433

bigquery/cloud-client/src/test/java/com/example/bigquery/AuthSnippetsIT.java

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
/*
2-
Copyright 2017, Google, Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
2+
* Copyright 2017 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
package com.example.bigquery;
1818

1919
import static com.google.common.truth.Truth.assertThat;
2020

21+
import java.io.ByteArrayOutputStream;
22+
import java.io.PrintStream;
2123
import org.junit.After;
2224
import org.junit.Before;
2325
import org.junit.Test;
2426
import org.junit.runner.RunWith;
2527
import org.junit.runners.JUnit4;
2628

27-
import java.io.ByteArrayOutputStream;
28-
import java.io.PrintStream;
29-
3029
/** Tests for auth samples. */
3130
@RunWith(JUnit4.class)
3231
@SuppressWarnings("checkstyle:abbreviationaswordinname")

bigquery/cloud-client/src/test/java/com/example/bigquery/QueryParametersSampleIT.java

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
/*
2-
Copyright 2016 Google Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
2+
* Copyright 2016 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
package com.example.bigquery;
1818

1919
import static com.google.common.truth.Truth.assertThat;
2020

21+
import java.io.ByteArrayOutputStream;
22+
import java.io.PrintStream;
2123
import org.junit.After;
2224
import org.junit.Before;
2325
import org.junit.Test;
2426
import org.junit.runner.RunWith;
2527
import org.junit.runners.JUnit4;
2628

27-
import java.io.ByteArrayOutputStream;
28-
import java.io.PrintStream;
29-
3029
/** Tests for simple app sample. */
3130
@RunWith(JUnit4.class)
3231
@SuppressWarnings("checkstyle:abbreviationaswordinname")

0 commit comments

Comments
 (0)