Class: IbmPowerHmc::JobRequest
Overview
Constant Summary
AbstractNonRest::ATTRS
Instance Attribute Summary
Attributes inherited from AbstractRest
#content_type, #etag, #href, #published, #uuid
#xml
Instance Method Summary
collapse
#initialize, #to_s
#collection_of, #create_element, #initialize, marshal, #marshal, #singleton, #timestamp, #to_s, #uuid_from_href, #uuids_from_links
Instance Method Details
#group ⇒ Object
16
17
18
|
# File 'lib/ibm_power_hmc/schema/job.rb', line 16
def group
singleton("RequestedOperation/GroupName")
end
|
#group=(group) ⇒ Object
20
21
22
23
24
|
# File 'lib/ibm_power_hmc/schema/job.rb', line 20
def group=(group)
elem = xml.elements["RequestedOperation"]
elem = xml.add_element("RequestedOperation", "schemaVersion" => "V1_1_0") if elem.nil?
elem.add_element("GroupName").text = group
end
|
#operation ⇒ Object
6
7
8
|
# File 'lib/ibm_power_hmc/schema/job.rb', line 6
def operation
singleton("RequestedOperation/OperationName")
end
|
#operation=(operation) ⇒ Object
10
11
12
13
14
|
# File 'lib/ibm_power_hmc/schema/job.rb', line 10
def operation=(operation)
elem = xml.elements["RequestedOperation"]
elem = xml.add_element("RequestedOperation", "schemaVersion" => "V1_1_0") if elem.nil?
elem.add_element("OperationName").text = operation
end
|
#params ⇒ Object
26
27
28
29
30
31
32
33
34
|
# File 'lib/ibm_power_hmc/schema/job.rb', line 26
def params
params = {}
xml.each_element("JobParameters/JobParameter") do |jobparam|
name = jobparam.elements["ParameterName"]&.text&.strip
value = jobparam.elements["ParameterValue"]&.text&.strip
params[name] = value unless name.nil?
end
params
end
|
#params=(params) ⇒ Object
36
37
38
39
40
41
42
43
|
# File 'lib/ibm_power_hmc/schema/job.rb', line 36
def params=(params)
jobparams = xml.add_element("JobParameters", "schemaVersion" => "V1_1_0")
params.each do |key, value|
jobparam = jobparams.add_element("JobParameter", "schemaVersion" => "V1_1_0")
jobparam.add_element("ParameterName").text = key
jobparam.add_element("ParameterValue").text = value
end
end
|