summaryrefslogtreecommitdiffstats
path: root/plugins/grToolkit/model/src/main/yang/gr-toolkit.yang
blob: cc21400a717d98ab2c1cb4d22a4420d37f3c489a (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
module gr-toolkit{
  namespace "org:onap:ccsdk:sli:plugins:gr-toolkit";
  prefix gr-toolkit;

  import ietf-inet-types {
    prefix inet;
  }
  import ietf-yang-types {
    prefix yang;
  }
  description
    "This ODL feature is designed to gauge the health of all cluster members.";
  revision "2018-09-26" {
    description
      "Release 19.02 draft";
  }

  grouping member {
    leaf address {
      type string;
      mandatory true;
    }
    leaf role {
      type string;
      mandatory true;
    }
    leaf up {
      type boolean;
      mandatory true;
    }
    leaf unreachable {
      type boolean;
      mandatory true;
    }
    leaf voting {
      type boolean;
      mandatory true;
    }
    list leader {
      leaf shard {
        type string;
        mandatory true;
      }
    }
    list replicas {
      leaf shard {
        type string;
        mandatory true;
      }
    }
    list commit-status {
      leaf shard {
        type string;
        mandatory true;
      }
      leaf delta {
        type int32;
        mandatory true;
      }
    }
  }

  grouping site {
    leaf id {
      type string;
      mandatory true;
    }
    leaf role {
      type string;
      mandatory true;
    }
    leaf health {
      type string;
      mandatory true;
    }
  }

  grouping node {
    leaf node { 
      type string;
      mandatory true;
    }
    leaf port { 
      type string;
      mandatory true;
    }
  }

  rpc cluster-health {
    description
      "Parses akka.conf for seed nodes and queries Jolokia for the health
      of each node.";
    output {
      leaf status { type string; }
      leaf message { type string; }
      leaf served-by { type string; }
      leaf site1-health { type string; }
      leaf site2-health { type string; }
      list members {
        uses member;
      }
    }
  }

  rpc database-health {
    description
      "Uses DbLibService connection info to determine if the database is reachable.";
    output {
      leaf status { type string; }
      leaf health { type string; }
      leaf served-by { type string; }
    }
  }

  rpc admin-health {
    description
      "Pings the admin portal health check to determine if the admin portal is reachable.";
    output {
      leaf status { type string; }
      leaf health { type string; }
      leaf served-by { type string; }
    }
  }

  rpc site-health {
    description
      "Gathers health information on the ODL cluster, database, and admin portal
      to determine if the entire site is in a healthy state.";
    output {
      leaf status { type string; }
      leaf served-by { type string; }
      list sites {
        uses site;
      }
    }
  }

  rpc site-identifier {
    description
      "Returns the unique site identifier.";
    output {
      leaf status { type string; }
      leaf served-by { type string; }
      leaf id { type string; mandatory true; }
    }
  }

  rpc halt-akka-traffic {
    description
      "Executes IP Tables commands to halt traffic to the akka port.";
    input {
      list node-info {
        uses node;
      }
    }
    output {
      leaf status { type string; }
      leaf served-by { type string; }
    }
  }

  rpc resume-akka-traffic {
    description
      "Executes IP Tables commands to resume traffic to the akka port.";
    input {
      list node-info {
        uses node;
      }
    }
    output {
      leaf status { type string; }
      leaf served-by { type string; }
    }
  }

  rpc failover {
    description
      "Performs a failover from primary site to standby site.";
    input {
      leaf backupData {
        type string;
        default "false";
      }
      leaf isolate {
        type string;
        default "false";
      }
      leaf downUnreachable {
        type string;
        default "false";
      }
    }
    output {
      leaf status { type string; }
      leaf message { type string; }
      leaf served-by { type string; }
    }
  }
}