Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

docs: add more code samples for game servers #32

Merged
merged 5 commits into from Jul 31, 2020

Conversation

Yingxin-Jiang
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 27, 2020
samples/snippets/update_rollout_override.py Outdated Show resolved Hide resolved
samples/snippets/update_rollout_override.py Outdated Show resolved Hide resolved
from google.cloud import gaming
from google.cloud.gaming_v1.types import game_server_configs

FLEET_SPEC = """
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there guidance somewhere on how to construct this JSON?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see the protos mention https://agones.dev/site/docs/reference/fleet/, could you add that as a comment here as well?

Attributes:
fleet_spec (str):
Agones fleet spec. Example spec:
``https://agones.dev/site/docs/reference/fleet/``.

Copy link
Contributor

Choose a reason for hiding this comment

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

(Apologies for triple posting) I see the link provides a YAML but no JSON equivalent. If the Agones docs are within in your control it may be nice to provide a JSON version.

Choose a reason for hiding this comment

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

Per the go canonical example, https://github.com/GoogleCloudPlatform/golang-samples/blob/master/gaming/servers/create_config.go#L28

This fleet spec should be included in the sample range, and have the same comment as the Go fleet has.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the same comment as the Go sample has. Thanks for point this out.

Choose a reason for hiding this comment

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

Please move the sample's # [START cloud_game_servers_config_create] to above the start of the fleet spec definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Sorry I missed what you meant in the previous comment.



# [START cloud_game_servers_update_realm]
def update_realm(project_id, location, realm_id):

Choose a reason for hiding this comment

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

Do we need update samples for realms? For go we only have update rollout samples. We have no place for this in the documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Labels are important for GCP services. I was testing label update with the client library. Then I kept it here as it might be useful users.

I can remove them if 1-1 mapping between doc and sample is required.

@busunkim96 busunkim96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 31, 2020
@yoshi-kokoro yoshi-kokoro removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jul 31, 2020
@busunkim96 busunkim96 changed the title Add more code samples for game servers. docs: add more code samples for game servers. Jul 31, 2020
@busunkim96 busunkim96 changed the title docs: add more code samples for game servers. docs: add more code samples for game servers Jul 31, 2020
@busunkim96 busunkim96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 31, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 31, 2020
@busunkim96 busunkim96 merged commit 2d30003 into googleapis:master Jul 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add code samples for game servers
4 participants