Class: PatchingJob

Inherits:
BsaSoapBase show all
Defined in:
lib/bl_soap/patching_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

#create_aix_patching_job_with_target_group(options = {}) ⇒ Object



101
102
103
104
105
# File 'lib/bl_soap/patching_job.rb', line 101

def create_aix_patching_job_with_target_group(options = {})
  db_key = self.internal_aix_execute("createAixPatchingJobWithTargetGroup", options)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#create_aix_patching_job_with_target_server(options = {}) ⇒ Object



107
108
109
110
111
# File 'lib/bl_soap/patching_job.rb', line 107

def create_aix_patching_job_with_target_server(options = {})
  db_key = self.internal_aix_execute("createAixPatchingJobWithTargetServer", options)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#create_download_job_for_missing_patches(options = {}) ⇒ Object



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

def create_download_job_for_missing_patches(options = {})
  validate_cli_options_hash([:pa_job_run_key, :job_name, :dep_job_group_name],options)
  db_key_result = execute_cli_with_param_list(self.class, "createDownloadJobForMissingPatches",
                                              [
                                                  options[:pa_job_run_key],   # Handle to the patching job run
                                                  options[:job_name],       # Name of the download job
                                                  options[:dep_job_group_name]  # Name of a group that should contain the download job
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#create_other_linux_patching_job_with_target_group(options = {}) ⇒ Object



126
127
128
129
130
# File 'lib/bl_soap/patching_job.rb', line 126

def create_other_linux_patching_job_with_target_group(options = {})
  db_key = self.internal_linux_execute("createOtherLinuxPatchingJobWithTargetGroup", options)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#create_other_linux_patching_job_with_target_server(options = {}) ⇒ Object



132
133
134
135
136
# File 'lib/bl_soap/patching_job.rb', line 132

def create_other_linux_patching_job_with_target_server(options = {})
  db_key = self.internal_linux_execute("createOtherLinuxPatchingJobWithTargetServer", options)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#create_redhat_patching_job_with_target_group(options = {}) ⇒ Object



138
139
140
141
142
# File 'lib/bl_soap/patching_job.rb', line 138

def create_redhat_patching_job_with_target_group(options = {})
  db_key = self.internal_redhat_execute("createRedhatPatchingJobWithTargetGroup", options)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#create_redhat_patching_job_with_target_server(options = {}) ⇒ Object



144
145
146
147
148
# File 'lib/bl_soap/patching_job.rb', line 144

def create_redhat_patching_job_with_target_server(options = {})
  db_key = self.internal_redhat_execute("createRedhatPatchingJobWithTargetServer", options)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#create_solaris_patching_job_with_target_group(options = {}) ⇒ Object



150
151
152
153
154
# File 'lib/bl_soap/patching_job.rb', line 150

def create_solaris_patching_job_with_target_group(options = {})
  db_key = self.internal_solaris_execute("createSolarisPatchingJobWithTargetGroup", options)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#create_solaris_patching_job_with_target_server(options = {}) ⇒ Object



156
157
158
159
160
# File 'lib/bl_soap/patching_job.rb', line 156

def create_solaris_patching_job_with_target_server(options = {})
  db_key = self.internal_solaris_execute("createSolarisPatchingJobWithTargetServer", options)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#create_windows_patching_job_with_target_group(options = {}) ⇒ Object



162
163
164
165
166
# File 'lib/bl_soap/patching_job.rb', line 162

def create_windows_patching_job_with_target_group(options = {})
  db_key = self.internal_windows_execute("createWindowsPatchingJobWithTargetGroup", options)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#create_windows_patching_job_with_target_server(options = {}) ⇒ Object



168
169
170
171
172
# File 'lib/bl_soap/patching_job.rb', line 168

def create_windows_patching_job_with_target_server(options = {})
  db_key = self.internal_windows_execute("createWindowsPatchingJobWithTargetServer", options)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#delete_job_by_group_and_name(options = {}) ⇒ Object



174
175
176
177
178
179
180
181
182
183
184
# File 'lib/bl_soap/patching_job.rb', line 174

def delete_job_by_group_and_name(options = {})
  validate_cli_options_hash([:parent_group, :job_name],options)
  void_result = execute_cli_with_param_list(self.class, "deleteJobByGroupAndName",
                                            [
                                                options[:parent_group], # Fully qualifed path to the job group containing the patching job
                                                options[:job_name]    # Name of the patching job
                                            ])
  void_value = get_cli_return_value(void_result)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#execute_job_and_wait(options = {}) ⇒ Object



186
187
188
189
190
191
192
193
194
195
# File 'lib/bl_soap/patching_job.rb', line 186

def execute_job_and_wait(options = {})
  validate_cli_options_hash([:job_key],options)
  job_run_key_result = execute_cli_with_param_list(self.class, "executeJobAndWait",
                                                   [
                                                       options[:job_key]  # Handle to the patching job to execute
                                                   ])
  job_run_key = get_cli_return_value(job_run_key_result)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#get_dbkey_by_group_and_name(options = {}) ⇒ Object



197
198
199
200
201
202
203
204
205
206
207
# File 'lib/bl_soap/patching_job.rb', line 197

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 the 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 "#{self.class} Exception: #{exception.to_s}"
end

#internal_aix_execute(cmd, options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/bl_soap/patching_job.rb', line 2

def internal_aix_execute(cmd, options = {})
  validate_cli_options_hash([:job_name, :group_name, :target, :catalog_name, :include_file, :exclude_file],options)
  b_key_result = execute_cli_with_param_list(self.class, cmd,
                                             [
                                                 options[:job_name],        # Name of job
                                                 options[:group_name],      # Parent group of the job
                                                 options[:target],        # Name of target (server, group, or smart group)
                                                 options[:catalog_name],      # Catalog name
                                                 options[:include_file],      # Include file path
                                                 options[:exclude_file],      # Exclude file path
                                                 options[:analysis_option] || 1,  # Analysis options:
                                                 #   1 - Use global settings (DEFAULT)
                                                 #   2 - Stop analysis if any applied fileset found
                                                 #   3 - Continue analysis even if applied fileset found
                                                 options[:analysis_mode] || 2 # Analysis mode:
                                             #   1 - Report on all missing filesets, the ones that are
                                             #       not install on the target
                                             #   2 - report only updates for the installed fileset on
                                             #       the target
                                             ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} #{cmd} Exception: #{exception.to_s}"
end

#internal_linux_execute(cmd, options = {}) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/bl_soap/patching_job.rb', line 27

def internal_linux_execute(cmd, options = {})
  validate_cli_options_hash([:job_name, :group_name, :target, :catalog_name, :include_file, :exclude_file],options)
  db_key_result = execute_cli_with_param_list(self.class, cmd,
                                              [
                                                  options[:job_name],         # Name of job
                                                  options[:group_name],       # Parent group of the job
                                                  options[:target],         # Name of target (server, group, or smart group)
                                                  options[:catalog_name],       # Catalog name
                                                  options[:include_file],       # Include file path
                                                  options[:exclude_file],       # Exclude file path
                                                  options[:set_install_mode] || true, # Install mode: true to set install mode, false otherwise
                                                  options[:set_exact_arch] || false # Architecture: true to use exact architecture match, false otherwise
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} #{cmd} Exception: #{exception.to_s}"
end

#internal_redhat_execute(cmd, options = {}) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/bl_soap/patching_job.rb', line 45

def internal_redhat_execute(cmd, options = {})
  validate_cli_options_hash([:job_name, :group_name, :target],options)
  db_key_result = execute_cli_with_param_list(self.class, cmd,
                                              [
                                                  options[:job_name],         # Name of job
                                                  options[:group_name],       # Parent group of the job
                                                  options[:target],         # Name of target (server, group, or smart group)
                                                  options[:catalog_name] || "",   # Catalog name
                                                  options[:include_file] || "",   # Include file path
                                                  options[:exclude_file] || "",   # Exclude file path
                                                  options[:set_install_mode] || true  # Install mode: true to set install mode, false otherwise
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} #{cmd} Exception: #{exception.to_s}"
end

#internal_solaris_execute(cmd, options = {}) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/bl_soap/patching_job.rb', line 62

def internal_solaris_execute(cmd, options = {})
  validate_cli_options_hash([:job_name, :group_name, :target, :catalog_name, :include_file, :exclude_file],options)
  db_key_result = execute_cli_with_param_list(self.class, cmd,
                                              [
                                                  options[:job_name],           # Name of job
                                                  options[:group_name],         # Parent group of the job
                                                  options[:target],           # Name of target (server, group, or smart group)
                                                  options[:catalog_name],         # Catalog name
                                                  options[:include_file],         # Include file path
                                                  options[:exclude_file],         # Exclude file path
                                                  options[:recommended_only] || true,   # Analyze recommended patches only, false otherwise
                                                  options[:security_only] || false,   # Analyze security patches only, false otherwise
                                                  options[:without_dependencies] || false # Analyze without dependencies, false otherwise
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} #{cmd} Exception: #{exception.to_s}"
end

#internal_windows_execute(cmd, options = {}) ⇒ Object



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/bl_soap/patching_job.rb', line 81

def internal_windows_execute(cmd, options = {})
  validate_cli_options_hash([:job_name, :group_name, :target, :catalog_name, :include_file, :exclude_file],options)
  db_key_result = execute_cli_with_param_list(self.class, cmd,
                                              [
                                                  options[:job_name],                 # Name of job
                                                  options[:group_name],               # Parent group of the job
                                                  options[:target],                 # Name of target (server, group, or smart group)
                                                  options[:catalog_name],               # Catalog name
                                                  options[:include_file],               # Include file path
                                                  options[:exclude_file],               # Exclude file path
                                                  options[:analyze_security_tools] || true,     # Analyze security tools, false otherwise
                                                  options[:analyze_security_patches] || false,    # Analyze security patches, false otherwise
                                                  options[:analyze_non_security_patches] || false,  # Analyze non-security patches, false otherwise
                                                  options[:filter_service_packs] || false       # Filter services packs, false otherwise
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} #{cmd} Exception: #{exception.to_s}"
end

#set_description(options = {}) ⇒ Object



209
210
211
212
213
214
215
216
217
218
219
# File 'lib/bl_soap/patching_job.rb', line 209

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],  # the handle to the patching job
                                                  options[:job_name]  # the description for the job
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#set_remediation_options(options = {}) ⇒ Object



221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/bl_soap/patching_job.rb', line 221

def set_remediation_options(options = {})
  validate_cli_options_hash([:patching_job_key, :pck_prefix, :depot_group_name, :depot_job_group_name],options)
  db_key_result = execute_cli_with_param_list(self.class, "setRemediationOptions",
                                              [
                                                  options[:patching_job_key],   # handle to the patching job
                                                  options[:pck_prefix],     # prefix for naming the new batch job/deploy job/package(s)
                                                  options[:depot_group_name],   # name of group that should contain the new package(s)
                                                  options[:depot_job_group_name]  # name of group that should contain the generated deploy job(s)
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#set_remediation_with_deploy_options(options = {}) ⇒ Object



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/bl_soap/patching_job.rb', line 235

def set_remediation_with_deploy_options(options = {})
  validate_cli_options_hash([:patching_job_key, :pck_prefix, :depot_group_name, :depot_job_group_name, :deploy_job_key],options)
  db_key_result = execute_cli_with_param_list(self.class, "setRemediationWithDeployOptions",
                                              [
                                                  options[:patching_job_key],   # handle to the patching job
                                                  options[:pck_prefix],     # prefix for naming the new batch job/deploy job/package(s)
                                                  options[:depot_group_name],   # name of group that should contain the new package(s)
                                                  options[:depot_job_group_name], # name of group that should contain the generated deploy job(s)
                                                  options[:deploy_job_key]    # handle to the deploy job run whose options you want to use with
                                              #  generated deploy job(s)
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end