Class: OvirtSDK4::StorageServerConnectionsService

Inherits:
Service
  • Object
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

#add(connection, opts = {}) ⇒ StorageConnection

Creates a new storage connection.

For example, to create a new storage connection for the NFS server mynfs.example.com and NFS share /export/mydata send a request like this:

POST /ovirt-engine/api/storageconnections

With a request body like this:

<storage_connection>
  <type>nfs</type>
  <address>mynfs.example.com</address>
  <path>/export/mydata</path>
  <host>
    <name>myhost</name>
  </host>
</storage_connection>

Parameters:

  • connection (StorageConnection)

    The connection to add.

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

    Additional options.

Options Hash (opts):

  • :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:


24960
24961
24962
# File 'lib/ovirtsdk4/services.rb', line 24960

def add(connection, opts = {})
  internal_add(connection, StorageConnection, ADD, opts)
end

#add_glusterfs(connection, opts = {}) ⇒ StorageConnection

Add a Glusterfs storage connection to the system.

Parameters:

  • connection (StorageConnection)

    The connection to add.

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

    Additional options.

Options Hash (opts):

  • :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:


24987
24988
24989
# File 'lib/ovirtsdk4/services.rb', line 24987

def add_glusterfs(connection, opts = {})
  internal_add(connection, StorageConnection, ADD_GLUSTERFS, opts)
end

#add_iscsi(connection, opts = {}) ⇒ StorageConnection

Add a iSCSI storage connection to the system.

Parameters:

  • connection (StorageConnection)

    The connection to add.

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

    Additional options.

Options Hash (opts):

  • :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:


25014
25015
25016
# File 'lib/ovirtsdk4/services.rb', line 25014

def add_iscsi(connection, opts = {})
  internal_add(connection, StorageConnection, ADD_ISCSI, opts)
end

#add_local(connection, opts = {}) ⇒ StorageConnection

Add a local storage connection to the system.

Parameters:

  • connection (StorageConnection)

    The connection to add.

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

    Additional options.

Options Hash (opts):

  • :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:


25075
25076
25077
# File 'lib/ovirtsdk4/services.rb', line 25075

def add_local(connection, opts = {})
  internal_add(connection, StorageConnection, ADD_LOCAL, opts)
end

#add_nfs(connection, opts = {}) ⇒ StorageConnection

Add a nfs storage connection to the system.

Parameters:

  • connection (StorageConnection)

    The connection to add.

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

    Additional options.

Options Hash (opts):

  • :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:


25102
25103
25104
# File 'lib/ovirtsdk4/services.rb', line 25102

def add_nfs(connection, opts = {})
  internal_add(connection, StorageConnection, ADD_NFS, opts)
end

#add_vfs(connection, opts = {}) ⇒ StorageConnection

Add a vfs storage connection to the system.

Parameters:

  • connection (StorageConnection)

    The connection to add.

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

    Additional options.

Options Hash (opts):

  • :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:


25129
25130
25131
# File 'lib/ovirtsdk4/services.rb', line 25129

def add_vfs(connection, opts = {})
  internal_add(connection, StorageConnection, ADD_VFS, opts)
end

#list(opts = {}) ⇒ Array<StorageConnection>

Returns the list of storage connections.

The order of the returned list of connections isn’t guaranteed.

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.

  • :max (Integer)

    Sets the maximum number of connections to return. If not specified all the connections are returned.

  • :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:


25048
25049
25050
# File 'lib/ovirtsdk4/services.rb', line 25048

def list(opts = {})
  internal_get(LIST, 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.


25151
25152
25153
25154
25155
25156
25157
25158
25159
25160
# File 'lib/ovirtsdk4/services.rb', line 25151

def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return storage_connection_service(path)
  end
  return storage_connection_service(path[0..(index - 1)]).service(path[(index + 1)..-1])
end

#storage_connection_service(id) ⇒ StorageServerConnectionService

Locates the storage_connection service.

Parameters:

  • id (String)

    The identifier of the storage_connection.

Returns:


25140
25141
25142
# File 'lib/ovirtsdk4/services.rb', line 25140

def storage_connection_service(id)
  StorageServerConnectionService.new(self, id)
end