Class: OvirtSDK4::StorageDomainTemplatesService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::StorageDomainTemplatesService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Array<Template>) list(opts = {})
Returns the representation of the object managed by this service.
-
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (StorageDomainTemplateService) template_service(id)
Locates the
template
service. -
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (Array<Template>) list(opts = {})
Returns the representation of the object managed by this service.
19603 19604 19605 19606 19607 19608 19609 19610 19611 19612 19613 19614 19615 19616 19617 19618 19619 19620 19621 19622 19623 |
# File 'lib/ovirtsdk4/services.rb', line 19603 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 TemplateReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
19643 19644 19645 19646 19647 19648 19649 19650 19651 19652 |
# File 'lib/ovirtsdk4/services.rb', line 19643 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return template_service(path) end return template_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (StorageDomainTemplateService) template_service(id)
Locates the template
service.
19632 19633 19634 |
# File 'lib/ovirtsdk4/services.rb', line 19632 def template_service(id) return StorageDomainTemplateService.new(@connection, "#{@path}/#{id}") end |
- (String) to_s
Returns an string representation of this service.
19659 19660 19661 |
# File 'lib/ovirtsdk4/services.rb', line 19659 def to_s return "#<#{StorageDomainTemplatesService}:#{@path}>" end |