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 datastore-shard-id {
25 description "Grouping holding combined identifiers of a shard -- its name and datastore type";
28 description "The name of the shard.";
32 error-app-tag "odl-named-shards";
33 error-message "Shard name must not be empty";
38 leaf data-store-type {
41 description "The type of the data store to which the shard belongs";
45 grouping shard-operation-result {
46 uses datastore-shard-id;
57 grouping shard-result-output {
59 key "shard-name data-store-type";
60 uses shard-operation-result;
62 description "The list of results, one per shard";
66 grouping member-voting-states-input {
67 list member-voting-state {
76 description "The list of member voting states";
80 rpc add-shard-replica {
82 uses datastore-shard-id;
85 description "Adds a replica of a shard to this node and joins it to an existing cluster. The shard must
86 already have a module configuration defined for it and there must already be a shard existing on
87 another node with a leader. This RPC first contacts peer member seed nodes searching for a shard.
88 When found, an AddServer message is sent to the shard leader and applied as described in the Raft
92 rpc remove-shard-replica {
94 uses datastore-shard-id;
99 description "The cluster member from which the shard replica should be removed";
103 description "Removes an existing replica of a shard from this node via the RemoveServer mechanism as
104 described in the Raft paper.";
107 rpc make-leader-local {
109 uses datastore-shard-id;
112 description "Attempts to move the shard leader of the given module based shard to the local node.
113 The rpc returns a response after handling of the underlying MakeLeaderLocal message completes.
114 This operation fails if there is no current shard leader due to lack of network connectivity or
115 a cluster majority. In addition, if the local node is not up to date with the current leader,
116 an attempt is made to first sync the local node with the leader. If this cannot be achieved
117 within two election timeout periods the operation fails.";
120 rpc add-prefix-shard-replica {
124 type instance-identifier;
127 leaf data-store-type {
129 type data-store-type;
130 description "The type of the data store to which the replica belongs";
134 description "Adds a replica of a shard to this node and joins it to an existing cluster. There must already be
135 a shard existing on another node with a leader. This RPC first contacts peer member seed nodes
136 searching for a shard. When found, an AddServer message is sent to the shard leader and applied as
137 described in the Raft paper.";
140 rpc remove-prefix-shard-replica {
144 type instance-identifier;
149 description "The cluster member from which the shard replica should be removed";
152 leaf data-store-type {
154 type data-store-type;
155 description "The type of the data store to which the replica belongs";
159 description "Removes an existing replica of a prefix shard from this node via the RemoveServer mechanism as
160 described in the Raft paper.";
163 rpc add-replicas-for-all-shards {
165 uses shard-result-output;
168 description "Adds replicas on this node for all currently defined shards. This is equivalent to issuing
169 an add-shard-replica RPC for all shards.";
172 rpc remove-all-shard-replicas {
177 description "The cluster member from which the shard replicas should be removed";
182 uses shard-result-output;
185 description "Removes replicas for all shards on this node. This is equivalent to issuing
186 a remove-shard-replica for all shards and essentially removes this node from a cluster.";
189 rpc change-member-voting-states-for-shard {
191 uses datastore-shard-id;
192 uses member-voting-states-input;
195 description "Changes the voting states, either voting or non-voting, of cluster members for a shard.
196 Non-voting members will no longer participate in leader elections and consensus but will be
197 replicated. This is useful for having a set of members serve as a backup cluster in case the
198 primary voting cluster suffers catastrophic failure. This RPC can be issued to any cluster member
199 and will be forwarded to the leader.";
202 rpc change-member-voting-states-for-all-shards {
204 uses member-voting-states-input;
208 uses shard-result-output;
211 description "Changes the voting states, either voting or non-voting, of cluster members for all shards.
212 Non-voting members will no longer participate in leader elections and consensus but will be
213 replicated. This is useful for having a set of members serve as a backup cluster in case the
214 primary voting cluster suffers catastrophic failure. This RPC can be issued to any cluster member
215 and will be forwarded to the leader.";
218 rpc flip-member-voting-states-for-all-shards {
220 uses shard-result-output;
223 description "Flips the voting states of all cluster members for all shards, such that if a member
224 was voting it becomes non-voting and vice versa.";
227 rpc backup-datastore {
231 description "The path and name of the file in which to store the backup.";
235 description "Creates a backup file of the datastore state";
240 uses datastore-shard-id;
246 description "Current role for the given shard, if not present the shard currently does not have a role";
250 description "Returns the current role for the requested module shard.";
254 description "Return the transport-level information about where a shard has a home.";
256 uses datastore-shard-id;
261 description "Location of the hypothetical cluster member node. Relationship to the input parameters
262 and the transport protocol.";
265 description "Local node is the best node to talk to when it comes from efficiency perspective
266 of underlying implementation. The requester of this RPC is advised to contact
267 any services to the specified shard via the channel on which this RPC was invoked.";
271 leaf leader-actor-ref {
272 description "Actor reference to the actor which is currently acting as the leader.";
279 rpc get-prefix-shard-role {
283 type instance-identifier;
286 leaf data-store-type {
288 type data-store-type;
289 description "The type of the data store to which the replica belongs";
296 description "Current role for the given shard, if not present the shard currently does not have a role";
300 description "Returns the current role for the requested module shard.";