-
Notifications
You must be signed in to change notification settings - Fork 332
/
Copy pathrest-servergroup-put-membership.dita
63 lines (50 loc) · 2.81 KB
/
rest-servergroup-put-membership.dita
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="reference_ad5_dcl_sp">
<title>Updating Server Group Memberships</title>
<shortdesc>To change server group membership, use the <codeph>PUT /pools/default/serverGroups</codeph> HTTP method and URI.</shortdesc>
<refbody>
<section><title>HTTP method and URI</title>
<codeblock>PUT /pools/default/serverGroups?rev=<:number></codeblock>
<p><codeph>PUT /pools/default/serverGroups?rev=<:number></codeph> updates the server’s group
memberships. In the following examples, the group name is optional. If the group name is
provided, it <i>must</i> match the current group name. All servers must be mentioned and
<i>all</i> groups must be mentioned. The URI is used to identify the group.</p>
<p>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. </p>
<p>The following is the group information that is needed to update the server and server
group memberships:</p>
<codeblock>{
"groups": [( { ("name": <groupName:string>,)?
"uri": "/pools/default/serverGroups/"<uuid>,
"nodes": [(<otpNode>)*]
} </codeblock>
<note type="note">The PUT request is transactional. The request either succeeds completely or
fails without impact. If all nodes or groups are not passed, a generic error message: "Bad
input" occurs and the server group is removed. </note>
</section>
<section><title>Syntax</title>
<codeblock>curl -d @<inputFile> -X PUT
-u <administrator>:<password>
http://<host>:<port>/pools/default/serverGroups?rev=<number> </codeblock>
</section>
<section><title>Example</title>
<p>In this example, a JSON file is used.</p>
<codeblock>curl -d@file.json -X PUT \
http://Administrator:asdasd@192.168.0.1:8091/pools/default/serverGroups?rev=120137811</codeblock>
<p>In this example, the JSON data is provided on the command line.</p>
<codeblock>curl -v -X PUT \
-u Administrator:password \
http://192.168.171.144:8091/pools/default/serverGroups?rev=28418649 \
-d '{"groups": \
[{"nodes": [{"otpNode": "ns_1@192.168.171.144"}, \
{"otpNode": "ns_1@192.168.171.145"}], \
"name": "Group 1", \
"uri": "/pools/default/serverGroups/0"}, \
{"nodes": [], \
"name": "Group 2", \
"uri": "/pools/default/serverGroups/3ca074a8456e1d4940cfa3b7badc1e22"}] }'</codeblock>
</section>
</refbody>
</reference>