OpenStack IdentityService Keystone V3 API Curl实战

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:

 

posted on 2014-09-24 08:59 秦瑞It行程实录 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/ruiy/p/3989791.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值