Class: OvirtSDK4::CopyableService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::CopyableService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Object) copy(opts = {})
Executes the
copy
method. -
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (Object) copy(opts = {})
Executes the copy
method.
4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 |
# File 'lib/ovirtsdk4/services.rb', line 4549 def copy(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}/copy", :body => body, }) response = @connection.send(request) case response.code when 200 action = check_action(response) else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
4576 4577 4578 4579 4580 4581 |
# File 'lib/ovirtsdk4/services.rb', line 4576 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.
4588 4589 4590 |
# File 'lib/ovirtsdk4/services.rb', line 4588 def to_s return "#<#{CopyableService}:#{@path}>" end |