Class: OvirtSDK4::StorageDomainServerConnectionService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::StorageDomainServerConnectionService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (StorageConnection) get(opts = {})
Returns the representation of the object managed by this service.
-
- (Object) remove(opts = {})
Deletes 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
- (StorageConnection) get(opts = {})
Returns the representation of the object managed by this service.
19249 19250 19251 19252 19253 19254 19255 19256 19257 19258 19259 19260 19261 19262 19263 19264 |
# File 'lib/ovirtsdk4/services.rb', line 19249 def get(opts = {}) query = {} 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 StorageConnectionReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Object) remove(opts = {})
Deletes the object managed by this service.
19273 19274 19275 19276 19277 19278 19279 19280 19281 19282 19283 19284 19285 |
# File 'lib/ovirtsdk4/services.rb', line 19273 def remove(opts = {}) query = {} value = opts[:async] unless value.nil? value = Writer.render_boolean(value) query['async'] = value end request = Request.new(:method => :DELETE, :path => @path, :query => query) response = @connection.send(request) unless response.code == 200 check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
19294 19295 19296 19297 19298 19299 |
# File 'lib/ovirtsdk4/services.rb', line 19294 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.
19306 19307 19308 |
# File 'lib/ovirtsdk4/services.rb', line 19306 def to_s return "#<#{StorageDomainServerConnectionService}:#{@path}>" end |