Put方法在OpenStack中不起作用

时间:2022-01-20 15:21:37

I used below method to get Auth-token and i got the output as below.But if use that id as Auth-token for PUT method it's not working it's showing as explained below.

我使用下面的方法来获取Auth-token,我得到了如下输出。但是如果使用该ID作为PUT方法的Auth-token,它将无法正常显示,如下所述。

curl -sd '{"auth":{"passwordCredentials":{"username": "admin", "password": "password"}}}' -H "Content-type: application/json" http://169.0.0.11:5000/v2.0/tokens | python -m json.tool

curl -sd'{“auth”:{“passwordCredentials”:{“username”:“admin”,“password”:“password”}}}'-H“Content-type:application / json”http://169.0 .0.11:5000 / v2.0 / tokens | python -m json.tool

{
"access": {
    "metadata": {
        "is_admin": 0,
        "roles": []
    },
    "serviceCatalog": [],
    "token": {
        "audit_ids": [
            "GgpxHyihQVyuI1ryerQZVw"
        ],
        "expires": "2016-08-15T16:11:49Z",
        "id": "bcced26a96304e8197fa85e110df9aa2",
        "issued_at": "2016-08-15T15:11:49.386446"
    },
    "user": {
        "id": "a5064af3b125449a9a09e9b69966f843",
        "name": "admin",
        "roles": [],
        "roles_links": [],
        "username": "admin"
    }
}

}

}

curl -i -X PUT "X-Auth-Token:bcced26a96304e8197fa85e110df9aa2" http://169.0.0.11/dashboard/project/containers/test/mymusic/
but its saying that Could not resolve host: X-AUTH-TOKEN HTTP/1.1 301 MOVED PERMANENTLY
can any one help me to solve this problem please.

curl -i -X PUT“X-Auth-Token:bcced26a96304e8197fa85e110df9aa2”http://169.0.0.11/dashboard/project/containers/test/mymusic/但它的说法无法解析主机:X-AUTH-TOKEN HTTP / 1.1 301永久移动任何人都可以帮我解决这个问题。

1 个解决方案

#1


0  

I believe you have missed to add -H for Header, rest looks fine.

我相信你错过了为Header添加-H,休息看起来很好。

curl -i -X PUT -H "X-Auth-Token:bcced26a96304e8197fa85e110df9aa2" http://169.0.0.11/dashboard/project/containers/test/mymusic/

#1


0  

I believe you have missed to add -H for Header, rest looks fine.

我相信你错过了为Header添加-H,休息看起来很好。

curl -i -X PUT -H "X-Auth-Token:bcced26a96304e8197fa85e110df9aa2" http://169.0.0.11/dashboard/project/containers/test/mymusic/