miasma 0.2.8 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/miasma/contrib/aws.rb +3 -2
- data/lib/miasma/contrib/aws/auto_scale.rb +6 -5
- data/lib/miasma/contrib/aws/load_balancer.rb +6 -4
- data/lib/miasma/contrib/aws/orchestration.rb +24 -25
- data/lib/miasma/contrib/aws/storage.rb +15 -8
- data/lib/miasma/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 039c6245899398e6105945fa52ea6b60a6f8b496
|
4
|
+
data.tar.gz: a50c93103661c9d7919ea9453b095d13d7cbe272
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30654c515d23a58a58355b7b61ba4fc15179b0cb212dbeaa17bf27879bbba0494516efb1570bb45df29d5d157a6c7f243fdc57c02a0537847524ac651b734528
|
7
|
+
data.tar.gz: e609e7a4a63d73df54f783ee6d33854b1dee23506a25aeaeeac66e14cf2e85a5d4e2ccae0918be602825511c55f12e1b7951e113585dafe7c059c6c6393874eb
|
data/CHANGELOG.md
CHANGED
data/lib/miasma/contrib/aws.rb
CHANGED
@@ -29,8 +29,9 @@ module Miasma
|
|
29
29
|
else
|
30
30
|
list << content
|
31
31
|
end
|
32
|
-
|
33
|
-
|
32
|
+
set = result.get(*result_key.slice(0, 3))
|
33
|
+
if(set && set['NextToken'])
|
34
|
+
list += all_result_pages(set['NextToken'], *result_key, &block)
|
34
35
|
end
|
35
36
|
list.compact
|
36
37
|
end
|
@@ -49,11 +49,12 @@ module Miasma
|
|
49
49
|
if(group)
|
50
50
|
params.merge('AutoScalingGroupNames.member.1' => group.id || group.name)
|
51
51
|
end
|
52
|
-
result =
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
52
|
+
result = all_result_pages(nil, :body, 'DescribeAutoScalingGroupsResponse', 'DescribeAutoScalingGroupsResult', 'AutoScalingGroups', 'member') do |options|
|
53
|
+
request(
|
54
|
+
:path => '/',
|
55
|
+
:params => options.merge(params)
|
56
|
+
)
|
57
|
+
end.map do |grp|
|
57
58
|
(group || Group.new(self)).load_data(
|
58
59
|
:id => grp['AutoScalingGroupName'],
|
59
60
|
:name => grp['AutoScalingGroupName'],
|
@@ -105,10 +105,12 @@ module Miasma
|
|
105
105
|
if(balancer)
|
106
106
|
params.merge('LoadBalancerNames.member.1' => balancer.id || balancer.name)
|
107
107
|
end
|
108
|
-
result =
|
109
|
-
|
110
|
-
|
111
|
-
|
108
|
+
result = all_result_pages(nil, :body, 'DescribeAutoScalingGroupsResponse', 'DescribeAutoScalingGroupsResult', 'AutoScalingGroups', 'member') do |options|
|
109
|
+
request(
|
110
|
+
:path => '/',
|
111
|
+
:params => options.merge(params)
|
112
|
+
)
|
113
|
+
end
|
112
114
|
[result.get(:body, 'DescribeLoadBalancersResponse', 'DescribeLoadBalancersResult', 'LoadBalancerDescriptions', 'member')].flatten.compact.map do |blr|
|
113
115
|
(balancer || Balancer.new(self)).load_data(
|
114
116
|
:id => blr['LoadBalancerName'],
|
@@ -50,19 +50,21 @@ module Miasma
|
|
50
50
|
end
|
51
51
|
if(stack)
|
52
52
|
d_params['StackName'] = stack.id
|
53
|
+
descriptions = all_result_pages(nil, :body, 'DescribeStacksResponse', 'DescribeStacksResult', 'Stacks', 'member') do |options|
|
54
|
+
request(
|
55
|
+
:path => '/',
|
56
|
+
:params => options.merge(d_params)
|
57
|
+
)
|
58
|
+
end
|
59
|
+
else
|
60
|
+
descriptions = []
|
53
61
|
end
|
54
|
-
|
55
|
-
request(
|
56
|
-
:
|
57
|
-
|
58
|
-
].flatten(1).compact
|
59
|
-
lists = request(:path => '/', :params => l_params)
|
60
|
-
[
|
61
|
-
lists.get(
|
62
|
-
:body, 'ListStacksResponse', 'ListStacksResult',
|
63
|
-
'StackSummaries', 'member'
|
62
|
+
lists = all_result_pages(nil, :body, 'ListStacksResponse', 'ListStacksResult', 'StackSummaries', 'member') do |options|
|
63
|
+
request(
|
64
|
+
:path => '/',
|
65
|
+
:params => options.merge(l_params)
|
64
66
|
)
|
65
|
-
|
67
|
+
end.map do |stk|
|
66
68
|
desc = descriptions.detect do |d_stk|
|
67
69
|
d_stk['StackId'] == stk['StackId']
|
68
70
|
end || Smash.new
|
@@ -79,7 +81,7 @@ module Miasma
|
|
79
81
|
:created => stk['CreationTime'],
|
80
82
|
:updated => stk['LastUpdatedTime'],
|
81
83
|
:notification_topics => [stk.get('NotificationARNs', 'member')].flatten(1).compact,
|
82
|
-
:timeout_in_minutes => stk['TimeoutInMinutes'],
|
84
|
+
:timeout_in_minutes => stk['TimeoutInMinutes'] ? stk['TimeoutInMinutes'].to_i : nil,
|
83
85
|
:status => stk['StackStatus'],
|
84
86
|
:status_reason => stk['StackStatusReason'],
|
85
87
|
:state => stk['StackStatus'].downcase.to_sym,
|
@@ -255,20 +257,17 @@ module Miasma
|
|
255
257
|
# @param stack [Models::Orchestration::Stack]
|
256
258
|
# @return [Array<Models::Orchestration::Stack::Resource>]
|
257
259
|
def resource_all(stack)
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
:body, 'DescribeStackResourcesResponse',
|
268
|
-
'DescribeStackResourcesResult',
|
269
|
-
'StackResources', 'member', []
|
260
|
+
results = all_result_pages(nil, :body, 'DescribeStackResourcesResponse', 'DescribeStackResourcesResult', 'StackResources', 'member') do |options|
|
261
|
+
request(
|
262
|
+
:path => '/',
|
263
|
+
:params => options.merge(
|
264
|
+
Smash.new(
|
265
|
+
'Action' => 'DescribeStackResources',
|
266
|
+
'StackName' => stack.id
|
267
|
+
)
|
268
|
+
)
|
270
269
|
)
|
271
|
-
|
270
|
+
end.map do |res|
|
272
271
|
Stack::Resource.new(
|
273
272
|
stack,
|
274
273
|
:id => res['PhysicalResourceId'],
|
@@ -117,8 +117,13 @@ module Miasma
|
|
117
117
|
#
|
118
118
|
# @return [Array<Models::Storage::Bucket>]
|
119
119
|
def bucket_all
|
120
|
-
result =
|
121
|
-
|
120
|
+
result = all_result_pages(nil, :body, 'ListAllMyBucketsResult', 'Buckets', 'Bucket') do |options|
|
121
|
+
request(
|
122
|
+
:path => '/',
|
123
|
+
:params => options
|
124
|
+
)
|
125
|
+
end
|
126
|
+
result.map do |bkt|
|
122
127
|
Bucket.new(
|
123
128
|
self,
|
124
129
|
:id => bkt['Name'],
|
@@ -160,11 +165,14 @@ module Miasma
|
|
160
165
|
# @param bucket [Bucket]
|
161
166
|
# @return [Array<File>]
|
162
167
|
def file_all(bucket)
|
163
|
-
result =
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
+
result = all_result_pages(nil, :body, 'ListBucketResult', 'Contents') do |options|
|
169
|
+
request(
|
170
|
+
:path => '/',
|
171
|
+
:params => options,
|
172
|
+
:endpoint => bucket_endpoint(bucket)
|
173
|
+
)
|
174
|
+
end
|
175
|
+
result.map do |file|
|
168
176
|
File.new(
|
169
177
|
bucket,
|
170
178
|
:id => ::File.join(bucket.name, file['Key']),
|
@@ -335,7 +343,6 @@ module Miasma
|
|
335
343
|
'X-Amz-Date' => Contrib::AwsApiCore.time_iso8601,
|
336
344
|
'X-Amz-Expires' => timeout_secs
|
337
345
|
)
|
338
|
-
|
339
346
|
)
|
340
347
|
else
|
341
348
|
raise Error::ModelPersistError.new "#{file} has not been saved!"
|
data/lib/miasma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miasma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|