Class: OvirtSDK4::NicNetworkFilterParametersService

Inherits:
Service
  • Object
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

#add(parameter, opts = {}) ⇒ NetworkFilterParameter

Add a network filter parameter.

For example, to add the parameter for the network filter on NIC 456 of virtual machine 789 send a request like this:

POST /ovirt-engine/api/vms/789/nics/456/networkfilterparameters

With a request body like this:

<network_filter_parameter>
  <name>IP</name>
  <value>10.0.1.2</value>
</network_filter_parameter>

Parameters:

  • parameter (NetworkFilterParameter)

    The network filter parameter that is being added.

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

    Additional options.

Options Hash (opts):

  • :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:



15517
15518
15519
# File 'lib/ovirtsdk4/services.rb', line 15517

def add(parameter, opts = {})
  internal_add(parameter, NetworkFilterParameter, ADD, opts)
end

#list(opts = {}) ⇒ Array<NetworkFilterParameter>

Retrieves the representations of the network filter parameters.

The order of the returned list of network filters isn’t guaranteed.

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:



15548
15549
15550
# File 'lib/ovirtsdk4/services.rb', line 15548

def list(opts = {})
  internal_get(LIST, opts)
end

#parameter_service(id) ⇒ NicNetworkFilterParameterService

Reference to the service that manages a specific network filter parameter.

Parameters:

  • id (String)

    The identifier of the parameter.

Returns:



15559
15560
15561
# File 'lib/ovirtsdk4/services.rb', line 15559

def parameter_service(id)
  NicNetworkFilterParameterService.new(self, id)
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.



15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
# File 'lib/ovirtsdk4/services.rb', line 15570

def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return parameter_service(path)
  end
  return parameter_service(path[0..(index - 1)]).service(path[(index +1)..-1])
end