diff --git a/Gemfile.lock b/Gemfile.lock index f75c23f..1664710 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,42 +1,43 @@ PATH remote: . specs: - rancher-api (0.7.0) + rancher-api (0.8.0) faraday_middleware faye-websocket - her (~> 0.8.1) + her (~> 0.9.0) GEM remote: https://rubygems.org/ specs: - activemodel (5.0.0.1) - activesupport (= 5.0.0.1) - activesupport (5.0.0.1) + activemodel (5.1.4) + activesupport (= 5.1.4) + activesupport (5.1.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.3.8) - awesome_print (1.7.0) - byebug (6.0.0) - coderay (1.1.0) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + awesome_print (1.8.0) + byebug (9.1.0) + coderay (1.1.2) colorize (0.8.1) - concurrent-ruby (1.0.2) - crack (0.4.2) + concurrent-ruby (1.0.5) + crack (0.4.3) safe_yaml (~> 1.0.0) - diff-lcs (1.2.5) + diff-lcs (1.3) docile (1.1.5) - eventmachine (1.2.1) - faraday (0.10.0) + eventmachine (1.2.5) + faraday (0.13.1) multipart-post (>= 1.2, < 3) - faraday_middleware (0.10.1) + faraday_middleware (0.12.2) faraday (>= 0.7.4, < 1.0) - faye-websocket (0.10.5) + faye-websocket (0.10.7) eventmachine (>= 0.12.0) websocket-driver (>= 0.5.1) - ffi (1.9.10) + ffi (1.9.18) formatador (0.2.5) - guard (2.14.0) + guard (2.14.1) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) lumberjack (~> 1.0) @@ -46,40 +47,43 @@ GEM shellany (~> 0.0) thor (>= 0.18.1) guard-compat (1.2.1) - guard-rspec (4.7.2) + guard-rspec (4.7.3) guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - her (0.8.2) + her (0.9.0) activemodel (>= 3.0.0, <= 6.0.0) activesupport (>= 3.0.0, <= 6.0.0) faraday (>= 0.8, < 1.0) multi_json (~> 1.7) - httplog (0.3.3) + httplog (1.0.0) colorize - i18n (0.7.0) - json (1.8.3) + rack + i18n (0.9.1) + concurrent-ruby (~> 1.0) + json (2.1.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) - lumberjack (1.0.10) - method_source (0.8.2) - minitest (5.10.1) - multi_json (1.12.1) + lumberjack (1.0.12) + method_source (0.9.0) + minitest (5.10.3) + multi_json (1.12.2) multipart-post (2.0.0) nenv (0.3.0) - notiffany (0.1.0) + notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) - pry (0.10.1) + pry (0.11.2) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - rake (10.4.2) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) + method_source (~> 0.9.0) + public_suffix (3.0.0) + rack (2.0.3) + rake (10.5.0) + rb-fsevent (0.10.2) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) rspec (3.3.0) rspec-core (~> 3.3.0) rspec-expectations (~> 3.3.0) @@ -93,24 +97,23 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.3.0) rspec-support (3.3.0) - ruby_dep (1.3.1) + ruby_dep (1.5.0) safe_yaml (1.0.4) shellany (0.0.1) - simplecov (0.12.0) + simplecov (0.15.1) docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) - simplecov-html (0.10.0) - slop (3.6.0) - thor (0.19.1) - thread_safe (0.3.5) - tzinfo (1.2.2) + simplecov-html (0.10.2) + thor (0.20.0) + thread_safe (0.3.6) + tzinfo (1.2.4) thread_safe (~> 0.1) - vcr (2.9.3) + vcr (3.0.3) webmock (1.21.0) addressable (>= 2.3.6) crack (>= 0.3.2) - websocket-driver (0.6.4) + websocket-driver (0.7.0) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) @@ -128,8 +131,8 @@ DEPENDENCIES rancher-api! rspec (~> 3.3.0) simplecov - vcr (= 2.9.3) + vcr (= 3.0.3) webmock (= 1.21.0) BUNDLED WITH - 1.12.5 + 1.15.4 diff --git a/lib/rancher/api/models.rb b/lib/rancher/api/models.rb index 2355678..7a02e1f 100644 --- a/lib/rancher/api/models.rb +++ b/lib/rancher/api/models.rb @@ -10,3 +10,7 @@ require 'rancher/api/models/ipaddress' require 'rancher/api/models/registry' require 'rancher/api/models/registrycredential' +require 'rancher/api/models/stack' +require 'rancher/api/models/auditlog' +require 'rancher/api/models/account' +require 'rancher/api/models/credential' diff --git a/lib/rancher/api/models/account.rb b/lib/rancher/api/models/account.rb new file mode 100644 index 0000000..647ec3d --- /dev/null +++ b/lib/rancher/api/models/account.rb @@ -0,0 +1,9 @@ +module Rancher + module Api + class Account + include Her::Model + include Helpers::Model + + end + end +end diff --git a/lib/rancher/api/models/auditlog.rb b/lib/rancher/api/models/auditlog.rb new file mode 100644 index 0000000..a65dfbd --- /dev/null +++ b/lib/rancher/api/models/auditlog.rb @@ -0,0 +1,10 @@ +module Rancher + module Api + class Auditlog + include Her::Model + include Helpers::Model + + attributes :resourceId + end + end +end diff --git a/lib/rancher/api/models/credential.rb b/lib/rancher/api/models/credential.rb new file mode 100644 index 0000000..e424c72 --- /dev/null +++ b/lib/rancher/api/models/credential.rb @@ -0,0 +1,8 @@ +module Rancher + module Api + class Credential + include Her::Model + include Helpers::Model + end + end +end diff --git a/lib/rancher/api/models/environment.rb b/lib/rancher/api/models/environment.rb index a7896c9..cf18bc6 100644 --- a/lib/rancher/api/models/environment.rb +++ b/lib/rancher/api/models/environment.rb @@ -7,6 +7,7 @@ class Environment belongs_to :project has_many :services + has_many :hosts end end end diff --git a/lib/rancher/api/models/project.rb b/lib/rancher/api/models/project.rb index 4379a69..51e8b57 100644 --- a/lib/rancher/api/models/project.rb +++ b/lib/rancher/api/models/project.rb @@ -9,6 +9,7 @@ class Project has_many :hosts has_many :environments has_many :services + has_many :stacks class << self def find_by_name(name:) diff --git a/lib/rancher/api/models/stack.rb b/lib/rancher/api/models/stack.rb new file mode 100644 index 0000000..cac8458 --- /dev/null +++ b/lib/rancher/api/models/stack.rb @@ -0,0 +1,11 @@ +module Rancher + module Api + class Stack + include Her::Model + include Helpers::Model + + belongs_to :project, foreign_key: :accountId + has_many :services + end + end +end diff --git a/lib/rancher/api/version.rb b/lib/rancher/api/version.rb index 05a4637..457466f 100644 --- a/lib/rancher/api/version.rb +++ b/lib/rancher/api/version.rb @@ -1,5 +1,5 @@ module Rancher module Api - VERSION = '0.7.0'.freeze + VERSION = '0.8.0'.freeze end end diff --git a/rancher-api.gemspec b/rancher-api.gemspec index 1cb26de..0b54f3a 100644 --- a/rancher-api.gemspec +++ b/rancher-api.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_dependency 'her', '~> 0.8.1' + spec.add_dependency 'her', '~> 0.9.0' spec.add_dependency 'faye-websocket' spec.add_dependency 'faraday_middleware' @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry' spec.add_development_dependency 'byebug' spec.add_development_dependency 'webmock', '1.21.0' - spec.add_development_dependency 'vcr', '2.9.3' + spec.add_development_dependency 'vcr', '3.0.3' spec.add_development_dependency 'awesome_print' spec.add_development_dependency 'guard-rspec' spec.add_development_dependency 'simplecov' diff --git a/spec/rancher/api_spec.rb b/spec/rancher/api_spec.rb index 7e8bf7b..3846572 100644 --- a/spec/rancher/api_spec.rb +++ b/spec/rancher/api_spec.rb @@ -8,12 +8,12 @@ context '#configure' do before do subject.configure do |config| - config.url = 'test.test' + config.url = 'http://test.test' end end it 'should keep configuration instance' do - expect(subject.configuration.url).to eq('test.test') + expect(subject.configuration.url).to eq('http://test.test') end context '#reset' do