-
Notifications
You must be signed in to change notification settings - Fork 6
docs: add more code samples for game servers #32
Conversation
from google.cloud import gaming | ||
from google.cloud.gaming_v1.types import game_server_configs | ||
|
||
FLEET_SPEC = """ |
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 there guidance somewhere on how to construct this JSON?
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 see the protos mention https://agones.dev/site/docs/reference/fleet/, could you add that as a comment here as well?
python-game-servers/google/cloud/gaming_v1/types/game_server_configs.py
Lines 199 to 202 in 952f47e
Attributes: | |
fleet_spec (str): | |
Agones fleet spec. Example spec: | |
``https://agones.dev/site/docs/reference/fleet/``. |
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.
(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.
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.
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.
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.
Added the same comment as the Go sample has. Thanks for point this out.
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.
Please move the sample's # [START cloud_game_servers_config_create]
to above the start of the fleet spec definition.
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. Sorry I missed what you meant in the previous comment.
|
||
|
||
# [START cloud_game_servers_update_realm] | ||
def update_realm(project_id, location, realm_id): |
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.
Do we need update samples for realms? For go we only have update rollout samples. We have no place for this in the documentation.
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.
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.
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:
Add code samples for game servers #24
Done
Done
Done
Fixes Add code samples for game servers #24 🦕