Class: ComplianceJob

Inherits:
BsaSoapBase show all
Defined in:
lib/bl_soap/compliance_job.rb

Constant Summary

Constants inherited from BsaSoapBase

BsaSoapBase::CLI_SERVICE, BsaSoapBase::CLI_WSDL, BsaSoapBase::DEFAULT_AUTH_TYPE, BsaSoapBase::HTTP_READ_TIMEOUT, BsaSoapBase::LOGIN_SERVICE, BsaSoapBase::LOGIN_WSDL, BsaSoapBase::ROLE_SERVICE, BsaSoapBase::ROLE_WSDL

Instance Method Summary collapse

Methods inherited from BsaSoapBase

#execute_cli_with_attachments, #execute_cli_with_param_list, #get_all_servers, #get_cli_return_value, #initialize, #validate_cli_option_hash_string_values, #validate_cli_options_hash, #validate_cli_result, #validate_servers

Constructor Details

This class inherits a constructor from BsaSoapBase

Instance Method Details

#add_component_to_job_by_job_db_key(options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/bl_soap/compliance_job.rb', line 2

def add_component_to_job_by_job_db_key(options = {})
	validate_cli_options_hash([:compliance_key, :component_key], options)
	db_key_result = execute_cli_with_param_list(self.class, "addComponentToJobByJobDBKey",
		[
			options[:compliance_key],	# Handle to compliance Job
			options[:component_key]		# Handle to component to be added
		])
	db_key = get_cli_return_value(db_key_result)
rescue => exception
	raise "Exception executing #{self.class} function: #{exception.to_s}"
end

#add_named_server_to_job_by_job_db_key(options = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/bl_soap/compliance_job.rb', line 14

def add_named_server_to_job_by_job_db_key(options = {})
	validate_cli_options_hash([:db_key, :server_name], options)
	db_key_result = execute_cli_with_param_list(self.class, "addNamedServerToJobByJobDBKey",
		[
			options[:db_key],		# Handle to the Compliance Job
			options[:server_name]	# Name of the server to be added
		])
	db_key = get_cli_return_value(db_key_result)
rescue => exception
	raise "Exception executing #{self.class} function: #{exception.to_s}"
end

#create_component_based_compliance_job(options = {}) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/bl_soap/compliance_job.rb', line 26

def create_component_based_compliance_job(options = {})
	validate_cli_options_hash([:job_name, :group_id, :template_key, :server_name], options)
	db_key_result = execute_cli_with_param_list(self.class, "createComponentBasedComplianceJob",
		[
			options[:job_name],				# Name of the job to be created
			options[:group_id],				# Id of the parent job group for the compliance job
			options[:template_key],			# Handle to template describing the assets to be included in compliance
			options[:server_name],			# Target server for compliance job
			options[:component_index] || 0	# Index of component on target server (typically 0)
		])
	db_key = get_cli_return_value(db_key_result)
rescue => exception
	raise "Exception executing #{self.class} function: #{exception.to_s}"
end

#create_remediation_job_from_compliance_result_by_rule(options = {}) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/bl_soap/compliance_job.rb', line 41

def create_remediation_job_from_compliance_result_by_rule(options = {})
	validate_cli_options_hash(
		[:remediation_name, :job_group_name, :depot_group_name, :comp_job_key, :comp_job_run_id, :template_group_name, :template_name, :rule_grp_name, :rule_name, :target_component],
		options)
	db_key_result = execute_cli_with_param_list(self.class, "createRemediationJobFromComplianceResultByRule",
		[
			options[:remediation_name],							# Name of the package
			options[:job_group_name],							# Name of a group that should contain the new remediation job(s)
			options[:depot_group_name],							# Name of a group that should contain the new package(s)
			options[:comp_job_key],								# Handle to compliance job whose job run result you want to package
			options[:comp_job_run_id],							# ID of the compliance job run whose result you want to package
			options[:template_group_name],						# Group name of the template used in the compliance job run
			options[:template_name],							# Name of the template used in the compliance job run
			options[:rule_grp_name],							# Name of the template rule group used in the compliance job run
			options[:rule_name],								# Name of the template rule used in the compliance job run
			options[:target_component],							# Name of the target component
			options[:use_component_device_for_targets] || true,	# Use the device of a component as the target of the remediation (defualt = true) devices are targets
			options[:keep_unique_package_props] || true			# Indicates if the package should uniquely save each local property for the compliance rule packages that are used
		])
	db_key = get_cli_return_value(db_key_result)
rescue => exception
	raise "Exception executing #{self.class} function: #{exception.to_s}"
end

#create_remediation_job_from_compliance_result_by_server(options = {}) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bl_soap/compliance_job.rb', line 65

