diff --git a/app/models/manageiq/providers/redhat/infra_manager/api_integration.rb b/app/models/manageiq/providers/redhat/infra_manager/api_integration.rb index 9e9018bc421..8656e171e07 100644 --- a/app/models/manageiq/providers/redhat/infra_manager/api_integration.rb +++ b/app/models/manageiq/providers/redhat/infra_manager/api_integration.rb @@ -21,16 +21,12 @@ def connect(options = {}) raise "version #{version} of the api is not supported by the provider" end - # If the API path is stored in the endpoints table then use it: - path = options[:path] || default_endpoint.path - _log.info("Using stored API path '#{path}'.") unless path.blank? - # Prepare the options to call the method that creates the actual connection: connect_options = { :scheme => options[:scheme] || 'https', :server => options[:ip] || address, :port => options[:port] || port, - :path => path, + :path => options[:path] || '/ovirt-engine/api', :username => options[:user] || authentication_userid(options[:auth_type]), :password => options[:pass] || authentication_password(options[:auth_type]), :service => options[:service] || "Service", @@ -56,7 +52,7 @@ def connect(options = {}) connection = self.class.public_send(connect_method, connect_options) # Copy the API path to the endpoints table: - default_endpoint.path = version.to_i == 4 ? '/ovirt-engine/api' : connection.api_path + default_endpoint.path = connect_options[:path] connection end diff --git a/spec/vcr_cassettes/manageiq/providers/redhat/infra_manager/refresh/refresher_3_1.yml b/spec/vcr_cassettes/manageiq/providers/redhat/infra_manager/refresh/refresher_3_1.yml index 7c20dae3d54..504926a40b6 100644 --- a/spec/vcr_cassettes/manageiq/providers/redhat/infra_manager/refresh/refresher_3_1.yml +++ b/spec/vcr_cassettes/manageiq/providers/redhat/infra_manager/refresh/refresher_3_1.yml @@ -2,18 +2,7 @@ http_interactions: - request: method: get - uri: https://192.168.252.230/api - response: - status: - code: 401 - message: Unauthorized - headers: - WWW-Authenticate: - - Basic realm="RESTAPI" - recorded_at: Tue, 26 Apr 2016 11:15:00 GMT -- request: - method: get - uri: https://evm%40manageiq.com:password@192.168.252.230/api + uri: https://evm%40manageiq.com:password@192.168.252.230/ovirt-engine/api body: encoding: US-ASCII string: '' @@ -42,20 +31,20 @@ http_interactions: Set-Cookie: - JSESSIONID=eyaOaNBaQj8SyEdzJeVk0Iyb; Path=/api; Secure Link: - - ; rel=capabilities,; - rel=clusters,; rel=clusters/search,; - rel=datacenters,; - rel=datacenters/search,; rel=events,; - rel=events/search,; rel=hosts,; - rel=hosts/search,; rel=networks,; - rel=roles,; rel=storagedomains,; - rel=storagedomains/search,; rel=tags,; - rel=templates,; rel=templates/search,; - rel=users,; rel=users/search,; - rel=groups,; rel=groups/search,; - rel=domains,; rel=vmpools,; - rel=vmpools/search,; rel=vms,; - rel=vms/search,; rel=disks,; + - ; rel=capabilities,; + rel=clusters,; rel=clusters/search,; + rel=datacenters,; + rel=datacenters/search,; rel=events,; + rel=events/search,; rel=hosts,; + rel=hosts/search,; rel=networks,; + rel=roles,; rel=storagedomains,; + rel=storagedomains/search,; rel=tags,; + rel=templates,; rel=templates/search,; + rel=users,; rel=users/search,; + rel=groups,; rel=groups/search,; + rel=domains,; rel=vmpools,; + rel=vmpools/search,; rel=vms,; + rel=vms/search,; rel=disks,; rel=disks/search Content-Type: - application/xml @@ -66,27 +55,27 @@ http_interactions: body: encoding: US-ASCII string: ! "\n\n - \ \n \n \n - \ \n \n \n - \ \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n + \ \n \n \n + \ \n + \ \n \n \n + \ \n \n \n \n + \ \n \n \n + \ \n \n \n \n + \ \n \n \n \n \n \n + \ \n \n \n \n \n Red Hat Enterprise Virtualization\n Red Hat\n \n \n @@ -100,7 +89,7 @@ http_interactions: recorded_at: Wed, 08 Oct 2014 01:27:21 GMT - request: method: get - uri: https://192.168.252.230/api/clusters + uri: https://192.168.252.230/ovirt-engine/api/clusters body: encoding: US-ASCII string: '' @@ -137,46 +126,46 @@ http_interactions: body: encoding: US-ASCII string: ! "\n\n - \ \n + \ \n \ iSCSI\n The default server cluster\n - \ \n \n \n \n \n \n \n + href=\"/ovirt-engine/api/datacenters/45b5a710-eccd-11e1-bc2c-005056a217db\" id=\"45b5a710-eccd-11e1-bc2c-005056a217db\"/>\n \ \n \n \n \ true\n \n \ \n \n \n \n migrate\n \ \n true\n false\n - \ \n \n \n NFS\n NFS\n - \ \n \n \n \n \n \n \n + href=\"/ovirt-engine/api/datacenters/773f2ddf-7765-42fc-85d6-673b718541cd\" id=\"773f2ddf-7765-42fc-85d6-673b718541cd\"/>\n \ \n \n \n \ true\n \n \ \n \n \n \n migrate\n \ \n true\n false\n - \ \n \n \n rhelh-nfs-Local\n - \ \n \n \n \n \n \n \n \ \n \n \ true\n \n \ \n \n \n \n migrate\n \ \n true\n false\n - \ \n \n \n temp\n - \ \n \n \n \n \n \n \n \ \n \n \ true\n \n @@ -188,7 +177,7 @@ http_interactions: recorded_at: Wed, 08 Oct 2014 01:27:21 GMT - request: method: get - uri: https://192.168.252.230/api/vmpools + uri: https://192.168.252.230/ovirt-engine/api/vmpools body: encoding: US-ASCII string: '' @@ -233,7 +222,7 @@ http_interactions: recorded_at: Wed, 08 Oct 2014 01:27:21 GMT - request: method: get - uri: https://192.168.252.230/api/networks + uri: https://192.168.252.230/ovirt-engine/api/networks body: encoding: US-ASCII string: '' @@ -270,32 +259,32 @@ http_interactions: body: encoding: US-ASCII string: ! "\n\n - \ \n + \ \n \ rhevm\n Management Network\n - \ \n false\n \ 0\n \n vm\n \n - \ \n \n \n iSCSI\n - \ \n false\n - \ 0\n \n \n 0\n \n \n \n vmnet\n - \ \n false\n - \ 0\n \n \n 0\n \n \n \n rhevm\n \ Management Network\n \n + href=\"/ovirt-engine/api/datacenters/773f2ddf-7765-42fc-85d6-673b718541cd\" id=\"773f2ddf-7765-42fc-85d6-673b718541cd\"/>\n \ false\n 0\n \n vm\n - \ \n \n \n \n \n Storage\n - \ \n false\n \ 0\n \n vm\n \n - \ \n \n \n invalid\n - \ \n false\n \ 0\n \n vm\n \n \ \n\n" @@ -303,7 +292,7 @@ http_interactions: recorded_at: Wed, 08 Oct 2014 01:27:22 GMT - request: method: get - uri: https://192.168.252.230/api/storagedomains?search=sortby%20name%20asc%20page%201 + uri: https://192.168.252.230/ovirt-engine/api/storagedomains?search=sortby%20name%20asc%20page%201 body: encoding: US-ASCII string: '' @@ -340,26 +329,26 @@ http_interactions: body: encoding: US-ASCII string: ! "\n\n - \ \n Export\n - \ \n \n \n \n \n export\n false\n \ \n nfs\n
192.168.252.65
\n \ /srv/export\n
\n 25769803776\n \ 37580963840\n 0\n v1\n - \
\n \n \n ISO\n \n \n \n iso\n false\n \ \n nfs\n
192.168.252.230
\n \ /srv/ISO\n
\n 27917287424\n \ 30064771072\n 0\n v1\n - \
\n \n \n NetApp01Lun2\n - \ \n data\n true\n \ \n iscsi\n \n \n \n \n \ 57982058496\n 48318382080\n \ 69793218560\n v3\n - \ \n \n \n RHEVM31-1\n - \ \n data\n false\n \ \n iscsi\n \n \n 137438953472\n \ 136365211648\n 228707008512\n \ v3\n \n \n - \ RHEVM31-NFS1\n \n + \ RHEVM31-NFS1\n \n data\n false\n \ \n nfs\n
192.168.252.30
\n \ /vol/rhev31share1/rhevm-data\n
\n \ 76235669504\n 10737418240\n \ 199715979264\n v3\n - \
\n \n \n RHEVM31-NFS2\n - \ \n data\n true\n \ \n nfs\n
192.168.252.30
\n \ /vol/rhev31share2/rhevm-data\n
\n \ 16106127360\n 1073741824\n \ 0\n v3\n - \
\n \n \n RHEVM31-Rspec1\n - \ \n data\n false\n \ \n iscsi\n \n \n 10737418240\n \ 4294967296\n 0\n v3\n - \ \n \n \n RHEVM31-gluster\n - \ \n data\n false\n \ \n
example.gluster.server.com
glusterfs\n \ /gv0
\n 16106127360\n @@ -416,7 +405,7 @@ http_interactions: recorded_at: Wed, 08 Oct 2014 01:27:22 GMT - request: method: get - uri: https://192.168.252.230/api/storagedomains?search=sortby%20name%20asc%20page%202 + uri: https://192.168.252.230/ovirt-engine/api/storagedomains?search=sortby%20name%20asc%20page%202 body: encoding: US-ASCII string: '' @@ -461,7 +450,7 @@ http_interactions: recorded_at: Wed, 08 Oct 2014 01:27:22 GMT - request: method: get - uri: https://192.168.252.230/api/datacenters + uri: https://192.168.252.230/ovirt-engine/api/datacenters body: encoding: US-ASCII string: '' @@ -498,20 +487,20 @@ http_interactions: body: encoding: US-ASCII string: ! "\n\n - \ \n Default\n - \ iSCSI\n \n \n iSCSI\n \n \n \n iscsi\n v3\n \ \n \n \ \n \n \ \n up\n \n \n - \ \n NFS\n \n \n \n \n \n nfs\n v3\n \ \n \n \ \n \n @@ -520,7 +509,7 @@ http_interactions: recorded_at: Wed, 08 Oct 2014 01:27:22 GMT - request: method: get - uri: https://192.168.252.230/api/hosts?search=sortby%20name%20asc%20page%201 + uri: https://192.168.252.230/ovirt-engine/api/hosts?search=sortby%20name%20asc%20page%201 body: encoding: US-ASCII string: '' @@ -557,25 +546,25 @@ http_interactions: body: encoding: US-ASCII string: ! "\n\n - \ \n - \ \n \n \n \n \n \n \n \n \n + \ \n \n \n \n \n \n \n \n \n \n per410-rh1\n - \ \n \n \n \n \n \n \n \n \n
192.168.252.232
\n \n \ manageiq.com\n O=manageiq.com,CN=192.168.252.232\n \ \n \n up\n - \ \n \n \n 54321\n \ rhel\n true\n \ \n false\n \n @@ -588,26 +577,26 @@ http_interactions: Xeon(R) CPU E5504 @ 2.00GHz\n 1995\n \
\n 59069431808\n 87125131264\n \ \n 1\n 0\n - \ 1\n \n \n 1\n \n \n \n \n \n - \ \n \n \n \n \n \n \n + \ \n \n \n \n \n \n \n \n rhelh-nfs\n \n - \ \n \n \n \n + \ \n \n \n \n
192.168.252.233
\n \n \ manageiq.com\n O=manageiq.com,CN=192.168.252.233\n \ \n \n up\n - \ \n \n \n 54321\n \ rhel\n true\n \ \n false\n \n @@ -625,7 +614,7 @@ http_interactions: recorded_at: Wed, 08 Oct 2014 01:27:22 GMT - request: method: get - uri: https://192.168.252.230/api/hosts?search=sortby%20name%20asc%20page%202 + uri: https://192.168.252.230/ovirt-engine/api/hosts?search=sortby%20name%20asc%20page%202 body: encoding: US-ASCII string: '' @@ -670,7 +659,7 @@ http_interactions: recorded_at: Wed, 08 Oct 2014 01:27:23 GMT - request: method: get - uri: https://192.168.252.230/api/vms?search=sortby%20name%20asc%20page%201 + uri: https://192.168.252.230/ovirt-engine/api/vms?search=sortby%20name%20asc%20page%201 body: encoding: US-ASCII string: '' @@ -707,25 +696,25 @@ http_interactions: body: encoding: US-ASCII string: ! "\n\n - \ \n - \ \n \n \n \n \n \n \n \n \n \n \n + \ \n \n \n \n \n \n \n \n \n \n \n \n aab_demo_vm\n \n - \ \n \n \n \n \n \n \n \n \n \n \n \n \n server\n \n down\n \ \n 1073741824\n \n \n \n \n @@ -733,33 +722,33 @@ http_interactions: \ false\n 1\n \ \n \n spice\n \ 1\n false\n - \ \n \n