Description
データベースサービスを作成します。
Request URL
Database API v1.0 POST /v1/services
Request Paramters
| Parameter | Value | Style | Type | Description |
|---|---|---|---|---|
| X-Auth-Token | - | header | string | Userトークン |
| service_name | - | plain | string | サービス名 文字種:[A-Za-z0-9-_] 文字長:255 |
| metadata(Optional) | - | plain | dict | メタデータのキーと値のペア 文字種:[a-zA-Z0-9./%_:- ] 文字長:255(キーと値共に) |
Response Paramters
| Parameter | Value | Style | Type | Description |
|---|---|---|---|---|
| service_id | - | plain | UUID | サービスID |
| service_name | - | plain | string | サービス名 |
| create_date | - | plain | string | 作成日時 |
| quota | - | plain | int | 使用容量上限値(単位GB) |
| total_usage | 0 | plain | float | 使用容量合算値(単位GB)、小数点第二位まで表示 |
| status | active | plain | string | ステータス |
| backup | enable/disable | plain | string | バックアップ有効フラグ |
| prefix | - | plain | string | プレフィックス 一意の文字列をランダムで生成 |
| metadata | - | plain | dict | メタデータ キーと値の辞書オブジェクト |
Request Json
{
"service_name": "dbservice01",
"metadata" : {
"key" : "value"
}
}
Normal response codes
200 - Success
Error response codes
400 - Bad Request
401 – Access Denied
Repeatable
No
Example
curl -i -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Auth-Token: 39be9f8d53044388b7f2e867eba8b140" \
-d
'{
"service_name": "dbservice01",
"metadata" : {
"key" : "value"
}
}' \
https://database-hosting.tyo1.cloud.z.com/v1/services
HTTP/1.1 200 Success
Date: Tue, 09 Dec 2014 01:46:58 GMT
Server: Apache
Content-Length: 1003
Content-Type: application/json
{
"service" : {
"service_id": "9d6441f6-c5a0-4dcf-a1a9-1a4d724e51fd",
"service_name": "dbservice01",
"create_date": "2012-11-02T19:56:26Z",
"quota": 10,
"total_usage": 0,
"status": "active",
"backup": "disable",
"prefix" : "02p8y",
"metadata" : {
"key" : "value"
}
}
}