Class: OvirtSDK4::GlusterHooksService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::GlusterHooksService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (GlusterHookService) hook_service(id)
Locates the
hook
service. -
- (Array<GlusterHook>) 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
- (GlusterHookService) hook_service(id)
Locates the hook
service.
8840 8841 8842 |
# File 'lib/ovirtsdk4/services.rb', line 8840 def hook_service(id) return GlusterHookService.new(@connection, "#{@path}/#{id}") end |
- (Array<GlusterHook>) list(opts = {})
Returns the representation of the object managed by this service.
8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 |
# File 'lib/ovirtsdk4/services.rb', line 8811 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 GlusterHookReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 |
# File 'lib/ovirtsdk4/services.rb', line 8851 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.
8867 8868 8869 |
# File 'lib/ovirtsdk4/services.rb', line 8867 def to_s return "#<#{GlusterHooksService}:#{@path}>" end |