Class: OvirtSDK4::StorageDomainVmsService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::StorageDomainVmsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Array<Vm>) 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.
-
- (StorageDomainVmService) vm_service(id)
Locates the
vm
service.
Instance Method Details
- (Array<Vm>) list(opts = {})
Returns the representation of the object managed by this service.
19837 19838 19839 19840 19841 19842 19843 19844 19845 19846 19847 19848 19849 19850 19851 19852 19853 19854 19855 19856 19857 |
# File 'lib/ovirtsdk4/services.rb', line 19837 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 VmReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
19877 19878 19879 19880 19881 19882 19883 19884 19885 19886 |
# File 'lib/ovirtsdk4/services.rb', line 19877 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return vm_service(path) end return vm_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
19893 19894 19895 |
# File 'lib/ovirtsdk4/services.rb', line 19893 def to_s return "#<#{StorageDomainVmsService}:#{@path}>" end |
- (StorageDomainVmService) vm_service(id)
Locates the vm
service.
19866 19867 19868 |
# File 'lib/ovirtsdk4/services.rb', line 19866 def vm_service(id) return StorageDomainVmService.new(@connection, "#{@path}/#{id}") end |