Class: OvirtSDK4::TemplateCdromService

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

Instance Method Summary (collapse)

Instance Method Details

- (Cdrom) get(opts = {})

Returns the representation of the object managed by this service.

Parameters:

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

    Additional options.

Returns:



21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
# File 'lib/ovirtsdk4/services.rb', line 21724

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 CdromReader.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)


21748
21749
21750
21751
21752
21753
# File 'lib/ovirtsdk4/services.rb', line 21748

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)


21760
21761
21762
# File 'lib/ovirtsdk4/services.rb', line 21760

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