This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat: Adding code samples and tests for them #55
feat: Adding code samples and tests for them #55
Changes from 2 commits
edbabb2
5c53f10
9bca18c
1178ae0
48b5162
6d0b427
3348ef4
1a36afa
f2a02f1
0107c58
8f0e869
8040588
4c9b0fb
572244a
5e7d5c2
75a9d36
c1670b9
2bf4583
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend using
gcloud auth application-default login
instead. It's more secure if you don't have to download a JSON key. It's also easier. You can skip the next 3 steps with this method.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Good point. Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style suggestion for consistency with existing python samples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a stray comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Changed that part already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LRO experience looks different from existing GAPICs. @vam-google Does the Compute API have a non-standard LRO representation? It doesn't look like the generator produced the usual
google.api_core.Operation
type.For comparison, see videointelligence where you can do
operation.result(timeout=90)
to poll for the result.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@busunkim96 would a simpler approach suggest by @bshaffer work here?
Please refer to https://github.com/GoogleCloudPlatform/php-docs-samples/blob/80801c983457f407cb9a81d3b60654369f090e03/compute/cloud-client/instances/src/create_instance.php#L80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how I saw the team use the operations in their test code. It is an instance of
google.cloud.compute_v1.types.Operation
and notgoogle.api_core.Operation
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the sample show error handling? (Even if it is just printing out the error/warnings?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.