0

I am learning OpenStack now and I want to list all accessible volumes on my OpenStack controller by HTTP get request with x_auth_token:

http://{OpenStack controller IP}:8776/v3/{project_id}/volumes

(Reference URL: https://developer.openstack.org/api-ref/block-storage/v3/index.html?expanded=#list-accessible-volumes)

But, the request body always as below:

    {
    "badRequest":{
    "message": "Malformed request url",
    "code": 400
    }
}

I have try many times but they all didn't work. So, I want to know, what the request url should be here? Thanks in advance.....

lyn
  • 53
  • 8
  • The first step is diagnosing API problems should be to run one of the existing command line clients in `--debug` mode. This will show you the exact requests that the client is making (so, run `cinder --debug list`). – larsks Mar 29 '17 at 12:50
  • I run 'cinder --debug list', but it didn't show the information I really understand, are there other things I can try to debug this issue? – lyn Mar 30 '17 at 11:46

1 Answers1

1

One of the possible reasons is that your project_id is incorrect or doesn't match your credential, take a look at this link. In order to solve this problem you can:
1. Try openstack command with debug option.

openstack --debug volume list
#or
cinder --debug list

you could get the request and response details:

REQ: curl -g -i -X GET http://ip:port/v3/{project_id}/volumes/detail -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: {token_value}"

Make sure you have input every required headers(context-type/x-auth-token/...).

  1. Try to ask for help in irc channel #openstack-cinder
TommyLike
  • 1,010
  • 11
  • 20