seiso-connector 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmQzNTdjNWYxYTZjZWFmZWQ4NTc5NjQ0OWE2ZWUyMmQ0NzAzNGQ2Ng==
4
+ ZjVhYjA4ZmE5ZDQxMWFkMTkzMjY5Yjc0MTFlNmJkNWI4NzM3MzkzMA==
5
5
  data.tar.gz: !binary |-
6
- YWI1ZjFiMWFiN2I3MDIyYjM5MzEwMTE4YTBjODNiMmM2MWRiZGRmZA==
6
+ MThhNWI2MGJiZTY2N2JlYjUxMzdkOTg5OThjMTU2MzE5ZTUwMTUwZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDQyNGQzYTRhNzI2MDkyNmFkNzdmOTYwYTRiYmZjNzhmMzU0ZTMwMDlhMWUx
10
- MjlhYTUyNGY4NTIwNjhkNmQ0YjQ5ZDAzYTAwMTc3NGNjNDRmNzhjZWMyNzJh
11
- NjkxM2U4MTk4MjEyZTVlNmE4YWZkYzgzY2EwZjJjYTc3ODQyNzY=
9
+ ZTIyYjIyYWI2Y2FiMDljYzE1YjhiNGQ5ZWUxZmFhZWM1Yzk2MTU5MjNhODNj
10
+ YWUwYzg0OGE4MjA1ODRkNjQ0NzU2NzJjMDE1NDFlNjNlZGZlYzZjM2JiZTQz
11
+ YmEyYTRhNWFhYjZjZjRkNDQ0NmU4YzU3YzRkNjI1OGVhZDcyYzM=
12
12
  data.tar.gz: !binary |-
13
- NWJjYjAzMzdkMzRkNGUwZDUxMTAwZDRiZjAxNTFlOTAxMDc4Nzg4NGI1ZWNi
14
- MTAzNDFjNzQyMmM0MjM1ZWM4ZTk0MzRlOTQ1OGE2NzEzNTNiMTQxYjkwNDg3
15
- MGYyYjA2Y2RlZDVhY2M0M2FmYjk2M2E2NjJlMzRhOTY3OTQwYWE=
13
+ N2Q5Mzk1YWQ2ZjczNDk2ZGY4NjFlZjBkZjhmMTAyYWRmOGZiY2U2ZmI4NDQ1
14
+ Zjg4OTYxY2M4NmZjN2M2Mjg0MWQ1MzNhOTY2N2ZiY2VhZjU5NjE5ZWEwMjcy
15
+ YzZmMzM2Njg3OTBjNjE4NzgzZGRmZjYxODIyNzliM2YxMGU3ZmQ=
data/.gitignore CHANGED
@@ -15,3 +15,4 @@
15
15
  *.gem
16
16
  mkmf.log
17
17
  /.project
18
+ /.idea
@@ -1,12 +1,9 @@
1
1
  require "net/http"
2
2
  require "openssl"
3
+ require "require_all"
3
4
  require "uri"
4
5
 
5
- require_relative "connector/connector_v1"
6
- require_relative "connector/connector_v2"
7
- require_relative "connector/rest_connector"
8
- require_relative "connector/uri_factory_v1"
9
- require_relative "connector/uri_factory_v2"
6
+ require_rel "connector"
10
7
 
11
8
  # DEPRECATED
12
9
  # Seiso namespace module
@@ -37,7 +34,6 @@ module Seiso
37
34
  http = create_http(host, port, use_ssl, ignore_cert)
38
35
 
39
36
  @connector_v1 = Seiso::Connector::ConnectorV1.new(http, username, password)
40
- @connector_v2 = Seiso::Connector::ConnectorV2.new(http, username, password)
41
37
  end
42
38
 
43
39
  # Tests can override this
@@ -45,11 +41,6 @@ module Seiso
45
41
  @connector_v1
46
42
  end
47
43
 
48
- # Tests can override this
49
- def connector_v2
50
- @connector_v2
51
- end
52
-
53
44
  # GET item list
54
45
  def get_items(type)
55
46
  connector_v1.do_get("/v1/#{type}")
