Class: OvirtSDK4::ClusterLevelsService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::ClusterLevelsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (ClusterLevelService) level_service(id)
Reference to the service that provides information about an specific cluster level.
-
- (Array<ClusterLevel>) list(opts = {})
Lists the cluster levels supported by the system.
-
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (ClusterLevelService) level_service(id)
Reference to the service that provides information about an specific cluster level.
4355 4356 4357 |
# File 'lib/ovirtsdk4/services.rb', line 4355 def level_service(id) return ClusterLevelService.new(@connection, "#{@path}/#{id}") end |
- (Array<ClusterLevel>) list(opts = {})
Lists the cluster levels supported by the system.
4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 |
# File 'lib/ovirtsdk4/services.rb', line 4331 def list(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 ClusterLevelReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 |
# File 'lib/ovirtsdk4/services.rb', line 4366 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return level_service(path) end return level_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
4382 4383 4384 |
# File 'lib/ovirtsdk4/services.rb', line 4382 def to_s return "#<#{ClusterLevelsService}:#{@path}>" end |