You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I believe there is a problem with how the URL is created for the Networking Service - there is no way (I can see) to add the version to the URL, so the request always fails.
for example - I use the in-package integration test "ListNetworkTest()" to try and get all of my networks. I get this:
Flurl.Http.FlurlHttpException
Request to http://:9696/networks failed with status code 404 (Not Found).
However, when I debug I can modify the URL that it gets (from the endpoint) to this: http://:9696/v2.0/networks
and then the service is working and I can see the networks.
BTW, Compute service is working fine with no problems.
Is there a way to add the version to the request URL without changing the core code ? or is this a real bug\over-looked problem ?
Thanks.
The text was updated successfully, but these errors were encountered:
Try this and let me know if it gets you unstuck. On my local openstack dev env, I always end up changing the service catalog to append /v2.0 to the Neutron endpoint to avoid this problem.
What this does is have the SDK retrieve and cache the service catalog, then use reflection to update the networking endpoint to add /v2.0. Then use the networking service as usual.
using System;using System.Linq;using net.openstack.Core.Domain;using net.openstack.Core.Providers;using OpenStack.Networking.v2;using OpenStack.Synchronous;namespaceAppendVersionToNeutronEndpoint{classProgram{staticvoidMain(string[]args){// 1. Authenticate and fill the service catalog cachevarregion="RegionOne";varidentityUrl="http://example.com:5000/v2";varuser=new CloudIdentityWithProject
{Username="username",Password="password",ProjectName="project"};varidentity=new OpenStackIdentityProvider(new Uri(identityUrl), user);varuserAccess= identity.Authenticate();// 2. Update the cached networking endpointvarnetworkingEndpoint= userAccess.ServiceCatalog.Single(svc => svc.Type =="network").Endpoints.Single(e => e.Region =="RegionOne");
networkingEndpoint.GetType().GetProperty("PublicURL").SetValue(networkingEndpoint,$"{networkingEndpoint.PublicURL}/v2.0");// 3. Access the networking service using the updated endpointvarnetworking=new NetworkingService(identity,"RegionOne");varnetworks= networking.ListNetworks();
Console.WriteLine($"Found {networks.Count()} network(s)!");
Console.ReadLine();}}}
Hi,
I believe there is a problem with how the URL is created for the Networking Service - there is no way (I can see) to add the version to the URL, so the request always fails.
for example - I use the in-package integration test "ListNetworkTest()" to try and get all of my networks. I get this:
Flurl.Http.FlurlHttpException
Request to http://:9696/networks failed with status code 404 (Not Found).
However, when I debug I can modify the URL that it gets (from the endpoint) to this: http://:9696/v2.0/networks
and then the service is working and I can see the networks.
BTW, Compute service is working fine with no problems.
Is there a way to add the version to the request URL without changing the core code ? or is this a real bug\over-looked problem ?
Thanks.
The text was updated successfully, but these errors were encountered: