Class: OvirtSDK4::StorageService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::StorageService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (HostStorage) get(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
- (HostStorage) get(opts = {})
Returns the representation of the object managed by this service.
18627 18628 18629 18630 18631 18632 18633 18634 18635 18636 18637 18638 18639 18640 18641 18642 18643 18644 18645 18646 18647 |
# File 'lib/ovirtsdk4/services.rb', line 18627 def get(opts = {}) query = {} value = opts[:report_status] unless value.nil? value = Writer.render_boolean(value) query['report_status'] = 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 HostStorageReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
18656 18657 18658 18659 18660 18661 |
# File 'lib/ovirtsdk4/services.rb', line 18656 def service(path) if path.nil? || path == '' return self end raise Error.new("The path \"#{path}\" doesn't correspond to any service") end |
- (String) to_s
Returns an string representation of this service.
18668 18669 18670 |
# File 'lib/ovirtsdk4/services.rb', line 18668 def to_s return "#<#{StorageService}:#{@path}>" end |