Class: OvirtSDK4::AssignedCpuProfileService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::AssignedCpuProfileService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (CpuProfile) 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
- (CpuProfile) get(opts = {})
Returns the representation of the object managed by this service.
2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 |
# File 'lib/ovirtsdk4/services.rb', line 2025 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 CpuProfileReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Object) remove(opts = {})
Deletes the object managed by this service.
2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 |
# File 'lib/ovirtsdk4/services.rb', line 2049 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.
2070 2071 2072 2073 2074 2075 |
# File 'lib/ovirtsdk4/services.rb', line 2070 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.
2082 2083 2084 |
# File 'lib/ovirtsdk4/services.rb', line 2082 def to_s return "#<#{AssignedCpuProfileService}:#{@path}>" end |