Updating server group memberships
To change server group membership, use the PUT /pools/default/serverGroups HTTP method and URI.
HTTP method and URI
PUT /pools/default/serverGroups?rev=<:number>
PUT /pools/default/serverGroups?rev=<:number> updates the server’s group memberships. In the following examples, the group name is optional. If the group name is provided, it must match the current group name. All servers must be mentioned and all groups must be mentioned. The URI is used to identify the group.
This request moves servers from one server group to another. This request does not permit server group renaming or removal. In this example, the servers for Group 2 are moved to Group 1.
The following is the group information that is needed to update the server and server group memberships:
{
"groups": [( { ("name": <groupName:string>,)?
"uri": "/pools/default/serverGroups/"<uuid>,
"nodes": [(<otpNode>)*]
}
Syntax
curl -d @<inputFile> -X PUT
-u <administrator>:<password>
http://<host>:<port>/pools/default/serverGroups?rev=<number>
Example
In this example, a JSON file is used.
curl [email protected] -X PUT
http://Administrator:[email protected]:8091/pools/default/serverGroups?rev=120137811
In this example, the JSON data is provided on the command line.
curl -v -X PUT
-u Administrator:password
http://192.168.171.144:8091/pools/default/serverGroups?rev=28418649
-d '{"groups":
[{"nodes": [{"otpNode": "[email protected]"},
{"otpNode": "[email protected]"}],
"name": "Group 1",
"uri": "/pools/default/serverGroups/0"},
{"nodes": [],
"name": "Group 2",
"uri": "/pools/default/serverGroups/3ca074a8456e1d4940cfa3b7badc1e22"}] }'