827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
|
# File 'lib/ucslib/service/ucs/provision.rb', line 827
def set_vhba_template(json)
vhba_template_name = JSON.parse(json)['vhba_template_name']
wwpn_pool = JSON.parse(json)['wwpn_pool']
switch = JSON.parse(json)['switch']
vsan_name = JSON.parse(json)['vsan_name']
org = JSON.parse(json)['org']
description = JSON.parse(json)['description']
xml_builder = Nokogiri::XML::Builder.new do |xml|
xml.configConfMos('cookie' => "#{@cookie}", 'inHierarchical' => 'true'){
xml.inConfigs{
xml.pair('key' => "org-root/org-#{org}/san-conn-templ-#{vhba_template_name}"){
xml.vnicSanConnTempl('descr' => "#{description}", 'dn' => "org-root/org-#{org}/san-conn-templ-#{vhba_template_name}",
'identPoolName' => "#{wwpn_pool}", 'maxDataFieldSize' => '2048', 'name' => "#{vhba_template_name}",
'pinToGroupName' => '', 'qosPolicyName' => '', 'statsPolicyName' => 'default', 'status' => 'created',
'switchId' => "#{switch}", 'templType' => 'updating-template'){
xml.vnicFcIf('name' => "#{vsan_name}", 'rn' => 'if-default')
}
}
}
}
end
set_vhba_template_xml = xml_builder.to_xml.to_s
begin
rest_post(set_vhba_template_xml,@url)
rescue Exception => e
raise "Error #{e}"
end
end
|