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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9de528eea9c4b1147eaf9d9a385a18a407f66e3
4
- data.tar.gz: 9576b8707b67a11f895a2a70d0444bde9138a0b9
3
+ metadata.gz: 52b1aae5ce0f54910e572d396390985798cb568d
4
+ data.tar.gz: c2ede31b59774231284cc702ea498a4721124987
5
5
  SHA512:
6
- metadata.gz: 656b5add1ddb21b0d500fd2c3f63b37fe0f9fca66bbbfbdf541a830b81e49a3bfea695f99b6a106e845ebc3167ceaaef655563540217ff2eef783ac8f2dd4db2
7
- data.tar.gz: a97f1925f2e393aff5b0b139c6a82761a94f57c4117714691cd067a7d5e4c9a193516005588b978e583ebc346f33e82985f22d6d63c1a46c126dc2ce709c242f
6
+ metadata.gz: 53a68555c3902f420fc70de99fff6c9d0e818eadb65969815d11e97497ca855c4f781e106d7b9dd9780323924277f4e480076df80dafaca8cd5186fad5b42a12
7
+ data.tar.gz: 00d108afd30f342f6280a08825b3f9080b30dd79adc953f6a17383c49ba40011f1cc8f964c04664ed820ce84813b00060f5f69282e957fe0d1476546357c094a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rancher-api (0.3.0)
4
+ rancher-api (0.3.1)
5
5
  faraday_middleware
6
6
  faye-websocket
7
7
  her (~> 0.7.6)
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
- ## Querying
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
- ## Creating new machines
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
- ## Executing shell commands in containers
87
+ ### Executing shell commands in containers
77
88
 
78
89
  ```ruby
79
90
  container = Rancher::Api::Instance.find('1i382')
@@ -5,6 +5,7 @@ module Rancher
5
5
 
6
6
  has_many :machines
7
7
  has_many :environments
8
+ has_many :services
8
9
  end
9
10
  end
10
11
  end
@@ -0,0 +1,9 @@
1
+ module Rancher
2
+ module Api
3
+ class Service
4
+ include ::Her::Model
5
+
6
+ belongs_to :project
7
+ end
8
+ end
9
+ end
@@ -3,3 +3,4 @@ require 'rancher/api/models/host'
3
3
  require 'rancher/api/models/instance'
4
4
  require 'rancher/api/models/machine'
5
5
  require 'rancher/api/models/project'
6
+ require 'rancher/api/models/service'
@@ -1,5 +1,5 @@
1
1
  module Rancher
2
2
  module Api
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
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.0
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