Class: PatchRemediationJob

Inherits:
BsaSoapBase show all
Defined in:
lib/bl_soap/patch_remediation_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_remediation_job(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
# File 'lib/bl_soap/patch_remediation_job.rb', line 2

def create_remediation_job(options)
  validate_cli_options_hash(
      [:remediation_name, :job_group_name, :pa_job_run_key, :pck_prefix, :depot_group_name, :dep_job_group_name],
      options)

  puts "Content from bsa_patch_utils "
  options.each_pair {|key,value| puts  "#{key} = #{value}" }

  db_key_result = execute_cli_with_param_list(self.class, "createRemediationJob",
                                              [
                                                  options[:remediation_name],   # Name of the job
                                                  options[:job_group_name],   # Name of the group that should contain the new remediation job(s)
                                                  options[:pa_job_run_key],   # Handle to the job run whose result you want to use for remediation
                                                  options[:pck_prefix],     # Prefix for naming the new Batch Job/Deploy Job/Package(s)
                                                  options[:depot_group_name],   # Name of a group that should contain the new Package(s)
                                                  options[:dep_job_group_name]  # Name of a 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

#create_remediation_job_for_a_target(options) ⇒ Object



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

def create_remediation_job_for_a_target(options)
  validate_cli_options_hash(
      [:remediation_name, :job_group_name, :pa_job_run_key, :server_name, :pck_prefix, :depot_group_name, :dep_job_group_name],
      options)
  db_key_result = execute_cli_with_param_list(self.class, "createRemediationJobForATarget",
                                              [
                                                  options[:remediation_name],   # Name of the job
                                                  options[:job_group_name],   # Name of the group that should contain the new remediation job(s)
                                                  options[:pa_job_run_key],   # Handle to the job run whose result you want to use for remedation
                                                  options[:server_name],      # Server where you want to run this job, should be one of the server where analysis was run
                                                  options[:pck_prefix],     # Prefix for naming the new Batch Job/Deploy Job/Package(s)
                                                  options[:depot_group_name],   # Name of a group that should contain the new Package(s)
                                                  options[:dep_job_group_name]  # Name of a 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

#create_remediation_job_with_deploy_opts(options) ⇒ Object



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

def create_remediation_job_with_deploy_opts(options)
  validate_cli_options_hash(
      [:remediation_name, :job_group_name, :pa_job_run_key, :pck_prefix, :depot_group_name, :dep_job_group_name, :deploy_job_key],
      options)
  db_key_result = execute_cli_with_param_list(self.class, "createRemediationJobWithDeployOpts",
                                              [
                                                  options[:remediation_name],   # Name of the job
                                                  options[:job_group_name],   # Name of the group that should contain the new remediation job(s)
                                                  options[:pa_job_run_key],   # Hand to the patching job run whose results you want to use for remediation
                                                  options[:pck_prefix],     # Prefix for naming the new Batch Job/Deploy Job/Package(s)
                                                  options[:depot_group_name],   # Name of a group that should contain the new Package(s)
                                                  options[:dep_job_group_name], # Name of a group that should contain the new generated Deploy Job(s)
                                                  options[:deploy_job_key]    # Handle to the Deploy Job run whose options you want to use generated Deploy Job(s)
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#create_remediation_job_with_deploy_opts_for_a_target(options) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/bl_soap/patch_remediation_job.rb', line 64

def create_remediation_job_with_deploy_opts_for_a_target(options)
  validate_cli_options_hash(
      [:remediation_name, :job_group_name, :pa_job_run_key, :server_name, :pck_prefix, :depot_group_name, :dep_job_group_name, :deploy_job_key],
      options)
  db_key_result = execute_cli_with_param_list(self.class, "createRemediationJobWithDeployOpts",
                                              [
                                                  options[:remediation_name],   # Name of the job
                                                  options[:job_group_name],   # Name of the group that should contain the new remediation job(s)
                                                  options[:pa_job_run_key],   # Hand to the patching job run whose results you want to use for remediation
                                                  options[:server_name],      # Server where you want to run this job.  Server should  be a server which had an anaylsis run
                                                  options[:pck_prefix],     # Prefix for naming the new Batch Job/Deploy Job/Package(s)
                                                  options[:depot_group_name],   # Name of a group that should contain the new Package(s)
                                                  options[:dep_job_group_name], # Name of a group that should contain the new generated Deploy Job(s)
                                                  options[:deploy_job_key]    # Handle to the Deploy Job run whose options you want to use generated Deploy Job(s)
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#execute_job_and_wait(options) ⇒ Object



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

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 remediation job to be executed
                                                   ])
  job_run_key = get_cli_return_value(job_run_key_result)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#execute_job_get_job_result_key(options) ⇒ Object



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

def execute_job_get_job_result_key(options)
  validate_cli_options_hash([:job_key], options)
  db_key_result = execute_cli_with_param_list(self.class, "executeJobGetJobResultKey",
                                              [
                                                  options[:job_key] # Handle to the remediation job to be executed
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end

#get_dbkey_by_group_and_name(options) ⇒ Object



126
127
128
129
130
131
132
133
134
135
136
# File 'lib/bl_soap/patch_remediation_job.rb', line 126

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

#modify_job_set_(options) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/bl_soap/patch_remediation_job.rb', line 84

def modify_job_set_(options)
  validate_cli_options_hash(
      [:remediation_name, :job_group_name, :pa_job_run_key, :server_name, :pck_prefix, :depot_group_name, :dep_job_group_name, :deploy_job_key],
      options)
  db_key_result = execute_cli_with_param_list(self.class, "createRemediationJobWithDeployOpts",
                                              [
                                                  options[:remediation_name],   # Name of the job
                                                  options[:job_group_name],   # Name of the group that should contain the new remediation job(s)
                                                  options[:pa_job_run_key],   # Hand to the patching job run whose results you want to use for remediation
                                                  options[:server_name],      # Server where you want to run this job.  Server should  be a server which had an anaylsis run
                                                  options[:pck_prefix],     # Prefix for naming the new Batch Job/Deploy Job/Package(s)
                                                  options[:depot_group_name],   # Name of a group that should contain the new Package(s)
                                                  options[:dep_job_group_name], # Name of a group that should contain the new generated Deploy Job(s)
                                                  options[:deploy_job_key]    # Handle to the Deploy Job run whose options you want to use generated Deploy Job(s)
                                              ])
  db_key = get_cli_return_value(db_key_result)
rescue => exception
  raise "#{self.class} Exception: #{exception.to_s}"
end