Class: OvirtSDK4::OpenstackNetworkService

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

#get(opts = {}) ⇒ OpenStackNetwork

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:


17222
17223
17224
# File 'lib/ovirtsdk4/services.rb', line 17222

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

#import(opts = {}) ⇒ Object

This operation imports an external network into product-name. The network will be added to the specified data center.

Parameters:

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

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the import should be performed asynchronously.

  • :data_center (DataCenter)

    The data center into which the network is to be imported. Data center is mandatory, and can be specified using the id or name attributes. The rest of the attributes will be ignored.

    Note
    If auto_sync is enabled for the provider, the network might be imported automatically. To prevent this, automatic import can be disabled by setting the auto_sync to false, and enabling it again after importing the network.
  • :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.


17260
17261
17262
# File 'lib/ovirtsdk4/services.rb', line 17260

def import(opts = {})
  internal_action(:import, nil, IMPORT, 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:


17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
# File 'lib/ovirtsdk4/services.rb', line 17280

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'subnets'
    return subnets_service
  end
  if path.start_with?('subnets/')
    return subnets_service.service(path[8..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

#subnets_serviceOpenstackSubnetsService

Locates the subnets service.

Returns:


17269
17270
17271
# File 'lib/ovirtsdk4/services.rb', line 17269

def subnets_service
  @subnets_service ||= OpenstackSubnetsService.new(self, 'subnets')
end