miasma-aws 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/miasma-aws/version.rb +1 -1
- data/lib/miasma/contrib/aws/load_balancer.rb +34 -15
- data/lib/miasma/contrib/aws/orchestration.rb +9 -1
- data/miasma-aws.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a36b7462b9d20c66ddf295b05ebdf6e040347506
|
4
|
+
data.tar.gz: 0f5d54d5fe39d9875113c9780129bf00b5ecfa10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e3d201264bee490fb391aa998fc57590d270543f4d82556444fcc875f2838b61eb2187a2f29e859a0a8279865bf278c99be651a93f554428a3692c808bc6683
|
7
|
+
data.tar.gz: 9ff5d373105120f4ecc53a94cb0cb3847c1d426b5bf845edd1774b91cad1d917a51d045a0fe4a327400e083c71512c5d57c1dae6d9e363123dd8718aeb1a32e4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## v0.1.4
|
2
|
+
* Fix values set within load balancer reload
|
3
|
+
* Ensure state is valid for orchestration stack prior to set
|
4
|
+
* Load health status of instances attached to load balancers
|
5
|
+
|
1
6
|
## v0.1.2
|
2
7
|
* Migrate spec coverage
|
3
8
|
* Update storage behavior to use streamable helper
|
data/lib/miasma-aws/version.rb
CHANGED
@@ -103,7 +103,7 @@ module Miasma
|
|
103
103
|
def load_balancer_data(balancer=nil)
|
104
104
|
params = Smash.new('Action' => 'DescribeLoadBalancers')
|
105
105
|
if(balancer)
|
106
|
-
params.merge('LoadBalancerNames.member.1' => balancer.id || balancer.name)
|
106
|
+
params.merge!('LoadBalancerNames.member.1' => balancer.id || balancer.name)
|
107
107
|
end
|
108
108
|
result = all_result_pages(nil, :body, 'DescribeLoadBalancersResponse', 'DescribeLoadBalancersResult', 'LoadBalancerDescriptions', 'member') do |options|
|
109
109
|
request(
|
@@ -111,23 +111,42 @@ module Miasma
|
|
111
111
|
:params => options.merge(params)
|
112
112
|
)
|
113
113
|
end
|
114
|
+
if(balancer)
|
115
|
+
health_result = all_result_pages(nil, :body, 'DescribeInstanceHealthResponse', 'DescribeInstanceHealthResult', 'InstanceStates', 'member') do |options|
|
116
|
+
request(
|
117
|
+
:path => '/',
|
118
|
+
:params => options.merge(
|
119
|
+
'LoadBalancerName' => balancer.id || balancer.name,
|
120
|
+
'Action' => 'DescribeInstanceHealth'
|
121
|
+
)
|
122
|
+
)
|
123
|
+
end
|
124
|
+
end
|
114
125
|
result.map do |blr|
|
115
126
|
(balancer || Balancer.new(self)).load_data(
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
127
|
+
Smash.new(
|
128
|
+
:id => blr['LoadBalancerName'],
|
129
|
+
:name => blr['LoadBalancerName'],
|
130
|
+
:state => :active,
|
131
|
+
:status => 'ACTIVE',
|
132
|
+
:created => blr['CreatedTime'],
|
133
|
+
:updated => blr['CreatedTime'],
|
134
|
+
:public_addresses => [
|
135
|
+
Balancer::Address.new(
|
136
|
+
:address => blr['DNSName'],
|
137
|
+
:version => 4
|
138
|
+
)
|
139
|
+
],
|
140
|
+
:servers => [blr.get('Instances', 'member')].flatten(1).compact.map{|i|
|
141
|
+
Balancer::Server.new(self.api_for(:compute), :id => i['InstanceId'])
|
142
|
+
}
|
143
|
+
).merge(
|
144
|
+
health_result.nil? ? {} : Smash.new(
|
145
|
+
:server_states => health_result.nil? ? nil : health_result.map{|i|
|
146
|
+
Balancer::ServerState.new(self.api_for(:compute), :id => i['InstanceId'], :status => i['State'], :reason => i['ReasonCode'], :state => i['State'] == 'InService' ? :up : :down)
|
147
|
+
}
|
126
148
|
)
|
127
|
-
|
128
|
-
:servers => [blr.get('Instances', 'member')].flatten(1).compact.map{|i|
|
129
|
-
Balancer::Server.new(self.api_for(:compute), :id => i['InstanceId'])
|
130
|
-
}
|
149
|
+
)
|
131
150
|
).valid_state
|
132
151
|
end
|
133
152
|
end
|
@@ -72,6 +72,14 @@ module Miasma
|
|
72
72
|
if(stack)
|
73
73
|
next if stack.id != stk['StackId'] && stk['StackId'].split('/')[1] != stack.id
|
74
74
|
end
|
75
|
+
state = stk['StackStatus'].downcase.to_sym
|
76
|
+
unless(Miasma::Models::Orchestration::VALID_RESOURCE_STATES.include?(state))
|
77
|
+
parts = state.to_s.split('_')
|
78
|
+
state = [state.first, *state.slice(-2, state.size)].join('_').to_sym
|
79
|
+
unless(Miasma::Models::Orchestration::VALID_RESOURCE_STATES.include?(state))
|
80
|
+
state = :unknown
|
81
|
+
end
|
82
|
+
end
|
75
83
|
new_stack = stack || Stack.new(self)
|
76
84
|
new_stack.load_data(
|
77
85
|
:id => stk['StackId'],
|
@@ -84,7 +92,7 @@ module Miasma
|
|
84
92
|
:timeout_in_minutes => stk['TimeoutInMinutes'] ? stk['TimeoutInMinutes'].to_i : nil,
|
85
93
|
:status => stk['StackStatus'],
|
86
94
|
:status_reason => stk['StackStatusReason'],
|
87
|
-
:state =>
|
95
|
+
:state => state,
|
88
96
|
:template_description => stk['TemplateDescription'],
|
89
97
|
:disable_rollback => !!stk['DisableRollback'],
|
90
98
|
:outputs => [stk.get('Outputs', 'member')].flatten(1).compact.map{|o|
|
data/miasma-aws.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.description = 'Smoggy AWS API'
|
11
11
|
s.license = 'Apache 2.0'
|
12
12
|
s.require_path = 'lib'
|
13
|
-
s.add_development_dependency 'miasma', '>= 0.2.
|
13
|
+
s.add_development_dependency 'miasma', '>= 0.2.16'
|
14
14
|
s.add_development_dependency 'pry'
|
15
15
|
s.add_development_dependency 'minitest'
|
16
16
|
s.add_development_dependency 'vcr'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miasma-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: miasma
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.
|
19
|
+
version: 0.2.16
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.2.
|
26
|
+
version: 0.2.16
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pry
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|