@@ -49,6 +49,18 @@ module Seiso
49
49
  end
50
50
  end
51
51
 
52
+ def machines_uri(batch)
53
+ if batch
54
+ uri "/machines?mode=batch"
55
+ else
56
+ uri "/machines"
57
+ end
58
+ end
59
+
60
+ def machine_uri(name)
61
+ uri "/machines/#{name}"
62
+ end
63
+
52
64
  private
53
65
 
54
66
  def uri(path)
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "seiso-connector"
7
- spec.version = "0.1.6"
7
+ spec.version = "0.1.7"
8
8
  spec.authors = ["Willie Wheeler"]
9
9
  spec.email = ["wwheeler@expedia.com"]
10
10
  spec.summary = "Connector to make it easier for Ruby clients to talk to the Seiso REST API."
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "rake", "~> 10.0"
22
22
 
23
23
  spec.add_runtime_dependency "json", "~> 1.7"
24
+ spec.add_runtime_dependency "require_all", "~> 1.3.2"
24
25
  end
@@ -23,6 +23,5 @@ class TestConnector < MiniTest::Unit::TestCase
23
23
 
24
24
  def test_init
25
25
  refute_nil(@connector.connector_v1)
26
- refute_nil(@connector.connector_v2)
27
26
  end
28
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seiso-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willie Wheeler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-22 00:00:00.000000000 Z
11
+ date: 2015-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: require_all
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.3.2
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.3.2
55
69
  description: Very basic at this point. Plan to support pagination, sorting, searching
56
70
  and more in the future.
57
71
  email:
@@ -69,7 +83,6 @@ files:
69
83
  - Rakefile
70
84
  - lib/seiso/connector.rb
71
85
  - lib/seiso/connector/connector_v1.rb
72
- - lib/seiso/connector/connector_v2.rb
73
86
  - lib/seiso/connector/request_failed_error.rb
74
87
  - lib/seiso/connector/rest_connector.rb
75
88
  - lib/seiso/connector/uri_factory_v1.rb
@@ -77,7 +90,6 @@ files:
77
90
  - seiso-connector.gemspec
78
91
  - test/test_connector.rb
79
92
  - test/test_connector_v1.rb
80
- - test/test_connector_v2.rb
81
93
  homepage: http://seiso.io
82
94
  licenses:
83
95
  - Apache-2.0
@@ -105,4 +117,3 @@ summary: Connector to make it easier for Ruby clients to talk to the Seiso REST
105
117
  test_files:
106
118
  - test/test_connector.rb
107
119
  - test/test_connector_v1.rb
108
- - test/test_connector_v2.rb
@@ -1,24 +0,0 @@
1
- require 'net/http'
2
- require_relative 'request_failed_error'
3
-
4
- # DEPRECATED
5
- module Seiso
6
- class Connector
7
- class ConnectorV2
8
- attr_reader :http
9
- attr_reader :username
10
-
11
- def initialize(http, username, password)
12
- @http = http
13
- @username = username
14
- @password = password
15
- @request_headers = {
16
- "Accept" => "application/hal+json",
17
- "Content-Type" => "application/hal+json"
18
- }
19
- end
20
-
21
- # TODO
22
- end
23
- end
24
- end
@@ -1,26 +0,0 @@
1
- require 'seiso/connector/connector_v2'
2
- require 'minitest/autorun'
3
-
4
- # Author:: Willie Wheeler
5
- # Copyright:: Copyright (c) 2015 Expedia, Inc.
6
- # License:: Apache 2.0
7
- class TestConnectorV2 < MiniTest::Unit::TestCase
8
-
9
- def setup
10
-
11
- # Test data
12
- @username = "willie"
13
- @password = "rocket88"
14
-
15
- # Dependencies
16
- @http = {}
17
-
18
- # Class under test
19
- @connector = Seiso::Connector::ConnectorV2.new(@http, @username, @password)
20
- end
21
-
22
- def test_init
23
- assert_equal(@http, @connector.http)
24
- assert_equal(@username, @connector.username)
25
- end
26
- end