miasma-azure 0.1.0 → 0.1.2
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-azure/version.rb +1 -1
- data/lib/miasma/contrib/azure/orchestration.rb +35 -23
- 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: 930c7bce022b9900264a5edeeffead952cc6cb89
|
4
|
+
data.tar.gz: 3bab0bcf17dbce4f268e9b21ce326ac28d17c92c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4003382c4e7203a3c86b86c2210b7f06db6c20f79a0c1e694681a256c3994a4dabc7509e9c5e3e03b5a74359d6473d94c12cafef22ad1e55af39c1de394e3152
|
7
|
+
data.tar.gz: e8ac70debf8ac21c16ccebaa421e7533c31f6a6e84f11a192875ba1b9f1732f3ec628bd467cf11a9551d583a980696b9b3f35c748e2a246f6566b4940433fcd1
|
data/CHANGELOG.md
CHANGED
data/lib/miasma-azure/version.rb
CHANGED
@@ -112,8 +112,11 @@ module Miasma
|
|
112
112
|
[p_name, p_value[:value]]
|
113
113
|
end
|
114
114
|
],
|
115
|
-
:outputs => item.fetch(:outputs, {}).map{ |o_name, o_value|
|
116
|
-
|
115
|
+
:outputs => item.fetch(:properties, :outputs, {}).map{ |o_name, o_value|
|
116
|
+
Stack::Output.new(stack,
|
117
|
+
:key => o_name,
|
118
|
+
:value => o_value[:value]
|
119
|
+
)
|
117
120
|
},
|
118
121
|
:template_url => item.get(:properties, :templateLink, :uri),
|
119
122
|
:state => status_to_state(
|
@@ -413,28 +416,37 @@ module Miasma
|
|
413
416
|
# @param stack [Models::Orchestration::Stack]
|
414
417
|
# @return [Array<Models::Orchestration::Stack::Event>]
|
415
418
|
def event_all(stack, evt_id=nil)
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
events
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
:resource_id => event.get(:properties, :targetResource, :id),
|
424
|
-
:resource_name => event.get(:properties, :targetResource, :resourceName),
|
425
|
-
:resource_logical_id => event.get(:properties, :targetResource, :resourceName),
|
426
|
-
:resource_state => status_to_state(event.get(:properties, :provisioningState)),
|
427
|
-
:resource_status => event.get(:properties, :provisioningState),
|
428
|
-
:resource_status_reason => event.get(:properties, :statusCode),
|
429
|
-
:time => Time.parse(event.get(:properties, :timestamp))
|
430
|
-
).valid_state
|
431
|
-
end
|
432
|
-
if(evt_id)
|
433
|
-
idx = events.index{|d| e.id == evt_id}
|
434
|
-
idx = idx ? idx + 1 : 0
|
435
|
-
events.slice(idx, events.size)
|
419
|
+
# TODO and NOTE
|
420
|
+
# Operations can't be viewed when deletion is progress. For now
|
421
|
+
# just return nothing. This should be replaced with customized
|
422
|
+
# events: poll resource group resources and generate event items
|
423
|
+
# as resources are deleted
|
424
|
+
if(stack.state.to_s.start_with?('delete'))
|
425
|
+
[]
|
436
426
|
else
|
437
|
-
|
427
|
+
result = request(
|
428
|
+
:path => [generate_path(stack), 'operations'].join('/')
|
429
|
+
)
|
430
|
+
events = result.get(:body, :value).map do |event|
|
431
|
+
Stack::Event.new(
|
432
|
+
stack,
|
433
|
+
:id => event[:operationId],
|
434
|
+
:resource_id => event.get(:properties, :targetResource, :id),
|
435
|
+
:resource_name => event.get(:properties, :targetResource, :resourceName),
|
436
|
+
:resource_logical_id => event.get(:properties, :targetResource, :resourceName),
|
437
|
+
:resource_state => status_to_state(event.get(:properties, :provisioningState)),
|
438
|
+
:resource_status => event.get(:properties, :provisioningState),
|
439
|
+
:resource_status_reason => event.get(:properties, :statusCode),
|
440
|
+
:time => Time.parse(event.get(:properties, :timestamp))
|
441
|
+
).valid_state
|
442
|
+
end
|
443
|
+
if(evt_id)
|
444
|
+
idx = events.index{|d| e.id == evt_id}
|
445
|
+
idx = idx ? idx + 1 : 0
|
446
|
+
events.slice(idx, events.size)
|
447
|
+
else
|
448
|
+
events
|
449
|
+
end
|
438
450
|
end
|
439
451
|
end
|
440
452
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miasma-azure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: miasma
|