MENU

Description
データベースのアカウントを作成します。

Request URL

Database API v1.0

POST /v1/users

Request Paramters

Parameter Value Style Type Description
X-Auth-Token - header string Userトークン
service_id - plain UUID サービスID
user_name - plain string ユーザ名 文字種:[a-z0-9_] 文字長:1-14文字
password - plain string パスワード 文字種:以下参照 文字長:9~70文字
hostname - plain string 接続許可ホスト名 文字種:[a-zA-Z0-9./%_:-](大文字の場合は小文字に自動変換) 文字長:60
memo(Optional) - plain string メモ 文字種:印字可能なASCII文字 文字長:255

※パスワードについて
・半角英大文字と、半角英小文字と、半角数字または記号の組み合わせ以外はエラー
・使用可能な記号:!#$%&?“'=+-_{}[]^~:;().,/|\*@

Response Paramters

Parameter Value Style Type Description
service_id - plain UUID サービスID
user_id - plain UUID ユーザID
user_name - plain string ユーザー名 プリフィックス+“_”+リクエスト時に指定したuser_name
hostname - plain string 接続許可ホスト名
memo - plain string メモ
status creating plain string ステータス

Request Json

{
    "service_id": "9d6441f6-c5a0-4dcf-a1a9-1a4d724e51fd",
    "user_name": "dbuser001",
    "password": "wa6g76w08#",
    "hostname": "cl1.example.com",
    "memo": "memo"
}

Normal response codes

200 - Success

Error response codes

409 - Conflict
400 - Bad Request
401 - Access Denied

Repeatable

No

Example
※エンドポイントURLにつきましては、お客様環境によって異なりますので、コントロールパネルにてご確認の上ご利用ください。

  • REQ
curl -i -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Auth-Token: 39be9f8d53044388b7f2e867eba8b140" \
-d
'{
    "service_id": "9d6441f6-c5a0-4dcf-a1a9-1a4d724e51fd",
    "user_name": "dbuser001",
    "password": "wa6g76w08#",
    "hostname": "cl1.example.com",
    "memo": "memo"
}' \
https://database-hosting.tyo1.conoha.io/v1/users
  • RES
HTTP/1.1 200 Success
Date: Tue, 09 Dec 2014 01:46:58 GMT
Server: Apache
Content-Length: 1003
Content-Type: application/json
{
  "user" : {
      "service_id": "9d6441f6-c5a0-4dcf-a1a9-1a4d724e51fd",
      "user_id": "5f02c821-977f-4160-812d-397a5e3c7caa",
      "user_name": "02p8y_dbuser001",
      "hostname": "cl1.example.com",
      "memo": "memo",
        "status": "creating"
    }
}