rancher-api 0.3.7 → 0.3.8

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: db47b8b18957e7f85b04666e9cd887bf976d84b0
4
- data.tar.gz: 1cc413650202352628ba9e0cb103e3bc61dad4c6
3
+ metadata.gz: 69a6c3ad0e66f587ef7c090231e136dae1eff7e2
4
+ data.tar.gz: 6a53f3f8f6787d21182880156c801d44326f2021
5
5
  SHA512:
6
- metadata.gz: 1a3036e738ca07f27fcf90d639113eecf1447cb805689e0f4d6464d98ff1cf414f691d9e79ee9658cc534ebdaeaf74fadadbf93bd537455f682cc74b937a1fd0
7
- data.tar.gz: e115ceba6ee64c4c43aca9c6cc966642020e12ee0967ddfd574b5d72b36a5a56380344b4bd8d1ceb09c7d0613f625e80ffc700aaf299831556846041b902922a
6
+ metadata.gz: 224e0a6906eb746047c3c88e3570bc6a8b1e7ddc691c0bfd43d854615ce3d916c8ed25199e7bbc4a634d713c55ca9d3e0f7f0a6c4fac42ab69b185799e35b113
7
+ data.tar.gz: 8251f67c299f13a58b4e826c5e51779543fec14daca31fe370654b44c148c93ea44989a00089a0e78bd28c86e89ccec2d9c2ccfa7c15a2e276716fe35ffa4198
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+
6
+ ## [0.3.8] - 2016-03-15
7
+
8
+ - add Ipaddress class and association to Host class
9
+
10
+
5
11
  ## [0.3.7] - 2016-03-15
6
12
 
7
13
  - fix an issue with RANCHER_URL env variable (append `/v1/` to the RANCHER_URL env variable if it exists). This way RANCHER_URL becomes truly `rancher-compose`-compatible.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rancher-api (0.3.7)
4
+ rancher-api (0.3.8)
5
5
  faraday_middleware
6
6
  faye-websocket
7
7
  her (~> 0.7.6)
@@ -9,10 +9,10 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activemodel (4.2.5.2)
13
- activesupport (= 4.2.5.2)
12
+ activemodel (4.2.6)
13
+ activesupport (= 4.2.6)
14
14
  builder (~> 3.1)
15
- activesupport (4.2.5.2)
15
+ activesupport (4.2.6)
16
16
  i18n (~> 0.7)
17
17
  json (~> 1.7, >= 1.7.7)
18
18
  minitest (~> 5.1)
@@ -25,7 +25,7 @@ GEM
25
25
  crack (0.4.2)
26
26
  safe_yaml (~> 1.0.0)
27
27
  diff-lcs (1.2.5)
28
- eventmachine (1.0.9.1)
28
+ eventmachine (1.2.0)
29
29
  faraday (0.9.2)
30
30
  multipart-post (>= 1.2, < 3)
31
31
  faraday_middleware (0.10.0)
data/README.md CHANGED
@@ -94,6 +94,33 @@ project = Rancher::Api::Project.all.to_a
94
94
  machine = Rancher::Api::Machine.find('1ph1')
95
95
  ```
96
96
 
97
+ `rancher/api` gem uses ORM Her which hence inherently supports all of the features that Her has to offer. To get more details, review this page https://github.com/remiprev/her#fetching-data
98
+
99
+ Some of the example queries include:
100
+
101
+ ```ruby
102
+ project = Rancher::Api::Project.all.to_a.first
103
+
104
+ project.machines
105
+
106
+ # exact machine name
107
+ project.machines.where(name: 'ciqa01')
108
+
109
+ # machine's name not equal to
110
+ project.machines.where(name_ne: 'qa')
111
+
112
+ # machine's name starts with
113
+ project.machines.where(name_prefix: 'qa')
114
+
115
+ # other attributes
116
+
117
+ # state not active
118
+ project.machines.where(state_ne: 'active')
119
+
120
+ # state activating
121
+ project.machines.where(state: 'activating')
122
+ ```
123
+
97
124
  ### Creating new machines
98
125
  Creating new machine using **Digital Ocean** driver:
99
126
 
@@ -4,3 +4,4 @@ require 'rancher/api/models/instance'
4
4
  require 'rancher/api/models/machine'
5
5
  require 'rancher/api/models/project'
6
6
  require 'rancher/api/models/service'
7
+ require 'rancher/api/models/ipaddress'
@@ -5,6 +5,7 @@ module Rancher
5
5
 
6
6
  belongs_to :machine
7
7
  has_many :instances
8
+ has_many :ipaddresses
8
9
  end
9
10
  end
10
11
  end
@@ -0,0 +1,9 @@
1
+ module Rancher
2
+ module Api
3
+ class Ipaddress
4
+ include Her::Model
5
+
6
+ attributes :name, :state, :address
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  module Rancher
2
2
  module Api
3
- VERSION = "0.3.7"
3
+ VERSION = "0.3.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rancher-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Kurkin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-15 00:00:00.000000000 Z
11
+ date: 2016-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: her
@@ -182,6 +182,7 @@ files:
182
182
  - lib/rancher/api/models/host.rb
183
183
  - lib/rancher/api/models/instance.rb
184
184
  - lib/rancher/api/models/instance/action.rb
185
+ - lib/rancher/api/models/ipaddress.rb
185
186
  - lib/rancher/api/models/machine.rb
186
187
  - lib/rancher/api/models/machine/driver_config.rb
187
188
  - lib/rancher/api/models/project.rb