def create_remediation_job_from_compliance_result_by_server(options = {})
	validate_cli_options_hash(
		[:remediation_name, :job_group_name, :depot_group_name, :comp_job_key, :comp_job_run_id, :target_server, :template_group_name, :template_name, :target_component, :rule_grp_name, :rule_name],
		options)
	db_key_result = execute_cli_with_param_list(self.class, "createRemediationJobFromComplianceResultByServer",
		[
			options[:remediation_name],							# Name of the package
			options[:job_group_name],							# Name of a group that should contain the new remediation job(s)
			options[:depot_group_name],							# Name of a group that should contain the new package(s)
			options[:comp_job_key],								# Handle to compliance job whose job run result you want to package
			options[:comp_job_run_id],							# ID of the compliance job run whose result you want to package
			options[:target_server],							# Name of the target server
			options[:template_group_name],						# Group name of the template used in the compliance job run
			options[:template_name],							# Name of the template used in the compliance job run
			options[:target_component],							# Name of the target component
			options[:rule_grp_name],							# Name of the template rule group used in the compliance job run
			options[:rule_name],								# Name of the template rule used in the compliance job run
			options[:use_component_device_for_targets] || true,	# Use the device of a component as the target of the remediation (defualt = true) devices are targets
			options[:keep_unique_package_props] || true			# Indicates if the package should uniquely save each local property for the compliance rule packages that are used
		])
	db_key = get_cli_return_value(db_key_result)
rescue => exception
	raise "Exception executing #{self.class} function: #{exception.to_s}"
end

#create_template_fltered_compliance_job(options = {}) ⇒ Object



90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/bl_soap/compliance_job.rb', line 90

def create_template_fltered_compliance_job(options = {})
	validate_cli_options_hash([:job_name, :group_id, :template_key, :server_name], options)
	db_key_result = execute_cli_with_param_list(self.class, "createTemplateFilteredComplianceJob",
		[
			options[:job_name],		# Name of the job to be created
			options[:group_id],		# Id of the parent job group for the compliance job
			options[:template_key],	# Handle to the template describing the assets to be including in the compliance job
			options[:server_name]	# Target server for the compliance job
		])
	db_key = get_cli_return_value(db_key_result)
rescue => exception
	raise "Exception executing #{self.class} function: #{exception.to_s}"
end

#execute_job_and_wait(options = {}) ⇒ Object



104
105
106
107
108
109
110
111
112
113
# File 'lib/bl_soap/compliance_job.rb', line 104

def execute_job_and_wait(options = {})
	validate_cli_options_hash([:job_key], options)
	job_key_result = execute_cli_with_param_list(self.class, "executeJobAndWait",
		[
			options[:job_key]	# Handle to the compliance job to be executed
		])
	job_key = get_cli_return_value(job_key_result)
rescue => exception
	raise "Exception executing #{self.class} function: #{exception.to_s}"
end

#get_dbkey_by_group_and_name(options = {}) ⇒ Object



115
116
117
118
119
120
121
122
123
124
125
# File 'lib/bl_soap/compliance_job.rb', line 115

def get_dbkey_by_group_and_name(options = {})
	validate_cli_options_hash([:group_name, :job_name], options)
	db_key_result = execute_cli_with_param_list(self.class, "getDBKeyByGroupAndName",
		[
			options[:group_name],	# Fully qualified path to the job group containing the job
			options[:job_name]		# Name of the job
		])
	db_key = get_cli_return_value(db_key_result)
rescue => exception
	raise "Exception executing #{self.class} function: #{exception.to_s}"
end

#set_auto_remediation(options = {}) ⇒ Object



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/bl_soap/compliance_job.rb', line 127

def set_auto_remediation(options = {})
	validate_cli_options_hash([:job_key, :job_name, :depot_group, :job_group], options)
	db_key_result = execute_cli_with_param_list(self.class, "setAutoRemediation",
		[
			options[:job_key],									# Handle to compliance job
			options[:job_name],									# Name for auto-remediation job
			options[:depot_group],								# Name of the depot group to store files in
			options[:job_group],								# Name of the job group to store the remediation job in
			options[:is_auto_remediate] || true,				# Auto-remediation state for the job - true = set
			options[:use_component_device_for_targets] || true,	# Use the device of a component as the target of the remediation (defualt = true) devices are targets
			options[:keep_unique_package_props] || true			# Indicates if the package should uniquely save each local property for the compliance rule packages that are used
		])
	db_key = get_cli_return_value(db_key_result)
rescue => exception
	raise "Exception executing #{self.class} function: #{exception.to_s}"
end

#set_description(options = {}) ⇒ Object



144
145
146
147
148
149
150
151
152
153
154
# File 'lib/bl_soap/compliance_job.rb', line 144

def set_description(options = {})
	validate_cli_options_hash([:job_key, :desc], options)
	db_key_result = execute_cli_with_param_list(self.class, "setDescription",
		[
			options[:job_key],	# handle to compliance job
			options[:desc]		# description of job
		])
	db_key = get_cli_return_value(db_key_result)
rescue => exception
	raise "Exception executing #{self.class} function: #{exception.to_s}"
end