openstack curl get token in v3.0
来源:互联网 发布:淘宝试用申请要多久 编辑:程序博客网 时间:2024/06/11 21:47
1.首先通过编辑器将如下内容写入token-requset.json
{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "domain": { "name": "Default" }, "name": "admin", "password": "$PASSWORD" } } }, "scope": { "project": { "domain": { "name": "Default" }, "name": "admin" } } }}
2.为了方便将token设为变量TOKEN
TOKEN=`curl -si -d @token-request.json -H "Content-type: application/json" http://localhost:35357/v3/auth/tokens | awk '/X-Subject-Token/ {print $2}'`
3.举例
#列出domain
curl -si -H"X-Auth-Token:$TOKEN" -H "Content-type: application/json" http://localhost:35357/v3/domains
结果:
HTTP/1.1 200 OKDate: Thu, 09 Feb 2017 06:03:15 GMTServer: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5Vary: X-Auth-Tokenx-openstack-request-id: req-666baa76-025f-406a-a4c9-3433d209b3b3Content-Length: 303Content-Type: application/json{"domains": [{"links": {"self": "http://localhost:35357/v3/domains/28b49b2aab5745e3b70bcaae31d6c7ca"}, "description": "Default Domain", "name": "default", "enabled": true, "id": "28b49b2aab5745e3b70bcaae31d6c7ca"}], "links": {"self": "http://localhost:35357/v3/domains", "previous": null, "next": null}}
#列出user
curl -si -H"X-Auth-Token:$TOKEN" -H "Content-type: application/json" http://localhost:35357/v3/users
结果:
HTTP/1.1 200 OKDate: Thu, 09 Feb 2017 06:04:28 GMTServer: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5Vary: X-Auth-Tokenx-openstack-request-id: req-e164b49e-1ba3-4ddd-9962-6fae3ae86936Content-Length: 1129Content-Type: application/json{"users": [{"name": "glance", "links": {"self": "http://localhost:35357/v3/users/6c347306068b45078e888071062d967b"}, "domain_id": "28b49b2aab5745e3b70bcaae31d6c7ca", "enabled": true, "id": "6c347306068b45078e888071062d967b", "default_project_id": "b5f70a0341ea4e20a454b4d0b72aebb5"}, {"name": "nova", "links": {"self": "http://localhost:35357/v3/users/6d6471538d824a6685f8ce970ae49f6b"}, "domain_id": "28b49b2aab5745e3b70bcaae31d6c7ca", "enabled": true, "id": "6d6471538d824a6685f8ce970ae49f6b", "default_project_id": "b5f70a0341ea4e20a454b4d0b72aebb5"}, {"name": "neutron", "links": {"self": "http://localhost:35357/v3/users/723241a45b9748be9136c1df15da47b6"}, "domain_id": "28b49b2aab5745e3b70bcaae31d6c7ca", "enabled": true, "id": "723241a45b9748be9136c1df15da47b6", "default_project_id": "b5f70a0341ea4e20a454b4d0b72aebb5"}, {"name": "admin", "links": {"self": "http://localhost:35357/v3/users/df9e6dce8f0a479c874a324a8c0a3ce5"}, "enabled": true, "id": "df9e6dce8f0a479c874a324a8c0a3ce5", "domain_id": "28b49b2aab5745e3b70bcaae31d6c7ca"}], "links": {"self": "http://localhost:35357/v3/users", "previous": null, "next": null}}
0 0
- openstack curl get token in v3.0
- openstack restAPI v3 token
- Fernet Token in Keystone v3 (by quqi99)
- Create a token never expires in Openstack
- Get Bearer Token when login in
- curl openstack
- curl 访问openstack keystone v3 时出现The request you have made requires authentication 401
- curl get
- openstack keystone token-get报错'NoneType' object has no attribute 'has_service_catalog'
- How to switch from POST to GET in PHP CURL
- OpenStack Identity API v3
- Openstack keystone v3 版本
- CURL 测试openstack
- openstack cli curl 命令
- openstack authentication api & curl
- Openstack keystone token to memcache
- openstack keystone v2 to v3
- openstack keystone v2 to v3
- python 整数浮点数小数的转换,时间与时间戳的转换
- STL算法-排列算法
- linux时钟管理clk_get函数分析
- http协议之状态码详解
- java中的实例变量
- openstack curl get token in v3.0
- hello,这是博客的第一篇文章
- 短信验证码攻击问题
- spring框架下的 @Qualifier注解
- java常用jar包的作用大全
- ffmpeg h264 硬编码 nvenc
- Maven仓库搭建(二):GitHub、又拍云、七牛云存储
- Windows 10 IoT Serials 5
- enable password 7