Bug 2187: Add datastoreType to add-shard-replica RPC
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / yang / cluster-admin.yang
1 module cluster-admin {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:cluster:admin";
4     prefix "cluster-admin";
5
6     description
7         "This module contains YANG RPC definitions for administering a cluster.";
8
9     revision "2015-10-13" {
10         description "Initial revision.";
11     }
12
13     typedef data-store-type {
14         type enumeration {
15             enum config {
16                 value 1;
17             }
18             enum operational {
19                 value 2;
20             }
21         }
22     }
23
24     rpc add-shard-replica {
25         input {
26             leaf shard-name {
27                 type string;
28                 description "The name of the shard for which to create a replica.";
29             }
30             
31             leaf data-store-type {
32                 type data-store-type;
33                 description "The type of the data store to which the replica belongs";
34             }
35         }
36
37         description "Adds a replica of a shard to this node and joins it to an existing cluster. The shard must
38             already have a module configuration defined for it and there must already be a shard existing on
39             another node with a leader. This RPC first contacts peer member seed nodes searching for a shard.
40             When found, an AddServer message is sent to the shard leader and applied as described in the Raft
41             paper.";
42     }
43
44     rpc remove-shard-replica {
45         input {
46             leaf shard-name {
47                 type string;
48                 description "The name of the shard for which to remove the replica.";
49             }
50
51             leaf member-name {
52                 type string;
53                 description "The cluster member from which the shard replica should be removed";
54             }
55
56             leaf data-store-type {
57                 type data-store-type;
58                 description "The type of the data store to which the replica belongs";
59             }
60         }
61
62         description "Removes an existing replica of a shard from this node via the RemoveServer mechanism as
63             described in the Raft paper.";
64     }
65
66     rpc add-replicas-for-all-shards {
67         description "Adds replicas on this node for all currently defined shards. This is equivalent to issuing
68             an add-shard-replica RPC for all shards.";
69     }
70
71     rpc remove-all-shard-replicas {
72         description "Removes replicas for all shards on this node. This is equivalent to issuing
73             a remove-shard-replica for all shards and essentially removes this node from a cluster.";
74     }
75
76     rpc convert-members-to-nonvoting-for-all-shards {
77         input {
78             leaf-list member-names {
79                 type string;
80                 description "The names of the cluster members to convert.";
81             }
82         }
83         
84         description "Converts the given cluster members to non-voting for all shards. The members will no 
85             longer participate in leader elections and consensus but will be replicated. This is useful for
86             having a set of members serve as a backup cluster in case the primary voting cluster suffers
87             catastrophic failure. This RPC can be issued to any cluster member and will be forwarded
88             to the leader.";
89     }
90
91     rpc convert-members-to-voting-for-all-shards {
92         input {
93             leaf-list member-names {
94                 type string;
95                 description "The names of the cluster members to convert.";
96             }
97         }
98
99         description "Converts the given cluster members to voting for all shards. The members will 
100             participate in leader elections and consensus.";
101     }
102
103     rpc backup-datastore {
104         input {
105             leaf file-path {
106               type string;
107               description "The path and name of the file in which to store the backup.";
108             }
109         }
110
111         description "Creates a backup file of the datastore state";
112     }
113 }