v3 API Examples Using Curl
<Tokens>
1,Default scope 获取token
Get an token with default scope (may be unscoped):
Tips CLI如下:
curl -i \
-H "Content-Type: application/json" \
-d '
{ "auth": {
"identity": {
"methods": ["password"],
"password": {
"user": {
"name": "demo",
"domain": { "id": "default" },
"password": "321"
}
}
}
}
}' \
http://5.10.124.181:5000/v3/auth/tokens ; echo
2,Project-scoped
Get a project-scoped token:
curl -i \
-H "Content-Type: application/json" \
-d '
{ "auth": {
"identity": {
"methods": ["password"],
"password": {
"user": {
"name": "demo",
"domain": { "id": "default" },
"password": "321"
}
}
},
"scope": {
"project": {
"name": "demo_project",
"domain": { "id": "default" }
}
}
}
}' \
http://5.10.124.181:5000/v3/auth/tokens ; echo
3,Domain-Scoped
Get a domain-scoped token (Note that you’re going to need a role-assignment on the domain first!):
curl -i \
-H "Content-Type: application/json" \
-d '
{ "auth": {
"identity": {
"methods": ["password"],
"password": {
"user": {
"name": "admin",
"domain": { "id": "default" },
"password": "321"
}
}
},
"scope": {
"domain": {
"id": "default"
}
}
}
}' \
http://5.10.124.181:5000/v3/auth/tokens ; echo
4,Getting a token from a token
5,DELETE /v3/auth/tokens
Revoke a token:
<二,Domains>
Get /v3/domains
List domains:
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步