Class: OvirtSDK4::NetworkFiltersService

Inherits:
Service
  • Object
show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary (collapse)

Instance Method Details

- (Array<NetworkFilter>) list(opts = {})

Retrieves the representations of the network filters.

Parameters:

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

    Additional options.

Returns:



12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
# File 'lib/ovirtsdk4/services.rb', line 12809

def list(opts = {})
  query = {}
  request = Request.new(:method => :GET, :path => @path, :query => query)
  response = @connection.send(request)
  case response.code
  when 200
    begin
      reader = XmlReader.new(response.body)
      return NetworkFilterReader.read_many(reader)
    ensure
      reader.close
    end
  else
    check_fault(response)
  end
end

- (NetworkFilterService) network_filter_service(id)

Locates the network_filter service.

Parameters:

  • id (String)

    The identifier of the network_filter.

Returns:



12833
12834
12835
# File 'lib/ovirtsdk4/services.rb', line 12833

def network_filter_service(id)
  return NetworkFilterService.new(@connection, "#{@path}/#{id}")
end

- (Service) service(path)

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.



12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
# File 'lib/ovirtsdk4/services.rb', line 12844

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

- (String) to_s

Returns an string representation of this service.

Returns:

  • (String)


12860
12861
12862
# File 'lib/ovirtsdk4/services.rb', line 12860

def to_s
  return "#<#{NetworkFiltersService}:#{@path}>"
end