ey-core 3.2.2 → 3.2.3

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: 1c7d3bbcab00aa10fed281e8771ee72f6c00256d
4
- data.tar.gz: 227314a376a36894f199b4eece85622c3eccc85e
3
+ metadata.gz: 22f4bf036b2ae0e2405f9c2b3429be50acf703b9
4
+ data.tar.gz: 6a39aa1bff963bb2fab93ec11f05097aa4026412
5
5
  SHA512:
6
- metadata.gz: 7929b940b0028d2e0af34d966ab5846c00c71aad29c323f3b2be41f5bd5fb1cd1fbd926ab7e76e0ba1fbd84841c7993e42ee1b7066c0a046ab06b07a1a53e23e
7
- data.tar.gz: 68046e825aa2922d62372ad9adacf6cfa31137eb20170b53951434275d1a174eccce67b665d7e262653fa2c28051e0fb52d98347f6aee9465145d766424bda86
6
+ metadata.gz: 01efbde05cc301846b49497e02f2d8687a4f3caba403dce45b35e10bc694e6dc30bb728974b91375a37f2d105313f1a4c0f11b5d2f0329037b13361d48aba144
7
+ data.tar.gz: ad29a4f6fbd2259923a85ff4cc3af054c1e62912c2333c922881646f6bc2eebfe7e753ec621c8445bdfe22e2ebcd52b2957e81f2ca7d905e7e96f78a6b69fb2d
@@ -289,6 +289,7 @@ class Ey::Core::Client < Cistern::Service
289
289
  request :get_users
290
290
  request :get_volumes
291
291
  request :reboot_server
292
+ request :reconcile_server
292
293
  request :request_callback
293
294
  request :reset_password
294
295
  request :reset_server_state
@@ -77,6 +77,14 @@ class Ey::Core::Client::Server < Ey::Core::Model
77
77
  )
78
78
  end
79
79
 
80
+ def reconcile
81
+ requires :identity
82
+
83
+ connection.requests.new(
84
+ self.connection.reconcile_server("id" => self.identity).body["request"]
85
+ )
86
+ end
87
+
80
88
  def reset_state(state)
81
89
  params = {
82
90
  "url" => self.collection.url,
@@ -0,0 +1,39 @@
1
+ class Ey::Core::Client
2
+ class Real
3
+ def reconcile_server(params={})
4
+ id = params["id"]
5
+ url = params["url"]
6
+
7
+ request(
8
+ :method => :put,
9
+ :path => "servers/#{id}/reconcile",
10
+ :url => url,
11
+ )
12
+ end
13
+ end # Real
14
+
15
+ class Mock
16
+ def reconcile_server(params={})
17
+ request_id = self.uuid
18
+ identity = resource_identity(params)
19
+
20
+ find(:servers, identity)
21
+
22
+ reconcile_request = {
23
+ "finished_at" => Time.now,
24
+ "id" => request_id,
25
+ "started_at" => Time.now,
26
+ "successful" => "true",
27
+ "server" => url_for("/servers/#{identity}"),
28
+ "type" => "reconcile_server_request",
29
+ }
30
+
31
+ self.data[:requests][request_id] = reconcile_request
32
+
33
+ response(
34
+ :body => {"request" => reconcile_request},
35
+ :status => 201,
36
+ )
37
+ end
38
+ end # Mock
39
+ end
@@ -1,5 +1,5 @@
1
1
  module Ey
2
2
  module Core
3
- VERSION = "3.2.2"
3
+ VERSION = "3.2.3"
4
4
  end
5
5
  end
@@ -46,6 +46,12 @@ describe 'servers' do
46
46
  expect(request.successful).to be true
47
47
  end
48
48
 
49
+ it "reconciles" do
50
+ request = server.reconcile
51
+ request.ready!
52
+ expect(request.successful).to be true
53
+ end
54
+
49
55
  it "applies" do
50
56
  expect(server.apply.ready!).to be_successful
51
57
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ey-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2017-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -699,6 +699,7 @@ files:
699
699
  - lib/ey-core/requests/get_volume.rb
700
700
  - lib/ey-core/requests/get_volumes.rb
701
701
  - lib/ey-core/requests/reboot_server.rb
702
+ - lib/ey-core/requests/reconcile_server.rb
702
703
  - lib/ey-core/requests/request_callback.rb
703
704
  - lib/ey-core/requests/reset_password.rb
704
705
  - lib/ey-core/requests/reset_server_state.rb