Class: OvirtSDK4::NetworkFilterService

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

Instance Method Summary (collapse)

Instance Method Details

- (NetworkFilter) get(opts = {})

Retrieves a representation of the network filter.

Parameters:

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

    Additional options.

Returns:



12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
# File 'lib/ovirtsdk4/services.rb', line 12744

def get(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_one(reader)
    ensure
      reader.close
    end
  else
    check_fault(response)
  end
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.

Raises:

  • (Error)


12768
12769
12770
12771
12772
12773
# File 'lib/ovirtsdk4/services.rb', line 12768

def service(path)
  if path.nil? || path == ''
    return self
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

- (String) to_s

Returns an string representation of this service.

Returns:

  • (String)


12780
12781
12782
# File 'lib/ovirtsdk4/services.rb', line 12780

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