-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathNSX Security Tag.cat.rb
More file actions
76 lines (64 loc) · 1.49 KB
/
NSX Security Tag.cat.rb
File metadata and controls
76 lines (64 loc) · 1.49 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
72
73
74
75
76
name 'NSX Security Tag'
short_description " \n
An NSX Security Tag."
long_description " \n
Create and manage an NSX Security Tag (experimental)."
type 'application'
rs_ca_ver 20161221
import 'sys_log'
import 'plugins/nsx'
###
# User Inputs
###
parameter 'nsx_security_tag_name' do
label 'Name'
description 'A name for the security tag.'
category 'NSX Security Tag'
type 'string'
min_length 1
default "nsx-plugin-st-"
end
resource 'nsx_security_tag', type: 'nsx.security_tag' do
name $nsx_security_tag_name
description 'My security tag description.'
end
###
# Outputs
###
output "list_st" do
label "st count"
end
###
# Operations
###
operation 'list_sectags' do
definition 'list_sts'
output_mappings do{
$list_st => $count
}end
end
###
# Definitions
###
define list_sts() return $count do
call sys_log.set_task_target(@@deployment)
call sys_log.summary("List")
call start_debugging()
@sgs = nsx.security_tag.list()
call stop_debugging()
call sys_log.detail(to_object(@sgs))
$count = to_s(size(@sgs))
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