トークン発行
Description
有効なトークン情報を取得します。
Request URL
identity API v2.0 POST /v2.0/tokens
Request Json
# テナント ID 指定 { "auth": { "passwordCredentials": { "username": "ユーザー名", "password": "パスワード" }, "tenantId": "テナントID" } } # テナント名指定 { "auth": { "passwordCredentials": { "username": "ユーザー名", "password": "パスワード" }, "tenantName": "テナント名" } }
Request Parameters
Parameter | Value | Style | Description |
---|---|---|---|
username | ユーザー名 | plain | ユーザー名 |
password | パスワード | plain | パスワード |
tenantId (Optional) | テナントID | plain | テナントID |
tenantName(Optional) | テナント名 | plain | テナント名 |
Response
-
Normal response codes
200
Example
-
Request
curl -i -X POST \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{"auth":{"passwordCredentials":{"username": "ユーザー名", "password": "パスワード"},"tenantName":"テナント名"}}' \ https://identity.jpt1.cloud.z.com/v2.0/tokens
-
Response
HTTP/1.1 200 OK Date: Tue, 05 Jul 2016 09:58:52 GMT Server: Apache Content-Length: 1586 Content-Type: application/json { "access": { "token": { "issued_at": "2016-07-05T09:58:52.911720", "expires": "2016-07-06T09:58:52Z", "id": "トークンID", "tenant": { "id": "テナントID", "enabled": true, "domain_id": "zjp", "name": "テナント名", "description": "" }, "audit_ids": [ "jQ8_Qxe5S2yJI7ht-Kjn1w" ] }, "serviceCatalog": [ { "endpoints": [ { "region": "jpt1", "publicURL": "https://account.jpt1.cloud.z.com/v1/テナントID" } ], "endpoints_links": [], "type": "account", "name": "Account Service" }, { "endpoints": [ { "region": "jpt1", "publicURL": "https://compute.jpt1.cloud.z.com/v2/テナントID" } ], "endpoints_links": [], "type": "compute", "name": "Compute Service" }, { "endpoints": [ { "region": "jpt1", "publicURL": "https://networking.jpt1.cloud.z.com" } ], "endpoints_links": [], "type": "network", "name": "Network Service" }, { "endpoints": [ { "region": "jpt1", "publicURL": "https://block-storage.jpt1.cloud.z.com/v2/テナントID" } ], "endpoints_links": [], "type": "volumev2", "name": "Volume Service" }, { "endpoints": [ { "region": "jpt1", "publicURL": "https://image-service.jpt1.cloud.z.com" } ], "endpoints_links": [], "type": "image", "name": "Image Service" }, { "endpoints": [ { "region": "jpt1", "publicURL": "https://identity.jpt1.cloud.z.com/v2.0" } ], "endpoints_links": [], "type": "identity", "name": "Identity Service" } ], "user": { "username": "ユーザー名", "roles_links": [], "id": "examplea6963c074d7csample12a886ee", "roles": [ { "name": "SwiftOperator" }, { "name": "_member_" } ], "name": "ユーザー名" }, "metadata": { "is_admin": 0, "roles": [ "0cd9f6c041aeb366abb6c6e3d8c6", "71916e0145908ea042a048ad8911" ] } } }