OpenStack.Net SDK cannot access services

We installed the OpenStack system on our own equipment, which installed all the components, and everything seemed to be fine, since we created networks and virtual machines through a web interface.

I am trying to use the openstack.net SDK to execute programmatically. I seem to be able to authenticate using the username and password, but when it comes to accessing other installed services, we get errors suggesting that the API endpoints are not accessible to the user.

The code we use is below, which works fine up to the CreateServer line, after which I get an error

"Failed to authenticate user and get authorized service endpoints."

 Uri baseUrl = new Uri("http://mycloudip:5000/v2.0");
 CloudIdentity cloudId = new CloudIdentity()
            {
                Username = userName,
                Password = password
            };
 CloudIdentityProvider cip = new CloudIdentityProvider(cloudId, baseUrl);
 UserAccess ua = cip.Authenticate(cloudId);

 CloudServersProvider provider = new CloudServersProvider(cloudId);

 Metadata metaData = new Metadata(); // Add some metadata just because we can
 metaData.Add("Description", "Example 4 - Getting Started");

 string serverName = "Example4";
 string imageId = "48df4181-040e-4821-8723-d9e4ba908d2f";
 string flavorId = "3";

NewServer newServer = provider.CreateServer(serverName, imageId, flavorId, DiskConfiguration.Manual, metaData);

URL- " → ", , UserAccess.ServiceCatalog, , .

.

+2
1

IIdentityProvider, CloudServersProvider openstack.net SDK 1.3.2.0, Rackspace. OpenStack , , :

OpenStack Authentication ( Openstack.net API)

:

OpenStack, , , DevStack Rackspace.

OpenStack .

CloudIdentityWithProject . CloudIdentityWithProject credentials tenantName tenantId, OpenStack.

OpenStackIdentityProvider .

, CloudFilesProvider CloudQueuesProvider, null CloudIdentity IIdentityProvider.

OpenStackIdentityProvider / ( , API- Identity Service v3).

+3

Source: https://habr.com/ru/post/1611552/


All Articles