3 namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:cluster:admin";
4 prefix "cluster-admin";
7 "This module contains YANG RPC definitions for administering a cluster.";
9 revision "2015-10-13" {
10 description "Initial revision.";
13 typedef data-store-type {
24 grouping shard-operation-result {
29 leaf data-store-type {
42 grouping shard-result-output {
44 key "shard-name data-store-type";
45 uses shard-operation-result;
47 description "The list of results, one per shard";
51 grouping member-voting-states-input {
52 list member-voting-state {
61 description "The list of member voting states";
65 rpc add-shard-replica {
70 description "The name of the shard for which to create a replica.";
73 leaf data-store-type {
76 description "The type of the data store to which the replica belongs";
80 description "Adds a replica of a shard to this node and joins it to an existing cluster. The shard must
81 already have a module configuration defined for it and there must already be a shard existing on
82 another node with a leader. This RPC first contacts peer member seed nodes searching for a shard.
83 When found, an AddServer message is sent to the shard leader and applied as described in the Raft
87 rpc remove-shard-replica {
92 description "The name of the shard for which to remove the replica.";
98 description "The cluster member from which the shard replica should be removed";
101 leaf data-store-type {
103 type data-store-type;
104 description "The type of the data store to which the replica belongs";
108 description "Removes an existing replica of a shard from this node via the RemoveServer mechanism as
109 described in the Raft paper.";
112 rpc make-leader-local {
117 description "The name of the shard for which to move the leader to the local node";
120 leaf data-store-type {
122 type data-store-type;
123 description "The type of the data store to which the shard belongs";
127 description "Attempts to move the shard leader of the given module based shard to the local node.
128 The rpc returns a response after handling of the underlying MakeLeaderLocal message completes.
129 This operation fails if there is no current shard leader due to lack of network connectivity or
130 a cluster majority. In addition, if the local node is not up to date with the current leader,
131 an attempt is made to first sync the local node with the leader. If this cannot be achieved
132 within two election timeout periods the operation fails.";
135 rpc add-prefix-shard-replica {
139 type instance-identifier;
142 leaf data-store-type {
144 type data-store-type;
145 description "The type of the data store to which the replica belongs";
149 description "Adds a replica of a shard to this node and joins it to an existing cluster. There must already be
150 a shard existing on another node with a leader. This RPC first contacts peer member seed nodes
151 searching for a shard. When found, an AddServer message is sent to the shard leader and applied as
152 described in the Raft paper.";
155 rpc remove-prefix-shard-replica {
159 type instance-identifier;
164 description "The cluster member from which the shard replica should be removed";
167 leaf data-store-type {
169 type data-store-type;
170 description "The type of the data store to which the replica belongs";
174 description "Removes an existing replica of a prefix shard from this node via the RemoveServer mechanism as
175 described in the Raft paper.";
178 rpc add-replicas-for-all-shards {
180 uses shard-result-output;
183 description "Adds replicas on this node for all currently defined shards. This is equivalent to issuing
184 an add-shard-replica RPC for all shards.";
187 rpc remove-all-shard-replicas {
192 description "The cluster member from which the shard replicas should be removed";
197 uses shard-result-output;
200 description "Removes replicas for all shards on this node. This is equivalent to issuing
201 a remove-shard-replica for all shards and essentially removes this node from a cluster.";
204 rpc change-member-voting-states-for-shard {
209 description "The name of the shard for which to change voting state.";
212 leaf data-store-type {
214 type data-store-type;
215 description "The type of the data store to which the shard belongs";
218 uses member-voting-states-input;
221 description "Changes the voting states, either voting or non-voting, of cluster members for a shard.
222 Non-voting members will no longer participate in leader elections and consensus but will be
223 replicated. This is useful for having a set of members serve as a backup cluster in case the
224 primary voting cluster suffers catastrophic failure. This RPC can be issued to any cluster member
225 and will be forwarded to the leader.";
228 rpc change-member-voting-states-for-all-shards {
230 uses member-voting-states-input;
234 uses shard-result-output;
237 description "Changes the voting states, either voting or non-voting, of cluster members for all shards.
238 Non-voting members will no longer participate in leader elections and consensus but will be
239 replicated. This is useful for having a set of members serve as a backup cluster in case the
240 primary voting cluster suffers catastrophic failure. This RPC can be issued to any cluster member
241 and will be forwarded to the leader.";
244 rpc flip-member-voting-states-for-all-shards {
246 uses shard-result-output;
249 description "Flips the voting states of all cluster members for all shards, such that if a member
250 was voting it becomes non-voting and vice versa.";
253 rpc backup-datastore {
257 description "The path and name of the file in which to store the backup.";
261 description "Creates a backup file of the datastore state";