Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Google Credentials #3023

Merged
merged 8 commits into from
Jun 3, 2020
Merged

Update Google Credentials #3023

merged 8 commits into from
Jun 3, 2020

Conversation

averikitsch
Copy link
Contributor

@averikitsch averikitsch commented Jun 2, 2020

Fixes #2885

It's a good idea to open an issue first for discussion.

  • I have followed Sample Format Guide
  • pom.xml parent set to latest shared-configuration
  • Appropriate changes to README are included in PR
  • API's need to be enabled to test (tell us)
  • Environment Variables need to be set (ask us to set them)
  • Tests pass (mvn -P lint clean verify)
    • (Note- Checkstyle passing is required; Spotbugs, ErrorProne, PMD, etc. ERROR's are advisory only)
  • Please merge this PR for me once it is approved.

@averikitsch averikitsch requested a review from a team June 2, 2020 19:28
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 2, 2020
Copy link
Contributor

@lesv lesv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were a few things that were modified by javafmt that aren't how we do things now, but they are out of scope for this PR. LGTM

@lesv lesv assigned lesv and unassigned dzlier-gcp Jun 2, 2020
/** Set the path of the OS image for the sample VM instance to be created. */
private static final String SOURCE_IMAGE_PREFIX =
"https://www.googleapis.com/compute/v1/projects/";

private static final String SOURCE_IMAGE_PATH =
"debian-cloud/global/images/debian-7-wheezy-v20150710";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ubuntu-2004-focal-v20200529

Comment on lines 167 to 171
"https://www.googleapis.com/compute/v1/projects/"
+ PROJECT_ID + "/zones/" + ZONE_NAME + "/machineTypes/n1-standard-1");
+ PROJECT_ID
+ "/zones/"
+ ZONE_NAME
+ "/machineTypes/n1-standard-1");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could create this string w/ String.format(...) Also, we should probably use e2-standard-1 as well.

Comment on lines 176 to 178
"https://www.googleapis.com/compute/v1/projects/"
+ PROJECT_ID
+ "/global/networks/default");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create w/ String.format(...)

Comment on lines 199 to 203
"https://www.googleapis.com/compute/v1/projects/"
+ PROJECT_ID
+ "/zones/"
+ ZONE_NAME
+ "/diskTypes/pd-standard");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create w/ String.format(...)

@@ -208,7 +220,8 @@ public static Operation startInstance(Compute compute, String instanceName) thro
// If you put a script called "vm-startup.sh" in this Google Cloud Storage
// bucket, it will execute on VM startup. This assumes you've created a
// bucket named the same as your PROJECT_ID.
// For info on creating buckets see: https://cloud.google.com/storage/docs/cloud-console#_creatingbuckets
// For info on creating buckets see:
// https://cloud.google.com/storage/docs/cloud-console#_creatingbuckets
item.setValue("gs://" + PROJECT_ID + "/vm-startup.sh");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String.format(...) ?

Comment on lines 38 to 45
* <p>- Create job within batch
*
* - Update job within batch
* <p>- Update job within batch
*
* - Delete job within batch.
* <p>- Delete job within batch.
*
* For simplicity, the samples always use the same kind of requests in each batch. In a real case ,
* you might put different kinds of request in one batch.
* <p>For simplicity, the samples always use the same kind of requests in each batch. In a real case
* , you might put different kinds of request in one batch.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<p>!!!

Comment on lines 37 to 39
* <p>- Construct a Job with CustomAttribute
*
* - Search Job with CustomAttributeFilter
* <p>- Search Job with CustomAttributeFilter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<p>!!!

Comment on lines 29 to 31
* <p>- Default auto complete (on both company display name and job title)
*
* - Auto complete on job title only
* <p>- Auto complete on job title only
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<p>!!!

Comment on lines 29 to 39
* <p>- Construct a company with required fields
*
* - Create a company
* <p>- Create a company
*
* - Get a company
* <p>- Get a company
*
* - Update a company
* <p>- Update a company
*
* - Update a company with field mask
* <p>- Update a company with field mask
*
* - Delete a company
* <p>- Delete a company
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<p>!!!

Comment on lines 32 to 43
* <p>- Construct a job with required fields
*
* - Create a job
* <p>- Create a job
*
* - Get a job
* <p>- Get a job
*
* - Update a job
* <p>- Update a job
*
* - Update a job with field mask
* <p>- Update a job with field mask
*
* - Delete a job
* <p>- Delete a job
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<p>!!!

@averikitsch averikitsch added the automerge Merge the pull request once unit tests and other checks pass. label Jun 3, 2020
@averikitsch averikitsch merged commit 76a8fa9 into master Jun 3, 2020
@averikitsch averikitsch deleted the GoogleCreds branch June 3, 2020 15:43
jakubrauch pushed a commit to jakubrauch/java-docs-samples that referenced this pull request Jun 4, 2020
* Update credentials

* lint

* Update accesstoken

* lint

* remove <p>

* Use String.format

* lint

* Update test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge the pull request once unit tests and other checks pass. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ComputeEngineSample.java uses deprecated APIs
4 participants