Class: OvirtSDK4::EventService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::EventService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Event) get(opts = {})
Returns the representation of the object managed by this service.
-
- (Object) remove(opts = {})
Deletes the object managed by this service.
-
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (Event) get(opts = {})
Returns the representation of the object managed by this service.
6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 |
# File 'lib/ovirtsdk4/services.rb', line 6574 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 EventReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Object) remove(opts = {})
Deletes the object managed by this service.
6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 |
# File 'lib/ovirtsdk4/services.rb', line 6598 def remove(opts = {}) query = {} value = opts[:async] unless value.nil? value = Writer.render_boolean(value) query['async'] = value end request = Request.new(:method => :DELETE, :path => @path, :query => query) response = @connection.send(request) unless response.code == 200 check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
6619 6620 6621 6622 6623 6624 |
# File 'lib/ovirtsdk4/services.rb', line 6619 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.
6631 6632 6633 |
# File 'lib/ovirtsdk4/services.rb', line 6631 def to_s return "#<#{EventService}:#{@path}>" end |