Class: OvirtSDK4::StatisticService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::StatisticService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Statistic) 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
- (Statistic) get(opts = {})
Returns the representation of the object managed by this service.
18199 18200 18201 18202 18203 18204 18205 18206 18207 18208 18209 18210 18211 18212 18213 18214 18215 18216 18217 18218 |
# File 'lib/ovirtsdk4/services.rb', line 18199 def get(opts = {}) query = {} value = opts[:statistic] unless value.nil? query['statistic'] = 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 StatisticReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
18227 18228 18229 18230 18231 18232 |
# File 'lib/ovirtsdk4/services.rb', line 18227 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.
18239 18240 18241 |
# File 'lib/ovirtsdk4/services.rb', line 18239 def to_s return "#<#{StatisticService}:#{@path}>" end |