Class: OvirtSDK4::VmGraphicsConsoleService
- Inherits:
-
GraphicsConsoleService
- Object
- Service
- GraphicsConsoleService
- OvirtSDK4::VmGraphicsConsoleService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (GraphicsConsole) get(opts = {})
Returns the representation of the object managed by this service.
-
- (Object) proxy_ticket(opts = {})
Executes the
proxy_ticket
method. -
- (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
- (GraphicsConsole) get(opts = {})
Returns the representation of the object managed by this service.
24971 24972 24973 24974 24975 24976 24977 24978 24979 24980 24981 24982 24983 24984 24985 24986 |
# File 'lib/ovirtsdk4/services.rb', line 24971 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 GraphicsConsoleReader.read_one(reader) ensure reader.close end else check_fault(response) end end |
- (Object) proxy_ticket(opts = {})
Executes the proxy_ticket
method.
24991 24992 24993 24994 24995 24996 24997 24998 24999 25000 25001 25002 25003 25004 25005 25006 25007 25008 25009 25010 |
# File 'lib/ovirtsdk4/services.rb', line 24991 def proxy_ticket(opts = {}) action = Action.new(opts) writer = XmlWriter.new(nil, true) ActionWriter.write_one(action, writer) body = writer.string writer.close request = Request.new({ :method => :POST, :path => "#{@path}/proxyticket", :body => body, }) response = @connection.send(request) case response.code when 200 action = check_action(response) return action.proxy_ticket else check_fault(response) end end |
- (Object) remove(opts = {})
Deletes the object managed by this service.
25019 25020 25021 25022 25023 25024 25025 25026 25027 25028 25029 25030 25031 |
# File 'lib/ovirtsdk4/services.rb', line 25019 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.
25040 25041 25042 25043 25044 25045 |
# File 'lib/ovirtsdk4/services.rb', line 25040 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.
25052 25053 25054 |
# File 'lib/ovirtsdk4/services.rb', line 25052 def to_s return "#<#{VmGraphicsConsoleService}:#{@path}>" end |