1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/xenserver/requests/compute/create_vif.rb
Sergio Rubio b917ffc5db * Added more tests and extended existing ones
* Added missing exceptions NotFound and RequestFailed
* connection.request now raises exception if request failed
* refactored most get_* request into get_record and get_records
* Compute.default_template more robust
* Base parser now replaces OpaqueRef:NULL with nil
* create_server request fixes
2012-04-04 09:01:55 +02:00

36 lines
896 B
Ruby

module Fog
module Compute
class XenServer
class Real
def create_vif( vm_ref, network_ref )
@connection.request({:parser => Fog::Parsers::XenServer::Base.new, :method => 'VIF.create'}, default_vif_config(vm_ref, network_ref) )
end
def default_vif_config( vm_ref, network_ref, device_number = '0' )
{
'MAC_autogenerated' => 'True',
'VM' => vm_ref,
'network' => network_ref,
'device' => device_number,
'MAC' => '',
'MTU' => '0',
'other_config' => {},
'qos_algorithm_type' => 'ratelimit',
'qos_algorithm_params' => {}
}
end
end
class Mock
def create_vif( vm_ref, network_ref )
Fog::Mock.not_implemented
end
end
end
end
end