Class: OvirtSDK4::OpenstackNetworkProviderService
- Inherits:
-
ExternalProviderService
- Object
- Service
- ExternalProviderService
- OvirtSDK4::OpenstackNetworkProviderService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#certificates_service ⇒ ExternalProviderCertificatesService
A service to view certificates for this external provider.
-
#get(opts = {}) ⇒ OpenStackNetworkProvider
Returns the representation of the object managed by this service.
-
#import_certificates(opts = {}) ⇒ Object
Import the SSL certificates of the external host provider.
-
#networks_service ⇒ OpenstackNetworksService
Reference to OpenStack networks service.
-
#remove(opts = {}) ⇒ Object
Removes the provider.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#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.
-
#update(provider, opts = {}) ⇒ OpenStackNetworkProvider
Updates the provider.
Methods inherited from Service
Instance Method Details
#certificates_service ⇒ ExternalProviderCertificatesService
A service to view certificates for this external provider.
17509 17510 17511 |
# File 'lib/ovirtsdk4/services.rb', line 17509 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 HTTP/1.1
17364 17365 17366 |
# File 'lib/ovirtsdk4/services.rb', line 17364 def get(opts = {}) internal_get(GET, opts) end |
#import_certificates(opts = {}) ⇒ Object
Import the SSL certificates of the external host provider.
17390 17391 17392 |
# File 'lib/ovirtsdk4/services.rb', line 17390 def import_certificates(opts = {}) internal_action(:importcertificates, nil, IMPORT_CERTIFICATES, opts) end |
#networks_service ⇒ OpenstackNetworksService
Reference to OpenStack networks service.
17518 17519 17520 |
# File 'lib/ovirtsdk4/services.rb', line 17518 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 HTTP/1.1
17421 17422 17423 |
# File 'lib/ovirtsdk4/services.rb', line 17421 def remove(opts = {}) internal_remove(REMOVE, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
17529 17530 17531 17532 17533 17534 17535 17536 17537 17538 17539 17540 17541 17542 17543 17544 17545 17546 |
# File 'lib/ovirtsdk4/services.rb', line 17529 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 HTTP/1.1
17452 17453 17454 |
# File 'lib/ovirtsdk4/services.rb', line 17452 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 HTTP/1.1
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>
17500 17501 17502 |
# File 'lib/ovirtsdk4/services.rb', line 17500 def update(provider, opts = {}) internal_update(provider, OpenStackNetworkProvider, UPDATE, opts) end |