亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

如何進行keystone rest api V3 版本測試

發布時間:2021-12-23 18:15:35 來源:億速云 閱讀:151 作者:柒染 欄目:云計算

如何進行keystone rest api V3 版本測試,針對這個問題,這篇文章詳細介紹了相對應的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

  1. 用戶認證,默認域的token

    curl -i \
      -H "Content-Type: application/json" \
      -d '
    {
        "auth": {
            "identity": {
                "methods": [
                    "password"
                ],
                "password": {
                    "user": {
                        "domain": {"id":"default"},
                        "name": "admin",
                        "password": "openstack"
                    }
                }
            }
        }
    }' \
      http://localhost:5000/v3/auth/tokens ; echo


    HTTP/1.1 201 Created
    X-Subject-Token: ecfc51857b5747d2b6438f17e5e2fe0c
    Vary: X-Auth-Token
    Content-Type: application/json
    Content-Length: 297
    X-Openstack-Request-Id: req-86ba31ca-0d90-4130-b6cc-01ebfeb74b31
    Date: Fri, 15 Jan 2016 02:20:34 GMT
    
    {"token": {"methods": ["password"], "expires_at": "2016-01-15T03:20:34.170384Z", "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "ddce55e5af8241ec96e39e511a4928a1", "name": "admin"}, "audit_ids": ["lJW70I0bTcOl5tQ27kKP0Q"], "issued_at": "2016-01-15T02:20:34.170469Z"}}


    保存返回的Header,

    X-Subject-Token: ecfc51857b5747d2b6438f17e5e2fe0c


  2. 帶上token和project,獲取另一個token

    curl -i \
      -H "Content-Type: application/json" \
      -d '
    {
      "auth": {
        "identity": {
          "methods": [
            "token"
          ],
          "token": {
            "id": "ecfc51857b5747d2b6438f17e5e2fe0c"
          }
        },
        "scope": {
          "project": {
            "name": "admin",
            "domain": {
              "name": "default"
            }
          }
        }
      }
    }' \
      http://localhost:5000/v3/auth/tokens ; echo


    HTTP/1.1 201 Created
    X-Subject-Token: 76d45acefa7d4b928a5573db3a5ff39e
    Vary: X-Auth-Token
    Content-Type: application/json
    Content-Length: 4858
    X-Openstack-Request-Id: req-1b637a94-66bb-4a05-83b5-b1531c85a56d
    Date: Fri, 15 Jan 2016 02:32:02 GMT
    
    {"token": {"methods": ["token", "password"], "roles": [{"id": "a7db951cbc0040bfab9f1b9124b9e6a9", "name": "admin"}], "expires_at": "2016-01-15T03:20:34.170384Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "name": "admin"}, "catalog": [{"endpoints": [{"region_id": "RegionOne", "url": "http://172.16.10.33:8776/v1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "internal", "id": "62c8ac942c8b4930936ebc15d02016ea"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:8776/v1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "public", "id": "95fac1cf199345a6b30cf216ada6114a"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:8776/v1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "admin", "id": "c8b4bd03de5b494b8dad82b811af883b"}], "type": "volume", "id": "58f08b76576c4d13b79c691fbc7cae11", "name": "cinder"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://172.16.10.33:35357/v2.0", "region": "RegionOne", "interface": "admin", "id": "04ae0815504e4b01bb69096de2655ed7"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:5000/v2.0", "region": "RegionOne", "interface": "public", "id": "a3e08f9bf91845cbb01ee17b4381fef8"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:5000/v2.0", "region": "RegionOne", "interface": "internal", "id": "c4d004f6ff9449ecb4beb3a3ade79a5b"}], "type": "identity", "id": "5a7e533e712b46dcbc1b520dadc1d17f", "name": "keystone"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://172.16.10.33:8774/v2/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "public", "id": "4e09a9f6eb8342feac18753b47f34014"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:8774/v2/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "admin", "id": "96685c58c74c408fa2eb30555cd9e4e5"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:8774/v2/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "internal", "id": "e8802a42ed664c25af8f60998c503240"}], "type": "compute_legacy", "id": "7ec54c4e744c44d48e3f9fa435daabbe", "name": "nova_legacy"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://172.16.10.33:8776/v2/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "internal", "id": "1ef7bbe882bf4a04a33332de35c70e84"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:8776/v2/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "public", "id": "64b1b4be5a8548e5b1e7343feec38c3d"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:8776/v2/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "admin", "id": "7f1635373c9b4651867bdccda1a0f8d1"}], "type": "volumev2", "id": "874e95350ad84f0998d4a809ad4925ea", "name": "cinderv2"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://172.16.10.33:9696/", "region": "RegionOne", "interface": "internal", "id": "4bb75d5dea254955ab0e237f44572ddf"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:9696/", "region": "RegionOne", "interface": "admin", "id": "6f8c2b0902a54ec39ecbeea8877ec9a7"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:9696/", "region": "RegionOne", "interface": "public", "id": "cf888a8965944479a5df1b8007eb84db"}], "type": "network", "id": "9d207ba3d5c248fd911cfcce51ef814a", "name": "neutron"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://172.16.10.33:8774/v2.1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "internal", "id": "1b7f94fa75964ee7aa501d28573333a2"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:8774/v2.1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "public", "id": "3217e1bb5f114c268c74e8d1550912d6"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:8774/v2.1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d", "region": "RegionOne", "interface": "admin", "id": "d0796d4c2ddb4a67a339908158945d49"}], "type": "compute", "id": "df1c318a37ec432c82571c15ac6442c8", "name": "nova"}, {"endpoints": [{"region_id": "RegionOne", "url": "http://172.16.10.33:9292", "region": "RegionOne", "interface": "admin", "id": "15baf7fdf5e348e59294f1eda171dc67"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:9292", "region": "RegionOne", "interface": "public", "id": "1acb1f06c7d44885969e4facd2e478ae"}, {"region_id": "RegionOne", "url": "http://172.16.10.33:9292", "region": "RegionOne", "interface": "internal", "id": "8c775c8498684cb1847b79a640849427"}], "type": "image", "id": "e5a05e1e70894013a4533e748c9c5e87", "name": "glance"}], "extras": {}, "user": {"domain": {"id": "default", "name": "Default"}, "id": "ddce55e5af8241ec96e39e511a4928a1", "name": "admin"}, "audit_ids": ["qa8u-5naTXiolgh6vXM2Dg", "lJW70I0bTcOl5tQ27kKP0Q"], "issued_at": "2016-01-15T02:32:02.755979Z"}}

    返回一個在project范圍內的token:X-Subject-Token: 76d45acefa7d4b928a5573db3a5ff39e
    body內包含許多endpoint

  3. 這時就可以使用token向其他服務發起請求。例如:獲取flavors

    curl -i   -H "X-Auth-Token: 76d45acefa7d4b928a5573db3a5ff39e"   http://localhost:8774/v2.1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors; echo


    HTTP/1.1 200 OK
    Content-Type: application/json
    Content-Length: 1692
    X-Openstack-Nova-Api-Version: 2.1
    Vary: X-OpenStack-Nova-API-Version
    X-Compute-Request-Id: req-58676e13-4aea-4152-acca-00ea3f87e923
    Date: Fri, 15 Jan 2016 02:46:50 GMT
    
    {"flavors": [{"id": "1", "links": [{"href": "http://localhost:8774/v2.1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/1", "rel": "self"}, {"href": "http://localhost:8774/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/1", "rel": "bookmark"}], "name": "m1.tiny"}, {"id": "2", "links": [{"href": "http://localhost:8774/v2.1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/2", "rel": "self"}, {"href": "http://localhost:8774/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/2", "rel": "bookmark"}], "name": "m1.small"}, {"id": "3", "links": [{"href": "http://localhost:8774/v2.1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/3", "rel": "self"}, {"href": "http://localhost:8774/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/3", "rel": "bookmark"}], "name": "m1.medium"}, {"id": "4", "links": [{"href": "http://localhost:8774/v2.1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/4", "rel": "self"}, {"href": "http://localhost:8774/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/4", "rel": "bookmark"}], "name": "m1.large"}, {"id": "42", "links": [{"href": "http://localhost:8774/v2.1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/42", "rel": "self"}, {"href": "http://localhost:8774/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/42", "rel": "bookmark"}], "name": "m1.nano"}, {"id": "5", "links": [{"href": "http://localhost:8774/v2.1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/5", "rel": "self"}, {"href": "http://localhost:8774/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/5", "rel": "bookmark"}], "name": "m1.xlarge"}, {"id": "84", "links": [{"href": "http://localhost:8774/v2.1/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/84", "rel": "self"}, {"href": "http://localhost:8774/9c2b1ae7eb0d48e2b7ed3b4399ee4d3d/flavors/84", "rel": "bookmark"}], "name": "m1.micro"}]}

關于如何進行keystone rest api V3 版本測試問題的解答就分享到這里了,希望以上內容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關注億速云行業資訊頻道了解更多相關知識。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

宁化县| 毕节市| 澎湖县| 光泽县| 谷城县| 雷山县| 黄冈市| 昌图县| 鄯善县| 石首市| 宿迁市| 焉耆| 晋城| 三原县| 新郑市| 佛学| 五河县| 宜兰县| 泗水县| 南投市| 仙游县| 商城县| 凯里市| 马关县| 灵丘县| 永济市| 宿州市| 新巴尔虎左旗| 浏阳市| 新蔡县| 沈丘县| 尤溪县| 沛县| 湘西| 区。| 同仁县| 澄城县| 湘潭县| 涟水县| 革吉县| 登封市|