rancher-api 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +14 -3
- data/lib/rancher/api/models/project.rb +1 -0
- data/lib/rancher/api/models/service.rb +9 -0
- data/lib/rancher/api/models.rb +1 -0
- data/lib/rancher/api/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52b1aae5ce0f54910e572d396390985798cb568d
|
4
|
+
data.tar.gz: c2ede31b59774231284cc702ea498a4721124987
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53a68555c3902f420fc70de99fff6c9d0e818eadb65969815d11e97497ca855c4f781e106d7b9dd9780323924277f4e480076df80dafaca8cd5186fad5b42a12
|
7
|
+
data.tar.gz: 00d108afd30f342f6280a08825b3f9080b30dd79adc953f6a17383c49ba40011f1cc8f964c04664ed820ce84813b00060f5f69282e957fe0d1476546357c094a
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -35,6 +35,17 @@ Rancher v0.32.0
|
|
35
35
|
|
36
36
|
Configure Rancher::Api first by providing url, access and secret keys:
|
37
37
|
|
38
|
+
### Entities
|
39
|
+
|
40
|
+
**Project** - Top level object that represents "Environment" in Rancher UI
|
41
|
+
**Service** - Service (combines containers from the same image)
|
42
|
+
**Machine** - Physical docker hosts
|
43
|
+
**Instance** - represents containers that were ever installed via Rancher. Better to query containers as nested resource, cuz there can be thousands of containers that were running before and still available to query via API. Removed containers are marked as 'removed' respectively.
|
44
|
+
**Environment** - In rancher UI these are known as **Stack**, though in API they are **environments**. We're sticking to API resource name.
|
45
|
+
**Host** - these are hosts, with detailed information about docker installation and resources
|
46
|
+
|
47
|
+
### Setup
|
48
|
+
|
38
49
|
```ruby
|
39
50
|
Rancher::Api.configure do |config|
|
40
51
|
config.url = 'http://127.0.0.1:8080/v1/'
|
@@ -43,7 +54,7 @@ Rancher::Api.configure do |config|
|
|
43
54
|
end
|
44
55
|
```
|
45
56
|
|
46
|
-
|
57
|
+
### Querying
|
47
58
|
|
48
59
|
Now, you're able to query entities like this:
|
49
60
|
|
@@ -52,7 +63,7 @@ project = Rancher::Api::Project.all.to_a
|
|
52
63
|
machine = Rancher::Api::Machine.find('1ph1')
|
53
64
|
```
|
54
65
|
|
55
|
-
|
66
|
+
### Creating new machines
|
56
67
|
Creating new machine using **Digital Ocean** driver:
|
57
68
|
|
58
69
|
```ruby
|
@@ -73,7 +84,7 @@ new_machine.save
|
|
73
84
|
**NOTICE**: First specify driver, so that driver_config= accessor can correctly map config on the right attribute. I.e. for 'digitalocean' config attribute is 'digitaloceanConfig'.
|
74
85
|
|
75
86
|
|
76
|
-
|
87
|
+
### Executing shell commands in containers
|
77
88
|
|
78
89
|
```ruby
|
79
90
|
container = Rancher::Api::Instance.find('1i382')
|
data/lib/rancher/api/models.rb
CHANGED
data/lib/rancher/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rancher-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Kurkin
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- lib/rancher/api/models/machine.rb
|
141
141
|
- lib/rancher/api/models/machine/driver_config.rb
|
142
142
|
- lib/rancher/api/models/project.rb
|
143
|
+
- lib/rancher/api/models/service.rb
|
143
144
|
- lib/rancher/api/version.rb
|
144
145
|
- rancher-api.gemspec
|
145
146
|
homepage: https://github.com/akurkin/rancher-api
|