]>
Commit | Line | Data |
---|---|---|
9b12e4fe JC |
1 | # Go Bindings for Rancher API |
2 | ||
3 | # Generating Code | |
4 | First, you must have a master version of Rancher running. The best way to do this is: | |
5 | ```sh | |
6 | docker run -p 8080:8080 -d rancher/server:master | |
7 | ``` | |
8 | ||
9 | Once Rancher is running, you can run the gen-schema.sh script: | |
10 | ```sh | |
11 | ./scripts/gen-schema.sh http://<docker host ip>:8080 | |
12 | ||
13 | # The default url is http://localhost:8080, so if rancher/server is listening on localhost, you can omit the url: | |
14 | ./scripts/gen-schema.sh | |
15 | ``` | |
16 | ||
17 | This will add, remove, and modify go files appropriately. Submit a PR that includes *all* these changes. | |
18 | ||
19 | ## Important caveats | |
20 | 1. If you are running on macOS, you must have gnu-sed installed as sed for this to work properly. | |
21 | 2. If you are running against cattle that is running out of an IDE and you don't have go-machine-service running (you probably don't), you'll see a number of unexpected removed or modified files like `generated_host.go` `generated_machine.go` and `generated_*config.go`. | |
22 | ||
23 | # Building | |
24 | ||
25 | ```sh | |
26 | godep go build ./client | |
27 | ``` | |
28 | ||
29 | # Tests | |
30 | ||
31 | ```sh | |
32 | godep go test ./client | |
33 | ``` | |
34 | # Contact | |
35 | For bugs, questions, comments, corrections, suggestions, etc., open an issue in | |
36 | [rancher/rancher](//github.com/rancher/rancher/issues) with a title starting with `[go-rancher] `. | |
37 | ||
38 | Or just [click here](//github.com/rancher/rancher/issues/new?title=%5Bgo-rancher%5D%20) to create a new issue. | |
39 | ||
40 | ||
41 | # License | |
42 | Copyright (c) 2014-2015 [Rancher Labs, Inc.](http://rancher.com) | |
43 | ||
44 | Licensed under the Apache License, Version 2.0 (the "License"); | |
45 | you may not use this file except in compliance with the License. | |
46 | You may obtain a copy of the License at | |
47 | ||
48 | [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) | |
49 | ||
50 | Unless required by applicable law or agreed to in writing, software | |
51 | distributed under the License is distributed on an "AS IS" BASIS, | |
52 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
53 | See the License for the specific language governing permissions and | |
54 | limitations under the License. | |
55 |