stackmate 0.1.2 → 0.2.0
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.
- data/README.md +1 -0
- data/bin/stackmate.rb +9 -5
- data/lib/stackmate/intrinsic_functions.rb +3 -3
- data/lib/stackmate/metadata.rb +44 -0
- data/lib/stackmate/participants/cloudstack.rb +51 -10
- data/lib/stackmate/participants/cloudstack_affinitygroup.rb +4 -1
- data/lib/stackmate/participants/cloudstack_autoscalepolicy.rb +4 -1
- data/lib/stackmate/participants/cloudstack_autoscalevmgroup.rb +4 -1
- data/lib/stackmate/participants/cloudstack_autoscalevmprofile.rb +4 -1
- data/lib/stackmate/participants/cloudstack_condition.rb +4 -1
- data/lib/stackmate/participants/cloudstack_egressfirewallrule.rb +4 -1
- data/lib/stackmate/participants/cloudstack_firewallrule.rb +4 -1
- data/lib/stackmate/participants/cloudstack_globalloadbalancerrule.rb +4 -1
- data/lib/stackmate/participants/cloudstack_instancegroup.rb +4 -1
- data/lib/stackmate/participants/cloudstack_ipaddress.rb +4 -1
- data/lib/stackmate/participants/cloudstack_ipforwardingrule.rb +4 -1
- data/lib/stackmate/participants/cloudstack_iptonic.rb +4 -1
- data/lib/stackmate/participants/cloudstack_iso.rb +4 -1
- data/lib/stackmate/participants/cloudstack_lbhealthcheckpolicy.rb +4 -1
- data/lib/stackmate/participants/cloudstack_lbstickinesspolicy.rb +4 -1
- data/lib/stackmate/participants/cloudstack_loadbalancer.rb +4 -1
- data/lib/stackmate/participants/cloudstack_loadbalancerrule.rb +4 -1
- data/lib/stackmate/participants/cloudstack_network.rb +4 -1
- data/lib/stackmate/participants/cloudstack_networkacl.rb +4 -1
- data/lib/stackmate/participants/cloudstack_networkacllist.rb +4 -1
- data/lib/stackmate/participants/cloudstack_nictovirtualmachine.rb +5 -2
- data/lib/stackmate/participants/cloudstack_portforwardingrule.rb +4 -1
- data/lib/stackmate/participants/cloudstack_project.rb +4 -1
- data/lib/stackmate/participants/cloudstack_remoteaccessvpn.rb +4 -1
- data/lib/stackmate/participants/cloudstack_securitygroup.rb +4 -1
- data/lib/stackmate/participants/cloudstack_securitygroupegress.rb +4 -1
- data/lib/stackmate/participants/cloudstack_securitygroupingress.rb +4 -1
- data/lib/stackmate/participants/cloudstack_snapshot.rb +4 -1
- data/lib/stackmate/participants/cloudstack_snapshotpolicy.rb +4 -1
- data/lib/stackmate/participants/cloudstack_sshkeypair.rb +4 -1
- data/lib/stackmate/participants/cloudstack_staticnat.rb +4 -1
- data/lib/stackmate/participants/cloudstack_staticroute.rb +4 -1
- data/lib/stackmate/participants/cloudstack_tags.rb +4 -1
- data/lib/stackmate/participants/cloudstack_template.rb +4 -1
- data/lib/stackmate/participants/cloudstack_togloballoadbalancerrule.rb +4 -1
- data/lib/stackmate/participants/cloudstack_toloadbalancerrule.rb +4 -1
- data/lib/stackmate/participants/cloudstack_virtualmachine.rb +257 -281
- data/lib/stackmate/participants/cloudstack_virtualmachineops.rb +5 -2
- data/lib/stackmate/participants/cloudstack_vmsnapshot.rb +4 -1
- data/lib/stackmate/participants/cloudstack_volume.rb +4 -1
- data/lib/stackmate/participants/cloudstack_volumeops.rb +86 -90
- data/lib/stackmate/participants/cloudstack_vpc.rb +4 -1
- data/lib/stackmate/participants/cloudstack_vpnconnection.rb +4 -1
- data/lib/stackmate/participants/cloudstack_vpncustomergateway.rb +4 -1
- data/lib/stackmate/participants/cloudstack_vpngateway.rb +4 -1
- data/lib/stackmate/participants/cloudstack_vpnuser.rb +4 -1
- data/lib/stackmate/participants/common.rb +4 -2
- data/lib/stackmate/resolver.rb +28 -1
- data/lib/stackmate/stack_executor.rb +9 -5
- data/lib/stackmate/stack_server.rb +60 -0
- data/lib/stackmate/stackpi.rb +2 -7
- data/lib/stackmate/version.rb +1 -1
- data/lib/stackmate/waitcondition_server.rb +4 -6
- metadata +4 -2
@@ -19,6 +19,7 @@ module StackMate
|
|
19
19
|
p args
|
20
20
|
result_obj = make_async_request('startVirtualMachine',args)
|
21
21
|
resource_obj = result_obj['VirtualMachine'.downcase]
|
22
|
+
|
22
23
|
#doing it this way since it is easier to change later, rather than cloning whole object
|
23
24
|
resource_obj.each_key do |k|
|
24
25
|
val = resource_obj[k]
|
@@ -28,6 +29,7 @@ module StackMate
|
|
28
29
|
workitem[@name][k] = val
|
29
30
|
end
|
30
31
|
set_tags(@props['tags'],workitem[@name]['physical_id'],"UserVM") if @props.has_key?('tags')
|
32
|
+
set_metadata if workitem['Resources'][@name].has_key?('Metadata')
|
31
33
|
workitem['ResolvedNames'][@name] = name_cs
|
32
34
|
workitem['IdMap'][workitem[@name]['physical_id']] = @name
|
33
35
|
|
@@ -48,10 +50,11 @@ module StackMate
|
|
48
50
|
if(!physical_id.nil?)
|
49
51
|
args = {'id' => physical_id
|
50
52
|
}
|
51
|
-
result_obj = make_async_request('
|
53
|
+
result_obj = make_async_request('stopVirtualMachineOps',args)
|
52
54
|
if (!(result_obj['error'] == true))
|
53
55
|
logger.info("Successfully deleted resource #{@name}")
|
54
56
|
else
|
57
|
+
workitem[@name]['delete_error'] = true
|
55
58
|
logger.info("CloudStack error while deleting resource #{@name}")
|
56
59
|
end
|
57
60
|
else
|
@@ -92,4 +95,4 @@ module StackMate
|
|
92
95
|
end
|
93
96
|
end
|
94
97
|
end
|
95
|
-
|
98
|
+
|
@@ -21,6 +21,7 @@ module StackMate
|
|
21
21
|
p args
|
22
22
|
result_obj = make_async_request('createVMSnapshot',args)
|
23
23
|
resource_obj = result_obj['VMSnapshot'.downcase]
|
24
|
+
|
24
25
|
#doing it this way since it is easier to change later, rather than cloning whole object
|
25
26
|
resource_obj.each_key do |k|
|
26
27
|
val = resource_obj[k]
|
@@ -30,6 +31,7 @@ module StackMate
|
|
30
31
|
workitem[@name][k] = val
|
31
32
|
end
|
32
33
|
set_tags(@props['tags'],workitem[@name]['physical_id'],"VMSnapshot") if @props.has_key?('tags')
|
34
|
+
set_metadata if workitem['Resources'][@name].has_key?('Metadata')
|
33
35
|
workitem['ResolvedNames'][@name] = name_cs
|
34
36
|
workitem['IdMap'][workitem[@name]['physical_id']] = @name
|
35
37
|
|
@@ -54,6 +56,7 @@ module StackMate
|
|
54
56
|
if (!(result_obj['error'] == true))
|
55
57
|
logger.info("Successfully deleted resource #{@name}")
|
56
58
|
else
|
59
|
+
workitem[@name]['delete_error'] = true
|
57
60
|
logger.info("CloudStack error while deleting resource #{@name}")
|
58
61
|
end
|
59
62
|
else
|
@@ -110,4 +113,4 @@ module StackMate
|
|
110
113
|
end
|
111
114
|
end
|
112
115
|
end
|
113
|
-
|
116
|
+
|
@@ -28,6 +28,7 @@ module StackMate
|
|
28
28
|
p args
|
29
29
|
result_obj = make_async_request('createVolume',args)
|
30
30
|
resource_obj = result_obj['Volume'.downcase]
|
31
|
+
|
31
32
|
#doing it this way since it is easier to change later, rather than cloning whole object
|
32
33
|
resource_obj.each_key do |k|
|
33
34
|
val = resource_obj[k]
|
@@ -37,6 +38,7 @@ module StackMate
|
|
37
38
|
workitem[@name][k] = val
|
38
39
|
end
|
39
40
|
set_tags(@props['tags'],workitem[@name]['physical_id'],"Volume") if @props.has_key?('tags')
|
41
|
+
set_metadata if workitem['Resources'][@name].has_key?('Metadata')
|
40
42
|
workitem['ResolvedNames'][@name] = name_cs
|
41
43
|
workitem['IdMap'][workitem[@name]['physical_id']] = @name
|
42
44
|
|
@@ -61,6 +63,7 @@ module StackMate
|
|
61
63
|
if (!(result_obj['error'] == true))
|
62
64
|
logger.info("Successfully deleted resource #{@name}")
|
63
65
|
else
|
66
|
+
workitem[@name]['delete_error'] = true
|
64
67
|
logger.info("CloudStack error while deleting resource #{@name}")
|
65
68
|
end
|
66
69
|
else
|
@@ -173,4 +176,4 @@ module StackMate
|
|
173
176
|
end
|
174
177
|
end
|
175
178
|
end
|
176
|
-
|
179
|
+
|
@@ -6,106 +6,102 @@ module StackMate
|
|
6
6
|
include Logging
|
7
7
|
include Intrinsic
|
8
8
|
include Resolver
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
9
|
+
def create
|
10
|
+
logger.debug("Creating resource #{@name}")
|
11
|
+
workitem[@name] = {}
|
12
|
+
name_cs = workitem['StackName'] + '-' + @name
|
13
|
+
args={}
|
14
|
+
begin
|
15
|
+
args['id'] = get_id
|
16
|
+
args['virtualmachineid'] = get_virtualmachineid
|
17
|
+
args['deviceid'] = get_deviceid if @props.has_key?('deviceid')
|
18
|
+
|
19
|
+
logger.info("Creating resource #{@name} with following arguments")
|
20
|
+
p args
|
21
|
+
result_obj = make_async_request('attachVolume',args)
|
22
|
+
resource_obj = result_obj['Volume'.downcase]
|
23
|
+
|
24
|
+
#doing it this way since it is easier to change later, rather than cloning whole object
|
25
|
+
resource_obj.each_key do |k|
|
26
|
+
val = resource_obj[k]
|
27
|
+
if('id'.eql?(k))
|
28
|
+
k = 'physical_id'
|
29
|
+
end
|
30
|
+
workitem[@name][k] = val
|
29
31
|
end
|
30
|
-
workitem[@name][
|
32
|
+
set_tags(@props['tags'],workitem[@name]['physical_id'],"Volume") if @props.has_key?('tags')
|
33
|
+
set_metadata if workitem['Resources'][@name].has_key?('Metadata')
|
34
|
+
workitem['ResolvedNames'][@name] = name_cs
|
35
|
+
workitem['IdMap'][workitem[@name]['physical_id']] = @name
|
36
|
+
|
37
|
+
rescue NoMethodError => nme
|
38
|
+
logger.error("Create request failed for resource . Cleaning up the stack")
|
39
|
+
raise nme
|
40
|
+
rescue Exception => e
|
41
|
+
logger.error(e.message)
|
42
|
+
raise e
|
31
43
|
end
|
32
|
-
|
33
|
-
workitem['ResolvedNames'][@name] = name_cs
|
34
|
-
workitem['IdMap'][workitem[@name]['physical_id']] = @name
|
35
|
-
|
36
|
-
rescue NoMethodError => nme
|
37
|
-
logger.error("Create request failed for resource #{@name}. Cleaning up the stack")
|
38
|
-
raise nme
|
39
|
-
|
40
|
-
rescue Exception => e
|
41
|
-
logger.error(e.message)
|
42
|
-
raise e
|
44
|
+
|
43
45
|
end
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
begin
|
52
|
-
physical_id = workitem[@name]['physical_id'] if !workitem[@name].nil?
|
53
|
-
if(!physical_id.nil?)
|
54
|
-
args = {'id' => physical_id
|
46
|
+
|
47
|
+
def delete
|
48
|
+
logger.debug("Deleting resource #{@name}")
|
49
|
+
begin
|
50
|
+
physical_id = workitem[@name]['physical_id'] if !workitem[@name].nil?
|
51
|
+
if(!physical_id.nil?)
|
52
|
+
args = {'id' => physical_id
|
55
53
|
}
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
result_obj = make_async_request('detachVolumeOps',args)
|
55
|
+
if (!(result_obj['error'] == true))
|
56
|
+
logger.info("Successfully deleted resource #{@name}")
|
57
|
+
else
|
58
|
+
workitem[@name]['delete_error'] = true
|
59
|
+
logger.info("CloudStack error while deleting resource #{@name}")
|
60
|
+
end
|
59
61
|
else
|
60
|
-
logger.info("
|
62
|
+
logger.info("Resource not created in CloudStack. Skipping delete...")
|
61
63
|
end
|
62
|
-
|
63
|
-
logger.
|
64
|
+
rescue Exception => e
|
65
|
+
logger.error("Unable to delete resorce #{@name}")
|
64
66
|
end
|
65
|
-
rescue Exception => e
|
66
|
-
logger.error("Unable to delete resorce #{@name}")
|
67
67
|
end
|
68
|
-
end
|
69
|
-
|
70
|
-
def on_workitem
|
71
|
-
@name = workitem.participant_name
|
72
|
-
@props = workitem['Resources'][@name]['Properties']
|
73
|
-
@props.downcase_key
|
74
|
-
@resolved_names = workitem['ResolvedNames']
|
75
|
-
if workitem['params']['operation'] == 'create'
|
76
|
-
create
|
77
|
-
else
|
78
|
-
delete
|
79
|
-
end
|
80
|
-
reply
|
81
|
-
end
|
82
|
-
|
83
68
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
if resolved_virtualmachineid.nil? || !validate_param(resolved_virtualmachineid,"uuid")
|
96
|
-
raise "Missing mandatory parameter virtualmachineid for resource #{@name}"
|
69
|
+
def on_workitem
|
70
|
+
@name = workitem.participant_name
|
71
|
+
@props = workitem['Resources'][@name]['Properties']
|
72
|
+
@props.downcase_key
|
73
|
+
@resolved_names = workitem['ResolvedNames']
|
74
|
+
if workitem['params']['operation'] == 'create'
|
75
|
+
create
|
76
|
+
else
|
77
|
+
delete
|
78
|
+
end
|
79
|
+
reply
|
97
80
|
end
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
81
|
+
|
82
|
+
def get_id
|
83
|
+
resolved_id = get_resolved(@props["id"],workitem)
|
84
|
+
if resolved_id.nil? || !validate_param(resolved_id,"uuid")
|
85
|
+
raise "Missing mandatory parameter id for resource #{@name}"
|
86
|
+
end
|
87
|
+
resolved_id
|
88
|
+
end
|
89
|
+
|
90
|
+
def get_virtualmachineid
|
91
|
+
resolved_virtualmachineid = get_resolved(@props["virtualmachineid"],workitem)
|
92
|
+
if resolved_virtualmachineid.nil? || !validate_param(resolved_virtualmachineid,"uuid")
|
93
|
+
raise "Missing mandatory parameter virtualmachineid for resource #{@name}"
|
94
|
+
end
|
95
|
+
resolved_virtualmachineid
|
96
|
+
end
|
97
|
+
|
98
|
+
def get_deviceid
|
99
|
+
resolved_deviceid = get_resolved(@props['deviceid'],workitem)
|
100
|
+
if resolved_deviceid.nil? || !validate_param(resolved_deviceid,"long")
|
101
|
+
raise "Malformed optional parameter deviceid for resource #{@name}"
|
102
|
+
end
|
103
|
+
resolved_deviceid
|
106
104
|
end
|
107
|
-
resolved_deviceid
|
108
|
-
end
|
109
|
-
|
110
105
|
end
|
111
106
|
end
|
107
|
+
|
@@ -26,6 +26,7 @@ module StackMate
|
|
26
26
|
p args
|
27
27
|
result_obj = make_async_request('createVPC',args)
|
28
28
|
resource_obj = result_obj['VPC'.downcase]
|
29
|
+
|
29
30
|
#doing it this way since it is easier to change later, rather than cloning whole object
|
30
31
|
resource_obj.each_key do |k|
|
31
32
|
val = resource_obj[k]
|
@@ -35,6 +36,7 @@ module StackMate
|
|
35
36
|
workitem[@name][k] = val
|
36
37
|
end
|
37
38
|
set_tags(@props['tags'],workitem[@name]['physical_id'],"VPC") if @props.has_key?('tags')
|
39
|
+
set_metadata if workitem['Resources'][@name].has_key?('Metadata')
|
38
40
|
workitem['ResolvedNames'][@name] = name_cs
|
39
41
|
workitem['IdMap'][workitem[@name]['physical_id']] = @name
|
40
42
|
|
@@ -59,6 +61,7 @@ module StackMate
|
|
59
61
|
if (!(result_obj['error'] == true))
|
60
62
|
logger.info("Successfully deleted resource #{@name}")
|
61
63
|
else
|
64
|
+
workitem[@name]['delete_error'] = true
|
62
65
|
logger.info("CloudStack error while deleting resource #{@name}")
|
63
66
|
end
|
64
67
|
else
|
@@ -155,4 +158,4 @@ module StackMate
|
|
155
158
|
end
|
156
159
|
end
|
157
160
|
end
|
158
|
-
|
161
|
+
|
@@ -19,6 +19,7 @@ module StackMate
|
|
19
19
|
p args
|
20
20
|
result_obj = make_async_request('createVpnConnection',args)
|
21
21
|
resource_obj = result_obj['VpnConnection'.downcase]
|
22
|
+
|
22
23
|
#doing it this way since it is easier to change later, rather than cloning whole object
|
23
24
|
resource_obj.each_key do |k|
|
24
25
|
val = resource_obj[k]
|
@@ -28,6 +29,7 @@ module StackMate
|
|
28
29
|
workitem[@name][k] = val
|
29
30
|
end
|
30
31
|
set_tags(@props['tags'],workitem[@name]['physical_id'],"VpnConnection") if @props.has_key?('tags')
|
32
|
+
set_metadata if workitem['Resources'][@name].has_key?('Metadata')
|
31
33
|
workitem['ResolvedNames'][@name] = name_cs
|
32
34
|
workitem['IdMap'][workitem[@name]['physical_id']] = @name
|
33
35
|
|
@@ -52,6 +54,7 @@ module StackMate
|
|
52
54
|
if (!(result_obj['error'] == true))
|
53
55
|
logger.info("Successfully deleted resource #{@name}")
|
54
56
|
else
|
57
|
+
workitem[@name]['delete_error'] = true
|
55
58
|
logger.info("CloudStack error while deleting resource #{@name}")
|
56
59
|
end
|
57
60
|
else
|
@@ -92,4 +95,4 @@ module StackMate
|
|
92
95
|
end
|
93
96
|
end
|
94
97
|
end
|
95
|
-
|
98
|
+
|
@@ -28,6 +28,7 @@ module StackMate
|
|
28
28
|
p args
|
29
29
|
result_obj = make_async_request('createVpnCustomerGateway',args)
|
30
30
|
resource_obj = result_obj['VpnCustomerGateway'.downcase]
|
31
|
+
|
31
32
|
#doing it this way since it is easier to change later, rather than cloning whole object
|
32
33
|
resource_obj.each_key do |k|
|
33
34
|
val = resource_obj[k]
|
@@ -37,6 +38,7 @@ module StackMate
|
|
37
38
|
workitem[@name][k] = val
|
38
39
|
end
|
39
40
|
set_tags(@props['tags'],workitem[@name]['physical_id'],"VpnCustomerGateway") if @props.has_key?('tags')
|
41
|
+
set_metadata if workitem['Resources'][@name].has_key?('Metadata')
|
40
42
|
workitem['ResolvedNames'][@name] = name_cs
|
41
43
|
workitem['IdMap'][workitem[@name]['physical_id']] = @name
|
42
44
|
|
@@ -61,6 +63,7 @@ module StackMate
|
|
61
63
|
if (!(result_obj['error'] == true))
|
62
64
|
logger.info("Successfully deleted resource #{@name}")
|
63
65
|
else
|
66
|
+
workitem[@name]['delete_error'] = true
|
64
67
|
logger.info("CloudStack error while deleting resource #{@name}")
|
65
68
|
end
|
66
69
|
else
|
@@ -173,4 +176,4 @@ module StackMate
|
|
173
176
|
end
|
174
177
|
end
|
175
178
|
end
|
176
|
-
|
179
|
+
|
@@ -18,6 +18,7 @@ module StackMate
|
|
18
18
|
p args
|
19
19
|
result_obj = make_async_request('createVpnGateway',args)
|
20
20
|
resource_obj = result_obj['VpnGateway'.downcase]
|
21
|
+
|
21
22
|
#doing it this way since it is easier to change later, rather than cloning whole object
|
22
23
|
resource_obj.each_key do |k|
|
23
24
|
val = resource_obj[k]
|
@@ -27,6 +28,7 @@ module StackMate
|
|
27
28
|
workitem[@name][k] = val
|
28
29
|
end
|
29
30
|
set_tags(@props['tags'],workitem[@name]['physical_id'],"VpnGateway") if @props.has_key?('tags')
|
31
|
+
set_metadata if workitem['Resources'][@name].has_key?('Metadata')
|
30
32
|
workitem['ResolvedNames'][@name] = name_cs
|
31
33
|
workitem['IdMap'][workitem[@name]['physical_id']] = @name
|
32
34
|
|
@@ -51,6 +53,7 @@ module StackMate
|
|
51
53
|
if (!(result_obj['error'] == true))
|
52
54
|
logger.info("Successfully deleted resource #{@name}")
|
53
55
|
else
|
56
|
+
workitem[@name]['delete_error'] = true
|
54
57
|
logger.info("CloudStack error while deleting resource #{@name}")
|
55
58
|
end
|
56
59
|
else
|
@@ -83,4 +86,4 @@ module StackMate
|
|
83
86
|
end
|
84
87
|
end
|
85
88
|
end
|
86
|
-
|
89
|
+
|
@@ -22,6 +22,7 @@ module StackMate
|
|
22
22
|
p args
|
23
23
|
result_obj = make_async_request('addVpnUser',args)
|
24
24
|
resource_obj = result_obj['VpnUser'.downcase]
|
25
|
+
|
25
26
|
#doing it this way since it is easier to change later, rather than cloning whole object
|
26
27
|
resource_obj.each_key do |k|
|
27
28
|
val = resource_obj[k]
|
@@ -31,6 +32,7 @@ module StackMate
|
|
31
32
|
workitem[@name][k] = val
|
32
33
|
end
|
33
34
|
set_tags(@props['tags'],workitem[@name]['physical_id'],"VpnUser") if @props.has_key?('tags')
|
35
|
+
set_metadata if workitem['Resources'][@name].has_key?('Metadata')
|
34
36
|
workitem['ResolvedNames'][@name] = name_cs
|
35
37
|
workitem['IdMap'][workitem[@name]['physical_id']] = @name
|
36
38
|
|
@@ -55,6 +57,7 @@ module StackMate
|
|
55
57
|
if (!(result_obj['error'] == true))
|
56
58
|
logger.info("Successfully deleted resource #{@name}")
|
57
59
|
else
|
60
|
+
workitem[@name]['delete_error'] = true
|
58
61
|
logger.info("CloudStack error while deleting resource #{@name}")
|
59
62
|
end
|
60
63
|
else
|
@@ -119,4 +122,4 @@ module StackMate
|
|
119
122
|
end
|
120
123
|
end
|
121
124
|
end
|
122
|
-
|
125
|
+
|
@@ -10,6 +10,7 @@ require 'time'
|
|
10
10
|
|
11
11
|
module StackMate
|
12
12
|
|
13
|
+
WAIT_COND_URL_BASE_DEFAULT = 'http://localhost:4567/'
|
13
14
|
|
14
15
|
# class ParamHandle < Ruote::Participant
|
15
16
|
# include Logging
|
@@ -25,7 +26,8 @@ module StackMate
|
|
25
26
|
def create
|
26
27
|
logger.debug "Entering #{participant_name} "
|
27
28
|
workitem[participant_name] = {}
|
28
|
-
|
29
|
+
wait_cond_base = ENV['WAIT_COND_URL_BASE']?ENV['WAIT_COND_URL_BASE']:'http://localhost:4567/'
|
30
|
+
presigned_url = wait_cond_base + '/waitcondition/' + workitem.fei.wfid + '/' + participant_name
|
29
31
|
workitem.fields['ResolvedNames'][participant_name] = presigned_url
|
30
32
|
logger.info "Your pre-signed URL is: #{presigned_url} "
|
31
33
|
logger.info "Try: \ncurl -X PUT --data 'foo' #{presigned_url}"
|
@@ -246,4 +248,4 @@ module StackMate
|
|
246
248
|
end
|
247
249
|
end
|
248
250
|
|
249
|
-
end
|
251
|
+
end
|