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

updated UpdateList documentation for local sdk server and sdk server #3878

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion site/content/en/docs/Guides/Client SDKs/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,15 @@ Response:
```

##### Beta: UpdateList
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.
This function updates the list's properties with the key `players`, such as its capacity and values, and returns the updated list details.

**Note:** The behavior of this function differs between the Local SDK Server and the SDK Server.

- **Local SDK Server:** This will overwrite both the capacity and the values with the update request values. Use `AddListValue` or `RemoveListValue` for modifying the `List.Values` field.
- **SDK Server:** This will only update the capacity of the list and does not modify the values.

###### Example
**Local SDK Server Example:**

```bash
curl -d '{"capacity": "120", "values": ["player3", "player4"]}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1beta1/lists/players
Expand All @@ -308,6 +314,16 @@ Response:
```json
{"name":"players", "capacity":"120", "values":["player3", "player4"]}
```
**SDK Server Example:**

```bash
curl -d '{"capacity": "120"}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1beta1/lists/players
```

Response:
```json
{"name":"players", "capacity":"120", "values":["player0", "player1", "player2"]}
```

##### Beta: AddListValue
This function adds a new value to a list with the key `players` and returns the list with this addition.
Expand Down
Loading