Class: OvirtSDK4::OpenstackNetworkProviderService

Inherits:
ExternalProviderService 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

#certificates_serviceExternalProviderCertificatesService

A service to view certificates for this external provider.

Returns:



16449
16450
16451
# File 'lib/ovirtsdk4/services.rb', line 16449

def certificates_service
  @certificates_service ||= ExternalProviderCertificatesService.new(self, 'certificates')
end

#get(opts = {}) ⇒ OpenStackNetworkProvider

Returns the representation of the object managed by this service.

For example, to get the OpenStack network provider with identifier 1234, send a request like this:

GET /ovirt-engine/api/openstacknetworkproviders/1234

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:



16300
16301
16302
# File 'lib/ovirtsdk4/services.rb', line 16300

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

#import_certificates(opts = {}) ⇒ Object

Import the SSL certificates of the external host provider.

Parameters:

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

    Additional options.

Options Hash (opts):

  • :certificates (Array<Certificate>)
  • :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.



16326
16327
16328
# File 'lib/ovirtsdk4/services.rb', line 16326

def import_certificates(opts = {})
  internal_action(:importcertificates, nil, IMPORT_CERTIFICATES, opts)
end

#networks_serviceOpenstackNetworksService

Reference to OpenStack networks service.

Returns:



16458
16459
16460
# File 'lib/ovirtsdk4/services.rb', line 16458

def networks_service
  @networks_service ||= OpenstackNetworksService.new(self, 'networks')
end

#remove(opts = {}) ⇒ Object

Removes the provider.

For example, to remove the OpenStack network provider with identifier 1234, send a request like this:

DELETE /ovirt-engine/api/openstacknetworkproviders/1234

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.



16358
16359
16360
# File 'lib/ovirtsdk4/services.rb', line 16358

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:



16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
# File 'lib/ovirtsdk4/services.rb', line 16469

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'certificates'
    return certificates_service
  end
  if path.start_with?('certificates/')
    return certificates_service.service(path[13..-1])
  end
  if path == 'networks'
    return networks_service
  end
  if path.start_with?('networks/')
    return networks_service.service(path[9..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end

#test_connectivity(opts = {}) ⇒ Object

In order to test connectivity for external provider we need to run following request where 123 is an id of a provider.

POST /ovirt-engine/api/externalhostproviders/123/testconnectivity

Parameters:

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

    Additional options.

Options Hash (opts):

  • :async (Boolean)

    Indicates if the test 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.



16390
16391
16392
# File 'lib/ovirtsdk4/services.rb', line 16390

def test_connectivity(opts = {})
  internal_action(:testconnectivity, nil, TEST_CONNECTIVITY, opts)
end

#update(provider, opts = {}) ⇒ OpenStackNetworkProvider

Updates the provider.

For example, to update provider_name, requires_authentication, url, tenant_name and type properties, for the OpenStack network provider with identifier 1234, send a request like this:

PUT /ovirt-engine/api/openstacknetworkproviders/1234

With a request body like this:

<openstack_network_provider>
  <name>ovn-network-provider</name>
  <requires_authentication>false</requires_authentication>
  <url>http://some_server_url.domain.com:9696</url>
  <tenant_name>oVirt</tenant_name>
  <type>external</type>
</openstack_network_provider>

Parameters:

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:



16440
16441
16442
# File 'lib/ovirtsdk4/services.rb', line 16440

def update(provider, opts = {})
  internal_update(provider, OpenStackNetworkProvider, UPDATE, opts)
end