Class: OvirtSDK4::VmDiskService

Inherits:
MeasurableService show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary collapse

Methods inherited from Service

#inspect, #to_s

Instance Method Details

#activate(opts = {}) ⇒ Object

Executes the activate method.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the activation should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



29445
29446
29447
# File 'lib/ovirtsdk4/services.rb', line 29445

def activate(opts = {})
  internal_action(:activate, nil, ACTIVATE, opts)
end

#deactivate(opts = {}) ⇒ Object

Executes the deactivate method.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the deactivation should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



29471
29472
29473
# File 'lib/ovirtsdk4/services.rb', line 29471

def deactivate(opts = {})
  internal_action(:deactivate, nil, DEACTIVATE, opts)
end

#export(opts = {}) ⇒ Object

Executes the export method.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the export should be performed asynchronously.

  • :filter (Boolean)

    Indicates if the results should be filtered according to the permissions of the user.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



29500
29501
29502
# File 'lib/ovirtsdk4/services.rb', line 29500

def export(opts = {})
  internal_action(:export, nil, EXPORT, opts)
end

#get(opts = {}) ⇒ Disk

Returns the representation of the object managed by this service.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :follow (String)

    Indicates which inner links should be followed. The objects referenced by these links will be fetched as part of the current request. See here for details.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



29529
29530
29531
# File 'lib/ovirtsdk4/services.rb', line 29529

def get(opts = {})
  internal_get(GET, opts)
end

#move(opts = {}) ⇒ Object

Executes the move method.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the move should be performed asynchronously.

  • :filter (Boolean)

    Indicates if the results should be filtered according to the permissions of the user.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



29558
29559
29560
# File 'lib/ovirtsdk4/services.rb', line 29558

def move(opts = {})
  internal_action(:move, nil, MOVE, opts)
end

#permissions_serviceAssignedPermissionsService

Locates the permissions service.

Returns:



29625
29626
29627
# File 'lib/ovirtsdk4/services.rb', line 29625

def permissions_service
  @permissions_service ||= AssignedPermissionsService.new(self, 'permissions')
end

#remove(opts = {}) ⇒ Object

Detach the disk from the virtual machine.

Note
In version 3 of the API this used to also remove the disk completely from the system, but starting with version 4 it doesn’t. If you need to remove it completely use the remove method of the top level disk service.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the remove should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.



29587
29588
29589
# File 'lib/ovirtsdk4/services.rb', line 29587

def remove(opts = {})
  internal_remove(REMOVE, opts)
end

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.

Raises:



29645
29646
29647
29648
29649
29650
29651
29652
29653
29654
29655
29656
29657
29658
29659
29660
29661
29662
# File 'lib/ovirtsdk4/services.rb', line 29645

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'permissions'
    return permissions_service
  end
  if path.start_with?('permissions/')
    return permissions_service.service(path[12..-1])
  end
  if path == 'statistics'
    return statistics_service
  end
  if path.start_with?('statistics/')
    return statistics_service.service(path[11..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

#statistics_serviceStatisticsService

Locates the statistics service.

Returns:



29634
29635
29636
# File 'lib/ovirtsdk4/services.rb', line 29634

def statistics_service
  @statistics_service ||= StatisticsService.new(self, 'statistics')
end

#update(disk, opts = {}) ⇒ Disk

Updates the disk.

Parameters:

  • disk (Disk)

    The disk to update.

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the update should be performed asynchronously.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



29616
29617
29618
# File 'lib/ovirtsdk4/services.rb', line 29616

def update(disk, opts = {})
  internal_update(disk, Disk, UPDATE, opts)
end