-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathip_test_cat.rb
More file actions
71 lines (61 loc) · 1.56 KB
/
ip_test_cat.rb
File metadata and controls
71 lines (61 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name 'Azure Ip Address - Test CAT'
rs_ca_ver 20161221
short_description "Azure Ip Address - Test CAT"
import "sys_log"
import "plugins/rs_azure_networking"
parameter "subscription_id" do
like $rs_azure_networking.subscription_id
end
output "ip1" do
label "New IP"
end
output "ip_id" do
label "IP Id"
end
permission "read_creds" do
actions "rs_cm.show_sensitive","rs_cm.index_sensitive"
resources "rs_cm.credentials"
end
resource "resource_group", type: "rs_cm.resource_group" do
name @@deployment.name
cloud "AzureRM Central US"
end
resource "ip", type: "rs_azure_networking.public_ip_address" do
name join(["my-ip-", last(split(@@deployment.href, "/"))])
resource_group @@deployment.name
location "Central US"
properties do {
"publicIPAllocationMethod" => "Static",
"publicIPAddressVersion" => "IPv4"
} end
sku do {
"name" => "Standard"
} end
end
operation "launch" do
description "Launch the application"
definition "launch_handler"
output_mappings do {
$ip1 => $ip,
$ip_id => @ip.id
} end
end
define launch_handler(@resource_group,@ip,$subscription_id) return @ip, $ip do
provision(@resource_group)
provision(@ip)
$props = @ip.properties
$ip = @ip.properties["ipAddress"]
end
define start_debugging() do
if $$debugging == false || logic_and($$debugging != false, $$debugging != true)
initiate_debug_report()
$$debugging = true
end
end
define stop_debugging() do
if $$debugging == true
$debug_report = complete_debug_report()
call sys_log.detail($debug_report)
$$debugging = false
end
end