Class: OvirtSDK4::TemplateDisksService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::TemplateDisksService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (TemplateDiskService) disk_service(id)
Locates the
disk
service. -
- (Array<Disk>) 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
- (TemplateDiskService) disk_service(id)
Locates the disk
service.
22039 22040 22041 |
# File 'lib/ovirtsdk4/services.rb', line 22039 def disk_service(id) return TemplateDiskService.new(@connection, "#{@path}/#{id}") end |
- (Array<Disk>) list(opts = {})
Returns the representation of the object managed by this service.
22010 22011 22012 22013 22014 22015 22016 22017 22018 22019 22020 22021 22022 22023 22024 22025 22026 22027 22028 22029 22030 |
# File 'lib/ovirtsdk4/services.rb', line 22010 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 DiskReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
22050 22051 22052 22053 22054 22055 22056 22057 22058 22059 |
# File 'lib/ovirtsdk4/services.rb', line 22050 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return disk_service(path) end return disk_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
22066 22067 22068 |
# File 'lib/ovirtsdk4/services.rb', line 22066 def to_s return "#<#{TemplateDisksService}:#{@path}>" end |