OpenStack.NET: Change Service Endpoint URL

150 views Asked by At

I'm beginning to look into OpenStack Object Storage for a project. For this I use the OpenStack.NET library and C#. This library was created by RackSpace but I'm using a different OpenStack Provider.

I'm able to authenticate just fine by specifying the Authentication Service URL when instancing a new CloudIdentityProvider:

CloudIdentity foo = new CloudIdentity()
            {
                Username = userName,
                Password = password
            };
CloudIdentityProvider bar = new CloudIdentityProvider(new Uri("http://foo.bar"));
UserAccess ua = bar.Authenticate(foo);

This works nicely. However when I try to retrieve the Object Containers from a specified Region, I get an error:

CloudFilesProvider cfp = new CloudFilesProvider(foo, bar);            
IEnumerable<Container> listOfContainers = cfp.ListContainers(region:"SBG-1");

The second line above throws this error:

The user does not have access to the requested service or region.

Now I don't think that's what the actual error is, since this user is the one who created the Object Container from the provider's web interface. I'm thinking that maybe I need to explicitly need to specify the Service Endpoint URL (like I did for the authentication), but for the life of me I can't seem to find any way of doing that.

OpenStack.NET documentation is quite limited, and tend to stick to RackSpace and doesn't really get into generic examples.

0

There are 0 answers