Class: OvirtSDK4::HostNicService

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

#get(opts = {}) ⇒ HostNic

Returns the representation of the object managed by this service.

Parameters:

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

    Additional options.

Options Hash (opts):

  • :all_content (Boolean)

    Indicates if all of the attributes of the host network interface should be included in the response.

    By default the following attributes are excluded:

    • virtual_functions_configuration

    For example, to retrieve the complete representation network interface '456' of host '123':

    GET /ovirt-engine/api/hosts/123/nics/456?all_content=true
    Note
    These attributes are not included by default because retrieving them impacts performance. They are seldom used and require additional queries to the database. Use this parameter with caution and only when specifically required.
  • :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:


38493
38494
38495
# File 'lib/ovirtsdk4/services.rb', line 38493

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

A reference to information elements received by LLDP on the NIC.

Returns:


38537
38538
38539
# File 'lib/ovirtsdk4/services.rb', line 38537

def link_layer_discovery_protocol_elements_service
  @link_layer_discovery_protocol_elements_service ||= LinkLayerDiscoveryProtocolService.new(self, 'linklayerdiscoveryprotocolelements')
end

#network_attachments_serviceNetworkAttachmentsService

Reference to the service that manages the network attachments assigned to this network interface.

Returns:


38546
38547
38548
# File 'lib/ovirtsdk4/services.rb', line 38546

def network_attachments_service
  @network_attachments_service ||= NetworkAttachmentsService.new(self, 'networkattachments')
end

#network_labels_serviceNetworkLabelsService

Reference to the service that manages the network labels assigned to this network interface.

Returns:


38555
38556
38557
# File 'lib/ovirtsdk4/services.rb', line 38555

def network_labels_service
  @network_labels_service ||= NetworkLabelsService.new(self, 'networklabels')
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:


38595
38596
38597
38598
38599
38600
38601
38602
38603
38604
38605
38606
38607
38608
38609
38610
38611
38612
38613
38614
38615
38616
38617
38618
38619
38620
38621
38622
38623
38624
38625
38626
38627
38628
38629
38630
38631
38632
38633
38634
38635
38636
# File 'lib/ovirtsdk4/services.rb', line 38595

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'linklayerdiscoveryprotocolelements'
    return link_layer_discovery_protocol_elements_service
  end
  if path.start_with?('linklayerdiscoveryprotocolelements/')
    return link_layer_discovery_protocol_elements_service.service(path[35..-1])
  end
  if path == 'networkattachments'
    return network_attachments_service
  end
  if path.start_with?('networkattachments/')
    return network_attachments_service.service(path[19..-1])
  end
  if path == 'networklabels'
    return network_labels_service
  end
  if path.start_with?('networklabels/')
    return network_labels_service.service(path[14..-1])
  end
  if path == 'statistics'
    return statistics_service
  end
  if path.start_with?('statistics/')
    return statistics_service.service(path[11..-1])
  end
  if path == 'virtualfunctionallowedlabels'
    return virtual_function_allowed_labels_service
  end
  if path.start_with?('virtualfunctionallowedlabels/')
    return virtual_function_allowed_labels_service.service(path[29..-1])
  end
  if path == 'virtualfunctionallowednetworks'
    return virtual_function_allowed_networks_service
  end
  if path.start_with?('virtualfunctionallowednetworks/')
    return virtual_function_allowed_networks_service.service(path[31..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

#statistics_serviceStatisticsService

Locates the statistics service.

Returns:


38564
38565
38566
# File 'lib/ovirtsdk4/services.rb', line 38564

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

#update_virtual_functions_configuration(opts = {}) ⇒ Object

The action updates virtual function configuration in case the current resource represents an SR-IOV enabled NIC. The input should be consisted of at least one of the following properties:

  • allNetworksAllowed

  • numberOfVirtualFunctions

Please see the HostNicVirtualFunctionsConfiguration type for the meaning of the properties.

Parameters:

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

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the update should be performed asynchronously.

  • :virtual_functions_configuration (HostNicVirtualFunctionsConfiguration)
  • :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.


38528
38529
38530
# File 'lib/ovirtsdk4/services.rb', line 38528

def update_virtual_functions_configuration(opts = {})
  internal_action(:updatevirtualfunctionsconfiguration, nil, UPDATE_VIRTUAL_FUNCTIONS_CONFIGURATION, opts)
end

#virtual_function_allowed_labels_serviceNetworkLabelsService

Retrieves sub-collection resource of network labels that are allowed on an the virtual functions in case that the current resource represents an SR-IOV physical function NIC.

Returns:


38574
38575
38576
# File 'lib/ovirtsdk4/services.rb', line 38574

def virtual_function_allowed_labels_service
  @virtual_function_allowed_labels_service ||= NetworkLabelsService.new(self, 'virtualfunctionallowedlabels')
end

#virtual_function_allowed_networks_serviceVirtualFunctionAllowedNetworksService

Retrieves sub-collection resource of networks that are allowed on an the virtual functions in case that the current resource represents an SR-IOV physical function NIC.

Returns:


38584
38585
38586
# File 'lib/ovirtsdk4/services.rb', line 38584

def virtual_function_allowed_networks_service
  @virtual_function_allowed_networks_service ||= VirtualFunctionAllowedNetworksService.new(self, 'virtualfunctionallowednetworks')
end