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 +4 -4
- data/lib/ey-core/client.rb +1 -0
- data/lib/ey-core/models/server.rb +8 -0
- data/lib/ey-core/requests/reconcile_server.rb +39 -0
- data/lib/ey-core/version.rb +1 -1
- data/spec/servers_spec.rb +6 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22f4bf036b2ae0e2405f9c2b3429be50acf703b9
|
4
|
+
data.tar.gz: 6a39aa1bff963bb2fab93ec11f05097aa4026412
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01efbde05cc301846b49497e02f2d8687a4f3caba403dce45b35e10bc694e6dc30bb728974b91375a37f2d105313f1a4c0f11b5d2f0329037b13361d48aba144
|
7
|
+
data.tar.gz: ad29a4f6fbd2259923a85ff4cc3af054c1e62912c2333c922881646f6bc2eebfe7e753ec621c8445bdfe22e2ebcd52b2957e81f2ca7d905e7e96f78a6b69fb2d
|
data/lib/ey-core/client.rb
CHANGED
@@ -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
|
data/lib/ey-core/version.rb
CHANGED
data/spec/servers_spec.rb
CHANGED
@@ -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.
|
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-
|
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
|