Skip to content

Commit 26469e1

Browse files
committed
install page
1 parent ce09b64 commit 26469e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+224
-70
lines changed

docs/arch.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,5 @@ on how to setup a connection to the gRPC server.
1313
In this document, examples will refer to both the [OpenStorage SDK Mock](installing.md)
1414
and Portworx drivers.
1515

16-
## Clients
17-
Currently, OpenStorage provides Python, Ruby, Golang, and JavaScript bindings
18-
under the [`api/client/sdk`](https://github.com/libopenstorage/openstorage/tree/master/api/client/sdk)
19-
directory. If your client is not available, please feel free to generate one
20-
from the [`api.proto`](https://github.com/libopenstorage/openstorage/blob/master/api/api.proto)
21-
file on OpenStorage.
16+
OpenStorage API calls are ment to be idempotent to ensure consistency across calls, unless
17+
otherwise specified.

docs/installing.md

+88
Original file line numberDiff line numberDiff line change
@@ -1 +1,89 @@
11
# Installing OpenStorage SDK
2+
3+
## Clients
4+
Currently, OpenStorage provides Python, Ruby, Golang, and JavaScript bindings
5+
under the [`api/client/sdk`](https://github.com/libopenstorage/openstorage/tree/master/api/client/sdk)
6+
directory. If your client is not available, please feel free to generate one
7+
from the [`api.proto`](https://github.com/libopenstorage/openstorage/blob/master/api/api.proto)
8+
file on OpenStorage.
9+
10+
### Golang
11+
For Golang, simply import `github.com/libopenstorage/openstorage/api` in your
12+
sources. Here is a full example:
13+
14+
```go
15+
package main
16+
17+
import (
18+
"context"
19+
"fmt"
20+
"os"
21+
22+
"github.com/libopenstorage/openstorage/api"
23+
"google.golang.org/grpc"
24+
)
25+
26+
func main() {
27+
conn, err := grpc.Dial("localhost:9100", grpc.WithInsecure())
28+
if err != nil {
29+
fmt.Println(err)
30+
os.Exit(1)
31+
}
32+
33+
c := api.NewOpenStorageClusterClient(conn)
34+
r, err := c.Enumerate(context.Background(), &api.ClusterEnumerateRequest{})
35+
if err != nil {
36+
fmt.Println(err)
37+
os.Exit(1)
38+
}
39+
fmt.Println(r)
40+
}
41+
```
42+
43+
### Python
44+
Python libraries are available [`api/client/sdk/python`](https://github.com/libopenstorage/openstorage/tree/master/api/client/sdk).
45+
You will need the files `api*.py` copied to your path. Here is a full example:
46+
47+
```python
48+
#
49+
# Install:
50+
# virtualenv sdk
51+
# source sdk/bin/activate
52+
# pip install grpcio grpcio-tools
53+
#
54+
# Then copy the api*.py files to the directory as your client
55+
#
56+
# More info: https://grpc.io/docs/quickstart/python.html
57+
#
58+
import grpc
59+
import api_pb2
60+
import api_pb2_grpc
61+
62+
# Setup connection
63+
channel = grpc.insecure_channel('localhost:9100')
64+
client = api_pb2_grpc.OpenStorageClusterStub(channel)
65+
66+
# Get cluster information
67+
en_resp = client.Enumerate(api_pb2.ClusterEnumerateRequest())
68+
print en_resp
69+
70+
# Get node info
71+
n_resp = client.Inspect(api_pb2.ClusterInspectRequest(node_id=en_resp.cluster.nodes[0].id))
72+
print n_resp
73+
```
74+
75+
We may some day provide a python `pip` package, but do not have one at the moment.
76+
77+
### Ruby and Javascript
78+
Ruby and Javascript clients are also located in _api/client/sdk_.
79+
80+
## Mock SDK Server
81+
OpenStorage provides mock SDK server as a container which can be run using the
82+
command:
83+
84+
```
85+
$ docker run -d -p 9100:9100 openstorage/mock-sdk-server
86+
```
87+
88+
This will run OpenStorage server with an in-memory driver implementation called
89+
`fake`. You can then point your gRPC client to `localhost:9100`.

w/Code.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
11381138
<script>
11391139
var gitbook = gitbook || [];
11401140
gitbook.push(function() {
1141-
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":"enumerate","level":"2.3.5.10.3","depth":4,"path":"volumes/backups/scheds/enumerate.md","ref":"volumes/backups/scheds/enumerate.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-04-30T14:03:56.330Z"},"basePath":".","book":{"language":""}});
1141+
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":"enumerate","level":"2.3.5.10.3","depth":4,"path":"volumes/backups/scheds/enumerate.md","ref":"volumes/backups/scheds/enumerate.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-04-30T15:47:35.701Z"},"basePath":".","book":{"language":""}});
11421142
});
11431143
</script>
11441144
</div>

w/Last.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
11111111
<script>
11121112
var gitbook = gitbook || [];
11131113
gitbook.push(function() {
1114-
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-04-30T14:03:56.330Z"},"basePath":".","book":{"language":""}});
1114+
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-04-30T15:47:35.701Z"},"basePath":".","book":{"language":""}});
11151115
});
11161116
</script>
11171117
</div>

w/More.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
11281128
<script>
11291129
var gitbook = gitbook || [];
11301130
gitbook.push(function() {
1131-
gitbook.page.hasChanged({"page":{"title":"_WebTest","level":"3.1.1","depth":2,"next":{"title":"Last","level":"3.1.2","depth":2,"path":"Last.md","ref":"Last.md","articles":[]},"previous":{"title":"_Website tests","level":"3.1","depth":1,"path":"Code.md","ref":"Code.md","articles":[{"title":"_WebTest","level":"3.1.1","depth":2,"path":"More.md","ref":"More.md","articles":[]},{"title":"Last","level":"3.1.2","depth":2,"path":"Last.md","ref":"Last.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":"More.md","mtime":"2018-03-28T18:16:34.603Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-04-30T14:03:56.330Z"},"basePath":".","book":{"language":""}});
1131+
gitbook.page.hasChanged({"page":{"title":"_WebTest","level":"3.1.1","depth":2,"next":{"title":"Last","level":"3.1.2","depth":2,"path":"Last.md","ref":"Last.md","articles":[]},"previous":{"title":"_Website tests","level":"3.1","depth":1,"path":"Code.md","ref":"Code.md","articles":[{"title":"_WebTest","level":"3.1.1","depth":2,"path":"More.md","ref":"More.md","articles":[]},{"title":"Last","level":"3.1.2","depth":2,"path":"Last.md","ref":"Last.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":"More.md","mtime":"2018-03-28T18:16:34.603Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-04-30T15:47:35.701Z"},"basePath":".","book":{"language":""}});
11321132
});
11331133
</script>
11341134
</div>

0 commit comments

Comments
 (0)