102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
# File 'lib/ucslib/service/ucs/provision.rb', line 102
def set_time_zone(json)
time_zone = "#{JSON.parse(json)['time_zone']}"
xml_builder = Nokogiri::XML::Builder.new do |xml|
xml.configConfMos('cookie' => "#{@cookie}", 'inHierarchical' => 'false'){
xml.inConfigs{
xml.pair('key' => 'sys/svc-ext/datetime-svc'){
xml.commDateTime('adminState' => 'enabled', 'descr' => '', 'dn' => 'sys/svc-ext/datetime-svc', 'port' => '0', 'status' => 'modified',
'timezone' => "#{time_zone}")
}
}
}
end
set_time_zone_xml = xml_builder.to_xml.to_s
begin
rest_post(set_time_zone_xml,@url)
rescue Exception => e
raise "Error #{e}"
end
end
|