Cinder API using jclouds

為{幸葍}努か 提交于 2019-12-25 02:56:12

问题


I have been reading about the support jclouds added to the Cinder Openstack API, and i was looking at this example usage on Rackspace Cloud.

https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudblockstorage/CreateVolumeAndAttach.java

does anybody know is this is supported for HP Cloud as well? if not, how can i use HP Cloud Block Storage with jclouds?

thanks a lot!


回答1:


You should be able to use the Cinder API with HP but I tried it out and it wasn't working. Here's what I did.

Iterable<Module> modules = ImmutableSet.<Module> of(new SLF4JLoggingModule());

RestContext<CinderApi, CinderAsyncApi> cinder = ContextBuilder.newBuilder("openstack-cinder")
  .endpoint("https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/")
  .apiVersion("1.1")
  .credentials(myHpTenantName + ":" + myHpUsername, myHpPassword)
  .modules(modules)
  .build(CinderApiMetadata.CONTEXT_TOKEN);
VolumeApi volumeApi = cinder.getApi().getVolumeApiForZone("az-1.region-a.geo-1");
System.out.println(volumeApi.list());

The call to list() returns an empty list but with logging turned on I can see that it's actually a 404 causing the empty list to be returned. The URL that's created to list the volumes is

https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/myHpTenantId/volumes

Which I think should be valid according to the HP service catalog but it's returning a 404.

I'll ping someone I know from HP and see if we can get to the bottom of this.




回答2:


HP Cloud's support for the OpenStack Block Storage (Cinder) API is coming soon. Please refer to our API documentation for reference to the currently supported Block Storage APIs: https://docs.hpcloud.com/api/block-storage/



来源:https://stackoverflow.com/questions/14598793/cinder-api-using-jclouds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!