Class: OvirtSDK4::StorageDomainContentDiskService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::StorageDomainContentDiskService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Disk) 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
- (Disk) get(opts = {})
Returns the representation of the object managed by this service.
19077 19078 19079 19080 19081 19082 19083 19084 19085 19086 19087 19088 19089 19090 19091 19092 19093 19094 19095 19096 19097 |
# File 'lib/ovirtsdk4/services.rb', line 19077 def get(opts = {}) query = {} value = opts[:filter] unless value.nil? value = Writer.render_boolean(value) query['filter'] = 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_one(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
19106 19107 19108 19109 19110 19111 |
# File 'lib/ovirtsdk4/services.rb', line 19106 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.
19118 19119 19120 |
# File 'lib/ovirtsdk4/services.rb', line 19118 def to_s return "#<#{StorageDomainContentDiskService}:#{@path}>" end |