Class: OvirtSDK4::HostHooksService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::HostHooksService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (HostHookService) hook_service(id)
Locates the
hook
service. -
- (Array<Hook>) list(opts = {})
Returns the representation of 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
- (HostHookService) hook_service(id)
Locates the hook
service.
9749 9750 9751 |
# File 'lib/ovirtsdk4/services.rb', line 9749 def hook_service(id) return HostHookService.new(@connection, "#{@path}/#{id}") end |
- (Array<Hook>) list(opts = {})
Returns the representation of the object managed by this service.
9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 |
# File 'lib/ovirtsdk4/services.rb', line 9720 def list(opts = {}) query = {} value = opts[:max] unless value.nil? value = Writer.render_integer(value) query['max'] = value end 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 HookReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 |
# File 'lib/ovirtsdk4/services.rb', line 9760 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return hook_service(path) end return hook_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
9776 9777 9778 |
# File 'lib/ovirtsdk4/services.rb', line 9776 def to_s return "#<#{HostHooksService}:#{@path}>" end |