From ba37f1cf21997555cb25b9226b522dcb9d6c0a3c Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Thu, 28 Dec 2023 20:19:20 +0000 Subject: [PATCH 1/8] Docs: Lifecycle Management of Counters and Lists in REST --- .../en/docs/Guides/Client SDKs/rest.md | 95 ++++++++++++++++++- 1 file changed, 93 insertions(+), 2 deletions(-) diff --git a/site/content/en/docs/Guides/Client SDKs/rest.md b/site/content/en/docs/Guides/Client SDKs/rest.md index 26861484f7..671d803cf5 100644 --- a/site/content/en/docs/Guides/Client SDKs/rest.md +++ b/site/content/en/docs/Guides/Client SDKs/rest.md @@ -238,6 +238,97 @@ Apply an Annotation with the prefix "agones.dev/sdk-" to the backing `GameServer curl -d '{"key": "foo", "value": "bar"}' -H "Content-Type: application/json" -X PUT http://localhost:${AGONES_SDK_HTTP_PORT}/metadata/annotation ``` +### Counters + +{{< alpha title="Counters" gate="Counters" >}} + +#### Alpha: GetCounter +This function retrieves a specified counter by its name and returns its information. + +##### Example + +```bash +curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/counters/conformanceTestCounter +``` + +Response: +```json +{"name":"conformanceTestCounter", "count":"1", "capacity":"10"} +``` + +#### Alpha: UpdateCounter +This function updates the specified counter's properties, such as its count and capacity, and returns the updated counter details. + +##### Example + +```bash +curl -d '{"count": "5", "capacity": "11"}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/counters/conformanceTestCounter +``` + +Response: +```json +{"name":"conformanceTestCounter", "count":"5", "capacity":"11"} +``` + +### Lists + +{{< alpha title="Lists" gate="Lists" >}} + +#### Alpha: GetList +This function retrieves a specific list identified by its name, returns the list's information. + +##### Example +```bash +curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/conformanceTestList +``` + +Response: +```json +{"name":"conformanceTestList", "capacity":"100", "values":["test0", "test1", "test2"] +``` + +#### Alpha: UpdateList +This function updates the specified list's properties, such as its capacity and values, returns the updated list details. + +##### Example + +```bash +curl -d '{"capacity": "120", "values": ["test3", "test4"]}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/conformanceTestList +``` + +Response: +```json +{"name":"conformanceTestList", "capacity":"120", "values":["test3", "test4"]} +``` + +#### Alpha: AddListValue +This function adds a new value to a specified list and returns the list with this addition. + +##### Example + +```bash +curl -d '{"value": "test9"}' -H "Content-Type: application/json" -X POST http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/conformanceTestList:addValue +``` + +Response: +```json +{"name":"conformanceTestList", "capacity":"120", "values":["test3", "test4", "test9"]} +``` + +#### Alpha: RemoveListValue +This function removes a value from a given list and returns updated list. + +##### Example + +```bash +curl -d '{"value": "test3"}' -H "Content-Type: application/json" -X POST http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/conformanceTestList:removeValue +``` + +Response: +```json +{"name":"conformanceTestList", "capacity":"120", "values":["test4", "test9"]} +``` + ### Player Tracking {{< alpha title="Player Tracking" gate="PlayerTracking" >}} @@ -305,6 +396,8 @@ Response: This function retrieves the current player count. This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the GameServer status resource. +##### Example + ```bash curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/alpha/player/count ``` @@ -314,8 +407,6 @@ Response: {"count":"2"} ``` -##### Example - #### Alpha: IsPlayerConnected This function returns if the playerID is currently connected to the GameServer. This is always accurate from what has From 8875016ef4018b781af2af5b32a65c965e2d2049 Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Sat, 30 Dec 2023 00:12:49 +0000 Subject: [PATCH 2/8] Review changes --- .../en/docs/Guides/Client SDKs/rest.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/site/content/en/docs/Guides/Client SDKs/rest.md b/site/content/en/docs/Guides/Client SDKs/rest.md index 671d803cf5..a223798f9b 100644 --- a/site/content/en/docs/Guides/Client SDKs/rest.md +++ b/site/content/en/docs/Guides/Client SDKs/rest.md @@ -238,6 +238,21 @@ Apply an Annotation with the prefix "agones.dev/sdk-" to the backing `GameServer curl -d '{"key": "foo", "value": "bar"}' -H "Content-Type: application/json" -X PUT http://localhost:${AGONES_SDK_HTTP_PORT}/metadata/annotation ``` +### Local Development Setup: Counters and Lists +Before using the examples provided in this document for Counters and Lists, please ensure that you have set up the local development version with `CountsAndLists` enabled. You can do this by running the following command: + +```bash +FEATURE_GATES="CountsAndLists=true" go run cmd/sdk-server/main.go --local +``` + +This command starts the local development server, which includes a Counter named `conformanceTestCounter` and a List named `conformanceTestList`. + +Additionally, please make sure to set the HTTP port to 9358 as the local server uses it. You can do this by running the following command in a different terminal: + +```bash +export AGONES_SDK_HTTP_PORT=9358 +``` + ### Counters {{< alpha title="Counters" gate="Counters" >}} @@ -284,11 +299,11 @@ curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HT Response: ```json -{"name":"conformanceTestList", "capacity":"100", "values":["test0", "test1", "test2"] +{"name":"conformanceTestList", "capacity":"100", "values":["test0", "test1", "test2"]} ``` #### Alpha: UpdateList -This function updates the specified list's properties, such as its capacity and values, returns the updated list details. +This function updates the specified list's properties, such as its capacity and values, returns the updated list details. This will overwrite all existing List.Values with the update list request values. Use addValue or removeValue for modifying the List.Values field. ##### Example From f51a108a8b53dbe75bfe4284bac9f0116ddce0e0 Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Thu, 4 Jan 2024 19:02:14 +0000 Subject: [PATCH 3/8] Review changes --- .../en/docs/Guides/Client SDKs/local.md | 12 ++++++++++++ .../en/docs/Guides/Client SDKs/rest.md | 19 ++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/site/content/en/docs/Guides/Client SDKs/local.md b/site/content/en/docs/Guides/Client SDKs/local.md index 7e622f5332..9da3d993d7 100644 --- a/site/content/en/docs/Guides/Client SDKs/local.md +++ b/site/content/en/docs/Guides/Client SDKs/local.md @@ -207,6 +207,18 @@ go run cmd/sdk-server/main.go --local Commandline flags (e.g. `--local`) are exactly the same as command line flags when utilising a pre-built binary. +**Enabling Specific Features:** +For development and testing purposes, you might want to enable specific features in the SDK Server. To do this, set the FEATURE_GATES environment variable before running the server. For instance: +```bash +FEATURE_GATES="FeatureName=true" go run cmd/sdk-server/main.go --local +``` + +Replace `FeatureName` with the name of the feature you want to enable. This command starts the local SDK Server with the specified feature activated. + +**Setting the HTTP port:** +To customize the SDK Server, set the HTTP port to 9358, as used by the local server, by running this command in your terminal: `export AGONES_SDK_HTTP_PORT=9358` + + ## Next Steps: - Learn how to connect your local development game server binary into a running Agones Kubernetes cluster for even more live development options with an [out of cluster dev server]({{< ref "/docs/Advanced/out-of-cluster-dev-server.md" >}}). diff --git a/site/content/en/docs/Guides/Client SDKs/rest.md b/site/content/en/docs/Guides/Client SDKs/rest.md index a223798f9b..f57da8b2cf 100644 --- a/site/content/en/docs/Guides/Client SDKs/rest.md +++ b/site/content/en/docs/Guides/Client SDKs/rest.md @@ -238,25 +238,12 @@ Apply an Annotation with the prefix "agones.dev/sdk-" to the backing `GameServer curl -d '{"key": "foo", "value": "bar"}' -H "Content-Type: application/json" -X PUT http://localhost:${AGONES_SDK_HTTP_PORT}/metadata/annotation ``` -### Local Development Setup: Counters and Lists -Before using the examples provided in this document for Counters and Lists, please ensure that you have set up the local development version with `CountsAndLists` enabled. You can do this by running the following command: - -```bash -FEATURE_GATES="CountsAndLists=true" go run cmd/sdk-server/main.go --local -``` - -This command starts the local development server, which includes a Counter named `conformanceTestCounter` and a List named `conformanceTestList`. - -Additionally, please make sure to set the HTTP port to 9358 as the local server uses it. You can do this by running the following command in a different terminal: - -```bash -export AGONES_SDK_HTTP_PORT=9358 -``` - ### Counters {{< alpha title="Counters" gate="Counters" >}} +**Note:** In the Counters examples, we retrieve the counter under the key "conformanceTestCounter" to make it extra clear. + #### Alpha: GetCounter This function retrieves a specified counter by its name and returns its information. @@ -289,6 +276,8 @@ Response: {{< alpha title="Lists" gate="Lists" >}} +**Note:** In the Lists examples, we retrieve the List under the key "conformanceTestList" to make it extra clear. + #### Alpha: GetList This function retrieves a specific list identified by its name, returns the list's information. From c346e85eb78434b119a0f8b7abac0c18b6133120 Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Fri, 5 Jan 2024 19:01:04 +0000 Subject: [PATCH 4/8] Review changes --- .../en/docs/Guides/Client SDKs/local.md | 27 ++++++++------ .../en/docs/Guides/Client SDKs/rest.md | 37 +++++++++++-------- 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/site/content/en/docs/Guides/Client SDKs/local.md b/site/content/en/docs/Guides/Client SDKs/local.md index 9da3d993d7..be524ccbd4 100644 --- a/site/content/en/docs/Guides/Client SDKs/local.md +++ b/site/content/en/docs/Guides/Client SDKs/local.md @@ -58,6 +58,22 @@ You should see output similar to the following: {"message":"gameserver update received","severity":"info","time":"2019-10-30T21:46:18.179459+03:00"} ``` +### Enabling Feature Gates + +For development and testing purposes, you might want to enable specific [features gates]({{% ref "/docs/Guides/feature-stages.md#feature-gates" %}}) in the local SDK Server. + +To do this, you can either set the `FEATURE_GATES` environment variable or use the `--feature-gates` command line parameter like so, with the same format as utilised when [configuring it on a Helm install]({{< ref "/docs/Installation/Install Agones/helm.md#configuration" >}}). + +For example: + +```bash +./sdk-server.linux.amd64 --local --feature-gates Example=true +``` +or +```bash +FEATURE_GATES=Example=true ./sdk-server.linux.amd64 --local +``` + ## Providing your own `GameServer` configuration for local development By default, the local sdk-server will create a default `GameServer` configuration that is used for `GameServer()` @@ -207,17 +223,6 @@ go run cmd/sdk-server/main.go --local Commandline flags (e.g. `--local`) are exactly the same as command line flags when utilising a pre-built binary. -**Enabling Specific Features:** -For development and testing purposes, you might want to enable specific features in the SDK Server. To do this, set the FEATURE_GATES environment variable before running the server. For instance: -```bash -FEATURE_GATES="FeatureName=true" go run cmd/sdk-server/main.go --local -``` - -Replace `FeatureName` with the name of the feature you want to enable. This command starts the local SDK Server with the specified feature activated. - -**Setting the HTTP port:** -To customize the SDK Server, set the HTTP port to 9358, as used by the local server, by running this command in your terminal: `export AGONES_SDK_HTTP_PORT=9358` - ## Next Steps: diff --git a/site/content/en/docs/Guides/Client SDKs/rest.md b/site/content/en/docs/Guides/Client SDKs/rest.md index f57da8b2cf..4c54fe4b96 100644 --- a/site/content/en/docs/Guides/Client SDKs/rest.md +++ b/site/content/en/docs/Guides/Client SDKs/rest.md @@ -238,11 +238,16 @@ Apply an Annotation with the prefix "agones.dev/sdk-" to the backing `GameServer curl -d '{"key": "foo", "value": "bar"}' -H "Content-Type: application/json" -X PUT http://localhost:${AGONES_SDK_HTTP_PORT}/metadata/annotation ``` +### Counters and Lists + +{{< alpha title="Counters and Lists" gate="CountsAndLists" >}} + + ### Counters -{{< alpha title="Counters" gate="Counters" >}} +In all the Counter examples, we retrieve the counter under the key `rooms` as if it was previously defined in [`GameServer.Spec.counters[room]`]({{< ref "/docs/Reference/agones_crd_api_reference.html#agones.dev/v1.GameServerSpec" >}}). -**Note:** In the Counters examples, we retrieve the counter under the key "conformanceTestCounter" to make it extra clear. +For your own Counter REST requests, replace the value `rooms` with your own key in the path. #### Alpha: GetCounter This function retrieves a specified counter by its name and returns its information. @@ -250,12 +255,12 @@ This function retrieves a specified counter by its name and returns its informat ##### Example ```bash -curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/counters/conformanceTestCounter +curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/counters/rooms ``` Response: ```json -{"name":"conformanceTestCounter", "count":"1", "capacity":"10"} +{"name":"rooms", "count":"1", "capacity":"10"} ``` #### Alpha: UpdateCounter @@ -264,31 +269,31 @@ This function updates the specified counter's properties, such as its count and ##### Example ```bash -curl -d '{"count": "5", "capacity": "11"}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/counters/conformanceTestCounter +curl -d '{"count": "5", "capacity": "11"}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/counters/rooms ``` Response: ```json -{"name":"conformanceTestCounter", "count":"5", "capacity":"11"} +{"name":"rooms", "count":"5", "capacity":"11"} ``` ### Lists -{{< alpha title="Lists" gate="Lists" >}} +In all the List examples, we retrieve the list under the key `players` as if it was previously defined in [`GameServer.Spec.lists[players]`]({{< ref "/docs/Reference/agones_crd_api_reference.html#agones.dev/v1.GameServerSpec" >}}). -**Note:** In the Lists examples, we retrieve the List under the key "conformanceTestList" to make it extra clear. +For your own List REST based requests, replace the value `players` with your own key in the path. #### Alpha: GetList This function retrieves a specific list identified by its name, returns the list's information. ##### Example ```bash -curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/conformanceTestList +curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/players ``` Response: ```json -{"name":"conformanceTestList", "capacity":"100", "values":["test0", "test1", "test2"]} +{"name":"players", "capacity":"100", "values":["player0", "player1", "player2"]} ``` #### Alpha: UpdateList @@ -297,12 +302,12 @@ This function updates the specified list's properties, such as its capacity and ##### Example ```bash -curl -d '{"capacity": "120", "values": ["test3", "test4"]}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/conformanceTestList +curl -d '{"capacity": "120", "values": ["player3", "player4"]}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/players ``` Response: ```json -{"name":"conformanceTestList", "capacity":"120", "values":["test3", "test4"]} +{"name":"players", "capacity":"120", "values":["player3", "player4"]} ``` #### Alpha: AddListValue @@ -311,12 +316,12 @@ This function adds a new value to a specified list and returns the list with thi ##### Example ```bash -curl -d '{"value": "test9"}' -H "Content-Type: application/json" -X POST http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/conformanceTestList:addValue +curl -d '{"value": "player9"}' -H "Content-Type: application/json" -X POST http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/players:addValue ``` Response: ```json -{"name":"conformanceTestList", "capacity":"120", "values":["test3", "test4", "test9"]} +{"name":"players", "capacity":"120", "values":["player3", "player4", "player9"]} ``` #### Alpha: RemoveListValue @@ -325,12 +330,12 @@ This function removes a value from a given list and returns updated list. ##### Example ```bash -curl -d '{"value": "test3"}' -H "Content-Type: application/json" -X POST http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/conformanceTestList:removeValue +curl -d '{"value": "player3"}' -H "Content-Type: application/json" -X POST http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/players:removeValue ``` Response: ```json -{"name":"conformanceTestList", "capacity":"120", "values":["test4", "test9"]} +{"name":"players", "capacity":"120", "values":["player4", "player9"]} ``` ### Player Tracking From aee6dc3cdd435bdbfe8198753b24b97d5b0067ba Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Fri, 5 Jan 2024 19:53:29 +0000 Subject: [PATCH 5/8] Feature shortcode --- site/content/en/docs/Guides/Client SDKs/local.md | 2 ++ site/content/en/docs/Guides/Client SDKs/rest.md | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/site/content/en/docs/Guides/Client SDKs/local.md b/site/content/en/docs/Guides/Client SDKs/local.md index be524ccbd4..efbfb919e4 100644 --- a/site/content/en/docs/Guides/Client SDKs/local.md +++ b/site/content/en/docs/Guides/Client SDKs/local.md @@ -58,6 +58,7 @@ You should see output similar to the following: {"message":"gameserver update received","severity":"info","time":"2019-10-30T21:46:18.179459+03:00"} ``` +{{% feature publishVersion="1.38.0" %}} ### Enabling Feature Gates For development and testing purposes, you might want to enable specific [features gates]({{% ref "/docs/Guides/feature-stages.md#feature-gates" %}}) in the local SDK Server. @@ -73,6 +74,7 @@ or ```bash FEATURE_GATES=Example=true ./sdk-server.linux.amd64 --local ``` +{{% /feature %}} ## Providing your own `GameServer` configuration for local development diff --git a/site/content/en/docs/Guides/Client SDKs/rest.md b/site/content/en/docs/Guides/Client SDKs/rest.md index 4c54fe4b96..cd04a55b19 100644 --- a/site/content/en/docs/Guides/Client SDKs/rest.md +++ b/site/content/en/docs/Guides/Client SDKs/rest.md @@ -238,11 +238,11 @@ Apply an Annotation with the prefix "agones.dev/sdk-" to the backing `GameServer curl -d '{"key": "foo", "value": "bar"}' -H "Content-Type: application/json" -X PUT http://localhost:${AGONES_SDK_HTTP_PORT}/metadata/annotation ``` +{{% feature publishVersion="1.38.0" %}} ### Counters and Lists {{< alpha title="Counters and Lists" gate="CountsAndLists" >}} - ### Counters In all the Counter examples, we retrieve the counter under the key `rooms` as if it was previously defined in [`GameServer.Spec.counters[room]`]({{< ref "/docs/Reference/agones_crd_api_reference.html#agones.dev/v1.GameServerSpec" >}}). @@ -337,6 +337,7 @@ Response: ```json {"name":"players", "capacity":"120", "values":["player4", "player9"]} ``` +{{% /feature %}} ### Player Tracking From 561f1e4e693fa79a966e4f675311daadc08dadbf Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Mon, 8 Jan 2024 20:08:47 +0000 Subject: [PATCH 6/8] Review changes --- .../en/docs/Guides/Client SDKs/local.md | 2 -- .../en/docs/Guides/Client SDKs/rest.md | 30 +++++++++---------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/site/content/en/docs/Guides/Client SDKs/local.md b/site/content/en/docs/Guides/Client SDKs/local.md index efbfb919e4..be524ccbd4 100644 --- a/site/content/en/docs/Guides/Client SDKs/local.md +++ b/site/content/en/docs/Guides/Client SDKs/local.md @@ -58,7 +58,6 @@ You should see output similar to the following: {"message":"gameserver update received","severity":"info","time":"2019-10-30T21:46:18.179459+03:00"} ``` -{{% feature publishVersion="1.38.0" %}} ### Enabling Feature Gates For development and testing purposes, you might want to enable specific [features gates]({{% ref "/docs/Guides/feature-stages.md#feature-gates" %}}) in the local SDK Server. @@ -74,7 +73,6 @@ or ```bash FEATURE_GATES=Example=true ./sdk-server.linux.amd64 --local ``` -{{% /feature %}} ## Providing your own `GameServer` configuration for local development diff --git a/site/content/en/docs/Guides/Client SDKs/rest.md b/site/content/en/docs/Guides/Client SDKs/rest.md index cd04a55b19..867ff189c6 100644 --- a/site/content/en/docs/Guides/Client SDKs/rest.md +++ b/site/content/en/docs/Guides/Client SDKs/rest.md @@ -238,21 +238,20 @@ Apply an Annotation with the prefix "agones.dev/sdk-" to the backing `GameServer curl -d '{"key": "foo", "value": "bar"}' -H "Content-Type: application/json" -X PUT http://localhost:${AGONES_SDK_HTTP_PORT}/metadata/annotation ``` -{{% feature publishVersion="1.38.0" %}} ### Counters and Lists {{< alpha title="Counters and Lists" gate="CountsAndLists" >}} -### Counters +#### Counters In all the Counter examples, we retrieve the counter under the key `rooms` as if it was previously defined in [`GameServer.Spec.counters[room]`]({{< ref "/docs/Reference/agones_crd_api_reference.html#agones.dev/v1.GameServerSpec" >}}). For your own Counter REST requests, replace the value `rooms` with your own key in the path. -#### Alpha: GetCounter +##### Alpha: GetCounter This function retrieves a specified counter by its name and returns its information. -##### Example +###### Example ```bash curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/counters/rooms @@ -263,10 +262,10 @@ Response: {"name":"rooms", "count":"1", "capacity":"10"} ``` -#### Alpha: UpdateCounter +##### Alpha: UpdateCounter This function updates the specified counter's properties, such as its count and capacity, and returns the updated counter details. -##### Example +###### Example ```bash curl -d '{"count": "5", "capacity": "11"}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/counters/rooms @@ -277,16 +276,16 @@ Response: {"name":"rooms", "count":"5", "capacity":"11"} ``` -### Lists +#### Lists In all the List examples, we retrieve the list under the key `players` as if it was previously defined in [`GameServer.Spec.lists[players]`]({{< ref "/docs/Reference/agones_crd_api_reference.html#agones.dev/v1.GameServerSpec" >}}). For your own List REST based requests, replace the value `players` with your own key in the path. -#### Alpha: GetList +##### Alpha: GetList This function retrieves a specific list identified by its name, returns the list's information. -##### Example +###### Example ```bash curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/players ``` @@ -296,10 +295,10 @@ Response: {"name":"players", "capacity":"100", "values":["player0", "player1", "player2"]} ``` -#### Alpha: UpdateList +##### Alpha: UpdateList This function updates the specified list's properties, such as its capacity and values, returns the updated list details. This will overwrite all existing List.Values with the update list request values. Use addValue or removeValue for modifying the List.Values field. -##### Example +###### Example ```bash curl -d '{"capacity": "120", "values": ["player3", "player4"]}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/players @@ -310,10 +309,10 @@ Response: {"name":"players", "capacity":"120", "values":["player3", "player4"]} ``` -#### Alpha: AddListValue +##### Alpha: AddListValue This function adds a new value to a specified list and returns the list with this addition. -##### Example +###### Example ```bash curl -d '{"value": "player9"}' -H "Content-Type: application/json" -X POST http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/players:addValue @@ -324,10 +323,10 @@ Response: {"name":"players", "capacity":"120", "values":["player3", "player4", "player9"]} ``` -#### Alpha: RemoveListValue +##### Alpha: RemoveListValue This function removes a value from a given list and returns updated list. -##### Example +###### Example ```bash curl -d '{"value": "player3"}' -H "Content-Type: application/json" -X POST http://localhost:${AGONES_SDK_HTTP_PORT}/v1alpha1/lists/players:removeValue @@ -337,7 +336,6 @@ Response: ```json {"name":"players", "capacity":"120", "values":["player4", "player9"]} ``` -{{% /feature %}} ### Player Tracking From 0a60b0c0fa7e55d44d19363dab6ca5f2b3814cb3 Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Tue, 9 Jan 2024 03:29:21 +0000 Subject: [PATCH 7/8] Review changes --- site/content/en/docs/Guides/Client SDKs/rest.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/en/docs/Guides/Client SDKs/rest.md b/site/content/en/docs/Guides/Client SDKs/rest.md index 867ff189c6..e82ba99d8f 100644 --- a/site/content/en/docs/Guides/Client SDKs/rest.md +++ b/site/content/en/docs/Guides/Client SDKs/rest.md @@ -249,7 +249,7 @@ In all the Counter examples, we retrieve the counter under the key `rooms` as i For your own Counter REST requests, replace the value `rooms` with your own key in the path. ##### Alpha: GetCounter -This function retrieves a specified counter by its name and returns its information. +This function retrieves a specified counter by its key, `rooms`, and returns its information. ###### Example @@ -263,7 +263,7 @@ Response: ``` ##### Alpha: UpdateCounter -This function updates the specified counter's properties, such as its count and capacity, and returns the updated counter details. +This function updates the properties of the counter with the key `rooms`, such as its count and capacity, and returns the updated counter details. ###### Example From b83ad2faaaa79e3c1f05a18dd38ba284eed605d4 Mon Sep 17 00:00:00 2001 From: Kalaiselvi Murugesan Date: Wed, 10 Jan 2024 16:46:22 +0000 Subject: [PATCH 8/8] Review changes --- site/content/en/docs/Guides/Client SDKs/rest.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/site/content/en/docs/Guides/Client SDKs/rest.md b/site/content/en/docs/Guides/Client SDKs/rest.md index e82ba99d8f..31d6bcfba9 100644 --- a/site/content/en/docs/Guides/Client SDKs/rest.md +++ b/site/content/en/docs/Guides/Client SDKs/rest.md @@ -283,7 +283,7 @@ In all the List examples, we retrieve the list under the key `players` as if it For your own List REST based requests, replace the value `players` with your own key in the path. ##### Alpha: GetList -This function retrieves a specific list identified by its name, returns the list's information. +This function retrieves the list's properties with the key `players`, returns the list's information. ###### Example ```bash @@ -296,7 +296,7 @@ Response: ``` ##### Alpha: UpdateList -This function updates the specified list's properties, such as its capacity and values, returns the updated list details. This will overwrite all existing List.Values with the update list request values. Use addValue or removeValue for modifying the List.Values field. +This function updates the list's properties with the key `players`, such as its capacity and values, returns the updated list details. This will overwrite all existing List.Values with the update list request values. Use addValue or removeValue for modifying the List.Values field. ###### Example @@ -310,7 +310,7 @@ Response: ``` ##### Alpha: AddListValue -This function adds a new value to a specified list and returns the list with this addition. +This function adds a new value to a list with the key `players` and returns the list with this addition. ###### Example @@ -324,7 +324,7 @@ Response: ``` ##### Alpha: RemoveListValue -This function removes a value from a given list and returns updated list. +This function removes a value from the list with the key `players` and returns updated list. ###### Example