www.cnblogs.com/ruiyqinrui

开源、架构、Linux C/C++/python AI BI 运维开发自动化运维。 春风桃李花 秋雨梧桐叶。“力尽不知热 但惜夏日长”。夏不惜,秋不获。@ruiY--秦瑞

python爬虫,C编程,嵌入式开发.hadoop大数据,桉树,onenebula云计算架构.linux运维及驱动开发.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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行程实录  阅读(975)  评论(0编辑  收藏  举报
www.cnblogs.com/ruiyqinrui