Skip to content

Commit 2d34139

Browse files
committed
first pass at clusters
1 parent 1ef4929 commit 2d34139

23 files changed

Lines changed: 1624 additions & 73 deletions

docs/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* [enumerate](clusters/enumerate.md)
88
* [get node id from ip](clusters/getnodeidfromip.md)
99
* [inspect](clusters/inspect.md)
10+
* [remove](clusters/remove.md)
11+
* [setsize](clusters/setsize.md)
1012
* [status](clusters/status.md)
1113
* [versions](clusters/versions.md)
1214
* [Volumes](volumes/README.md)

docs/clusters/alerts.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,34 @@ TBD
2828
### ClearAlert
2929
ClearAlert clears an alert for the given resource.
3030

31+
#### Example
32+
33+
{% codetabs name="Golang", type="go" -%}
34+
resp, err := m.ClearAlert(
35+
api.ResourceType_RESOURCE_TYPE_VOLUME,
36+
somAlertId)
37+
if err != nil {
38+
return nil
39+
}
40+
{%- language name="Python", type="py" -%}
41+
TBD
42+
{%- endcodetabs %}
43+
3144
### EraseAlert
3245
EraseAlert erases an alert for the given resource.
3346

47+
#### Example
48+
49+
{% codetabs name="Golang", type="go" -%}
50+
resp, err := m.EraseAlert(
51+
api.ResourceType_RESOURCE_TYPE_VOLUME,
52+
somAlertId)
53+
if err != nil {
54+
return nil
55+
}
56+
{%- language name="Python", type="py" -%}
57+
TBD
58+
{%- endcodetabs %}
59+
3460
## Reference
3561
* [Golang](https://godoc.org/github.com/libopenstorage/openstorage/cluster#ClusterAlerts)

docs/clusters/enumerate.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Enumerate
2+
Enumerate is used to list all the nodes in the cluster.
23

3-
## Interface
4+
## Example
5+
6+
{% codetabs name="Golang", type="go" -%}
7+
clusterInfo, err := m.Enumerate()
8+
if err != nil {
9+
return nil
10+
}
11+
fmt.Printf("Cluster ID:%s\n", clusterInfo.Id)
12+
for _, node := range clusterInfo.Nodes {
13+
fmt.Printf("ID:=%d MgmtIP=%s DataIP=%s\n",
14+
node.Id,
15+
node.MgmtIp,
16+
node.DataIp)
17+
}
18+
{%- language name="Python", type="py" -%}
19+
TBD
20+
{%- endcodetabs %}
421

522
## Reference

docs/clusters/getnodeidfromip.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
# Get node ID from IP
1+
# Get Node ID from IP
2+
Returns the ID of a node for a specified management or storage IP.
23

3-
## Interface
4+
## Example
5+
6+
{% codetabs name="Golang", type="go" -%}
7+
nodeId, err := m.GetNodeIdFromIp(someIp)
8+
if err != nil {
9+
return nil
10+
}
11+
{%- language name="Python", type="py" -%}
12+
TBD
13+
{%- endcodetabs %}
414

515
## Reference

docs/clusters/inspect.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Inspect
2+
Get information on a node
23

3-
## Interface
4+
## Example
5+
6+
{% codetabs name="Golang", type="go" -%}
7+
node, err := m.Inspect(nodeId)
8+
if err != nil {
9+
return nil
10+
}
11+
fmt.Printf("ID:=%d MgmtIP=%s DataIP=%s\n",
12+
node.Id,
13+
node.MgmtIp,
14+
node.DataIp)
15+
{%- language name="Python", type="py" -%}
16+
TBD
17+
{%- endcodetabs %}
418

519
## Reference

docs/clusters/remove.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Remove
2+
Remove a node or multiple nodes from the cluster permanently
3+
4+
> NOTE: TODO This feels like it should only take a list of IDs. The users may not know how much to fill the struct to give to `Remove()`.
5+
6+
## Example
7+
8+
{% codetabs name="Golang", type="go" -%}
9+
nodes := []api.Node{
10+
{
11+
Id: "id",
12+
},
13+
}
14+
forceRemove := false
15+
err := m.Remove(nodes, forceRemove)
16+
if err != nil {
17+
return nil
18+
}
19+
{%- language name="Python", type="py" -%}
20+
TBD
21+
{%- endcodetabs %}
22+
23+
## Reference

docs/clusters/setsize.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Set Size
2+
Sets the maximum number of nodes in a cluster.
3+
4+
## Example
5+
6+
{% codetabs name="Golang", type="go" -%}
7+
err := m.SetSize(1000)
8+
if err != nil {
9+
return nil
10+
}
11+
{%- language name="Python", type="py" -%}
12+
TBD
13+
{%- endcodetabs %}
14+
15+
## Reference

docs/clusters/status.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Status
2+
Get status from a specific node or its peers
23

34
## Interface
45

6+
### Status Types
7+
TODO Add link here
8+
9+
### Node Status
10+
Returns the status of the node running the REST service as seen by the Cluster Provider for a given listener. If listenerName is empty it returns the status of THIS node maintained by the Cluster Provider. At any time the status of the Cluster Provider takes precedence over the status of listener. Precedence is determined by the severity of the status.
11+
12+
{% codetabs name="Golang", type="go" -%}
13+
nodeStatus, err := m.NodeStatus()
14+
if err != nil {
15+
return nil
16+
}
17+
fmt.Printf("Status: %s\n", nodeStatus)
18+
{%- language name="Python", type="py" -%}
19+
TBD
20+
{%- endcodetabs %}
21+
22+
### Peer Status
23+
Returns the statuses of all peer nodes as seen by the Cluster Provider for a given listener. If listenerName is empty is returns the statuses of all peer nodes as maintained by the ClusterProvider (gossip)
24+
25+
{% codetabs name="Golang", type="go" -%}
26+
// TODO: Need example on creating a listener then using it for PeerStatus()
27+
{%- language name="Python", type="py" -%}
28+
TBD
29+
{%- endcodetabs %}
30+
531
## Reference

w/Code.html

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,43 @@
201201

202202
</li>
203203

204-
<li class="chapter " data-level="2.1.5" data-path="clusters/status.html">
204+
<li class="chapter " data-level="2.1.5" data-path="clusters/remove.html">
205205

206-
<a href="clusters/status.html">
206+
<a href="clusters/remove.html">
207207

208208

209209
<b>2.1.5.</b>
210210

211+
remove
212+
213+
</a>
214+
215+
216+
217+
</li>
218+
219+
<li class="chapter " data-level="2.1.6" data-path="clusters/setsize.html">
220+
221+
<a href="clusters/setsize.html">
222+
223+
224+
<b>2.1.6.</b>
225+
226+
setsize
227+
228+
</a>
229+
230+
231+
232+
</li>
233+
234+
<li class="chapter " data-level="2.1.7" data-path="clusters/status.html">
235+
236+
<a href="clusters/status.html">
237+
238+
239+
<b>2.1.7.</b>
240+
211241
status
212242

213243
</a>
@@ -216,12 +246,12 @@
216246

217247
</li>
218248

219-
<li class="chapter " data-level="2.1.6" data-path="clusters/versions.html">
249+
<li class="chapter " data-level="2.1.8" data-path="clusters/versions.html">
220250

221251
<a href="clusters/versions.html">
222252

223253

224-
<b>2.1.6.</b>
254+
<b>2.1.8.</b>
225255

226256
versions
227257

@@ -421,7 +451,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
421451
<script>
422452
var gitbook = gitbook || [];
423453
gitbook.push(function() {
424-
gitbook.page.hasChanged({"page":{"title":"_Website tests","level":"3.1","depth":1,"next":{"title":"_WebTest","level":"3.1.1","depth":2,"path":"More.md","ref":"More.md","articles":[]},"previous":{"title":"Volumes","level":"2.2","depth":1,"path":"volumes/README.md","ref":"volumes/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["codetabs","toggle-chapters","toggle-headers","edit-link","prism","github","page-toc","-highlight","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{},"github":{"url":"https://github.com/libopenstorage/openstorage/"},"search":{},"page-toc":{"position":"before-first","selector":".markdown-section h1, .markdown-section h2","showByDefault":true},"codetabs":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"toggle-headers":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"Edit this page","base":"https://github.com/libopenstorage/libopenstorage.github.io/tree/master/docs"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"toggle-chapters":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"OpenStorage API","gitbook":">=3.2.1"},"file":{"path":"Code.md","mtime":"2018-03-28T18:16:34.603Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-03-28T22:00:19.342Z"},"basePath":".","book":{"language":""}});
454+
gitbook.page.hasChanged({"page":{"title":"_Website tests","level":"3.1","depth":1,"next":{"title":"_WebTest","level":"3.1.1","depth":2,"path":"More.md","ref":"More.md","articles":[]},"previous":{"title":"Volumes","level":"2.2","depth":1,"path":"volumes/README.md","ref":"volumes/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["codetabs","toggle-chapters","toggle-headers","edit-link","prism","github","page-toc","-highlight","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{},"github":{"url":"https://github.com/libopenstorage/openstorage/"},"search":{},"page-toc":{"position":"before-first","selector":".markdown-section h1, .markdown-section h2","showByDefault":true},"codetabs":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"toggle-headers":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"Edit this page","base":"https://github.com/libopenstorage/libopenstorage.github.io/tree/master/docs"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"toggle-chapters":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"OpenStorage API","gitbook":">=3.2.1"},"file":{"path":"Code.md","mtime":"2018-03-29T19:06:14.770Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-04-02T20:25:35.215Z"},"basePath":".","book":{"language":""}});
425455
});
426456
</script>
427457
</div>

w/Last.html

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,43 @@
199199

200200
</li>
201201

202-
<li class="chapter " data-level="2.1.5" data-path="clusters/status.html">
202+
<li class="chapter " data-level="2.1.5" data-path="clusters/remove.html">
203203

204-
<a href="clusters/status.html">
204+
<a href="clusters/remove.html">
205205

206206

207207
<b>2.1.5.</b>
208208

209+
remove
210+
211+
</a>
212+
213+
214+
215+
</li>
216+
217+
<li class="chapter " data-level="2.1.6" data-path="clusters/setsize.html">
218+
219+
<a href="clusters/setsize.html">
220+
221+
222+
<b>2.1.6.</b>
223+
224+
setsize
225+
226+
</a>
227+
228+
229+
230+
</li>
231+
232+
<li class="chapter " data-level="2.1.7" data-path="clusters/status.html">
233+
234+
<a href="clusters/status.html">
235+
236+
237+
<b>2.1.7.</b>
238+
209239
status
210240

211241
</a>
@@ -214,12 +244,12 @@
214244

215245
</li>
216246

217-
<li class="chapter " data-level="2.1.6" data-path="clusters/versions.html">
247+
<li class="chapter " data-level="2.1.8" data-path="clusters/versions.html">
218248

219249
<a href="clusters/versions.html">
220250

221251

222-
<b>2.1.6.</b>
252+
<b>2.1.8.</b>
223253

224254
versions
225255

@@ -394,7 +424,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
394424
<script>
395425
var gitbook = gitbook || [];
396426
gitbook.push(function() {
397-
gitbook.page.hasChanged({"page":{"title":"Last","level":"3.1.2","depth":2,"previous":{"title":"_WebTest","level":"3.1.1","depth":2,"path":"More.md","ref":"More.md","articles":[]},"dir":"ltr"},"config":{"plugins":["codetabs","toggle-chapters","toggle-headers","edit-link","prism","github","page-toc","-highlight","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{},"github":{"url":"https://github.com/libopenstorage/openstorage/"},"search":{},"page-toc":{"position":"before-first","selector":".markdown-section h1, .markdown-section h2","showByDefault":true},"codetabs":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"toggle-headers":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"Edit this page","base":"https://github.com/libopenstorage/libopenstorage.github.io/tree/master/docs"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"toggle-chapters":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"OpenStorage API","gitbook":">=3.2.1"},"file":{"path":"Last.md","mtime":"2018-03-28T18:16:34.603Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-03-28T22:00:19.342Z"},"basePath":".","book":{"language":""}});
427+
gitbook.page.hasChanged({"page":{"title":"Last","level":"3.1.2","depth":2,"previous":{"title":"_WebTest","level":"3.1.1","depth":2,"path":"More.md","ref":"More.md","articles":[]},"dir":"ltr"},"config":{"plugins":["codetabs","toggle-chapters","toggle-headers","edit-link","prism","github","page-toc","-highlight","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{},"github":{"url":"https://github.com/libopenstorage/openstorage/"},"search":{},"page-toc":{"position":"before-first","selector":".markdown-section h1, .markdown-section h2","showByDefault":true},"codetabs":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"toggle-headers":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"Edit this page","base":"https://github.com/libopenstorage/libopenstorage.github.io/tree/master/docs"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"toggle-chapters":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"OpenStorage API","gitbook":">=3.2.1"},"file":{"path":"Last.md","mtime":"2018-03-29T19:06:14.770Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-04-02T20:25:35.215Z"},"basePath":".","book":{"language":""}});
398428
});
399429
</script>
400430
</div>

0 commit comments

Comments
 (0)