Method: Provision#set_network_uplink_port

Defined in:
lib/ucslib/service/ucs/provision.rb


248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/ucslib/service/ucs/provision.rb', line 248

def set_network_uplink_port(json)

switch = JSON.parse(json)['switch']
port   = JSON.parse(json)['port']
slot   = JSON.parse(json)['slot']

xml_builder = Nokogiri::XML::Builder.new do |xml|
xml.configConfMos('cookie' => "#{@cookie}", 'inHierarchical' => 'false'){
xml.inConfigs{
 xml.pair('key' => "fabric/lan/#{switch}"){
   xml.fabricEthLan('dn' => "fabric/lan/#{switch}", 'status' => 'created,modified'){
     xml.fabricEthLanEp('adminSpeed' => '10gbps', 'adminState' => 'enabled', 'flowCtrlPolicy' => 'default',
                        'name' => '', 'portId' => "#{port}",
                        'rn' => "phys" + "-" + "slot" + "-" + "#{slot}" + "-" + "port" + "-" + "#{port}",
                        'slotId' => "#{slot}", 'status' => 'created', 'usrLbl' => '')
   			}
 		}
	}
}
end

#Create xml
set_network_uplink_xml = xml_builder.to_xml.to_s

#Post

begin
	rest_post(set_network_uplink_xml,@url)
rescue Exception => e
	raise "Error #{e}"
end

end