求帮助:有人尝试过java调用openstack提供的curl指令吗?怎么调用呢?

解决方案 »

  1.   

    用过,可以这么调用:
    curl -X POST http://10.11.83.139:5000/v2.0/tokens -d '{"auth":{"passwordCredentials":{"username":"admin","password":"letmein"}}}' -H "Content-Type:application/json"
      

  2.   

    curl -X POST http://10.11.83.139:5000/v2.0/tokens -d '{"auth":{"passwordCredentials":{"username":"admin","password":"letmein"}}}' -H "Content-Type:application/json"
      

  3.   

    创建一个存储container的方法,这么调用,
     
    HttpPut hpp=new HttpPut(surl+"/container3");
            hpp.addHeader(h2);                
            rsp=httpContainerclient.execute(hpp);  
            entity=rsp.getEntity();  
    用java的HttpGet,HttpHead,HttpPut,HttpDelete方法