Class: Fog::Parsers::Compute::VcloudDirector::VmCustomization
Instance Attribute Summary
Attributes inherited from Base
#response
Instance Method Summary
collapse
#extract_attributes
Methods inherited from Base
#attr_value, #characters, #end_element_namespace, #initialize, #start_element_namespace, #value
Instance Method Details
#end_element(name) ⇒ Object
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
|
# File 'lib/fog/vcloud_director/parsers/compute/vm_customization.rb', line 25
def end_element(name)
case name
when 'Enabled'
@response[:enabled] = (value == "true")
when 'ChangeSid'
@response[:change_sid] = (value == "true")
when 'JoinDomainEnabled'
@response[:join_domain_enabled] = (value == "true")
when 'UseOrgSettings'
@response[:use_org_settings] = (value == "true")
when 'AdminPassword'
@response[:admin_password] = value
when 'AdminPasswordEnabled'
@response[:admin_password_enabled] = (value == "true")
when 'AdminPasswordAuto'
@response[:admin_password_auto] = (value == "true")
when 'ResetPasswordRequired'
@response[:reset_password_required] = (value == "true")
when 'VirtualMachineId'
@response[:virtual_machine_id] = value
when 'ComputerName'
@response[:computer_name] = value
when 'CustomizationScript'
@response[:has_customization_script] = !value.empty?
@response[:customization_script] = CGI::unescapeHTML(value) if @response[:has_customization_script]
end
end
|
#reset ⇒ Object
8
9
10
|
# File 'lib/fog/vcloud_director/parsers/compute/vm_customization.rb', line 8
def reset
@response = { }
end
|
#start_element(name, attributes) ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/fog/vcloud_director/parsers/compute/vm_customization.rb', line 12
def start_element(name, attributes)
super
case name
when 'GuestCustomizationSection'
customizations = (attributes)
@response[:href] = customizations[:href]
@response[:type] = customizations[:type]
@response[:id] = @response[:href].split('/')[-2]
end
end
|