Class: OvirtSDK4::VmNicService

Inherits:
MeasurableService show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary collapse

Methods inherited from Service

#inspect, #to_s

Instance Method Details

#activate(opts = {}) ⇒ Object

Executes the activate method.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the activation should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



30386
30387
30388
# File 'lib/ovirtsdk4/services.rb', line 30386

def activate(opts = {})
  internal_action(:activate, nil, ACTIVATE, opts)
end

#deactivate(opts = {}) ⇒ Object

Executes the deactivate method.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the deactivation should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



30412
30413
30414
# File 'lib/ovirtsdk4/services.rb', line 30412

def deactivate(opts = {})
  internal_action(:deactivate, nil, DEACTIVATE, opts)
end

#get(opts = {}) ⇒ Nic

Returns the representation of the object managed by this service.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :follow (String)

    Indicates which inner links should be followed. The objects referenced by these links will be fetched as part of the current request. See here for details.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



30441
30442
30443
# File 'lib/ovirtsdk4/services.rb', line 30441

def get(opts = {})
  internal_get(GET, opts)
end

#network_filter_parameters_serviceNicNetworkFilterParametersService

Reference to the service that manages the network filter parameters of the NIC.

A single top-level network filter may assigned to the NIC by the NIC’s vNIC Profile.

Returns:



30554
30555
30556
# File 'lib/ovirtsdk4/services.rb', line 30554

def network_filter_parameters_service
  @network_filter_parameters_service ||= NicNetworkFilterParametersService.new(self, 'networkfilterparameters')
end

#remove(opts = {}) ⇒ Object

Removes the NIC.

For example, to remove the NIC with id 456 from the virtual machine with id 123 send a request like this:

DELETE /ovirt-engine/api/vms/123/nics/456
Important

The hotplugging feature only supports virtual machine operating systems with hotplugging operations. Example operating systems include:

  • Red Hat Enterprise Linux 6

  • Red Hat Enterprise Linux 5

  • Windows Server 2008 and

  • Windows Server 2003

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the remove should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



30484
30485
30486
# File 'lib/ovirtsdk4/services.rb', line 30484

def remove(opts = {})
  internal_remove(REMOVE, opts)
end

#reported_devices_serviceVmReportedDevicesService

Locates the reported_devices service.

Returns:



30563
30564
30565
# File 'lib/ovirtsdk4/services.rb', line 30563

def reported_devices_service
  @reported_devices_service ||= VmReportedDevicesService.new(self, 'reporteddevices')
end

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.

Raises:



30583
30584
30585
30586
30587
30588
30589
30590
30591
30592
30593
30594
30595
30596
30597
30598
30599
30600
30601
30602
30603
30604
30605
30606
# File 'lib/ovirtsdk4/services.rb', line 30583

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'networkfilterparameters'
    return network_filter_parameters_service
  end
  if path.start_with?('networkfilterparameters/')
    return network_filter_parameters_service.service(path[24..-1])
  end
  if path == 'reporteddevices'
    return reported_devices_service
  end
  if path.start_with?('reporteddevices/')
    return reported_devices_service.service(path[16..-1])
  end
  if path == 'statistics'
    return statistics_service
  end
  if path.start_with?('statistics/')
    return statistics_service.service(path[11..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

#statistics_serviceStatisticsService

Locates the statistics service.

Returns:



30572
30573
30574
# File 'lib/ovirtsdk4/services.rb', line 30572

def statistics_service
  @statistics_service ||= StatisticsService.new(self, 'statistics')
end

#update(nic, opts = {}) ⇒ Nic

Updates the NIC.

For example, to update the NIC having with 456 belonging to virtual the machine with id 123 send a request like this:

PUT /ovirt-engine/api/vms/123/nics/456

With a request body like this:

<nic>
  <name>mynic</name>
  <interface>e1000</interface>
  <vnic_profile id='789'/>
</nic>
Important

The hotplugging feature only supports virtual machine operating systems with hotplugging operations. Example operating systems include:

  • Red Hat Enterprise Linux 6

  • Red Hat Enterprise Linux 5

  • Windows Server 2008 and

  • Windows Server 2003

Parameters:

  • nic (Nic)

    The nic to update.

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the update should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



30543
30544
30545
# File 'lib/ovirtsdk4/services.rb', line 30543

def update(nic, opts = {})
  internal_update(nic, Nic, UPDATE, opts)
end