dataset

 これはGoogleの自動翻訳です

2015-04-23

Overview

Manipulate the user's data set. Reference: About data sets

URL Syntax

https: // {node name} .teracloud.jp / {major version} / api / {resource} / {dataset name} {; MatrixParameter} {/ Suffix}

{Major version}

v2

{Node name}

Name of the node server. It is possible to know the node server for each user by accessing the user resource.

{resource}

dataset

{Dataset name}

Data set name. [A - Za - z 0 - 9] [A - Za - z 0 - 9. _ / -] +. Because there is a hierarchy, keep in mind the existence of "/".

{MatrixParameter}

The MatrixParameter of each method.

{/ Suffix}

Subelements for dataset. It is intended to give different kinds of methods (actions) to the same resource.

| Example: Properties of a dataset for a dataset name.

Method table

SUFFIX

Method

MatrixParam

Return value (xml / json)

Description

GET

recursive, type

Status code, name of dataset

List of datasets

PUT

mountpoint

Status code

Create dataset

DELETE

recursive

Status code

Clear dataset

POST

None

(property) ~ Unimplemented ~

GET

property

Status code, property value

Getting properties of dataset

PUT

property

Status code

Set properties of dataset

DELETE

property

Status code, property value

Delete the property of dataset and match it with parent. Return as a return value on what has changed

POST

None

(snapshot) ~ Unimplemented ~

GET

Status code, name of dataset List of snapshots of dataset.

Equivalent to GET of dataset with type = snapshot

PUT

Status code

Create a snapshot. Specify it as filesystem @ snapshot.

DELETE

Status code

Delete the snapshot. It is basically the same as DELETE of dataset, but it determines whether the dataset is snapshot (whether the dataset contains characterwise @).

POST

None

(clone) ~ Unimplemented ~

GET

None

PUT

Status code

Create a snapshot. Specify it as filesystem @ snapshot.

DELETE

None

POST

None

(unique)

GET

None

PUT

Status code, created dataset, mount point Make a dataset with a unique name.

Returns the created data set name and mount point.

DELETE

None

POST

None

Common parameters

Dataset name

Any ZFS dataset owned by the authenticated user.

The naming convention needs to conform to the regular expression: [A - Za - z 0 - 9] [A - Za - z 0 - 9. _ - /] +.

/ Means ZFS dataset hierarchy.

If you omit the dataset name, you are specifying the location right under the authenticated user.

API KEY

Make the following as the URL as Matrix Parameter

; api_key = EA703E7AA1EFDA0064EAA507D9E8AB7E

Example:

GET / v2 / api / dataset; api_key = EA 703 E 7 AA 1 EFDA 006 AEA 50 D 9 E 8 AB 7 E

Alternatively, write the following in the HTTP Header

X-TeraCLOUD-API-KEY: EA 703 E 7 A A 1 EFDA 006 AEA 50 D 9 E 8 AB 7 E

dataset

GET dataset

GET / v2 / api / dataset [/ dataset name] [; MatrixParameter]

Output a list of data sets. Recursive designation can also process lower order.

Property command and role suffer, but the difference is as follows.

merit

Demerit

This resource

Returned as list type

Slightly slow

Numeric system is for display because it is rounded

XML type request can not be made.

property

Value is fine

Numbers are not rounded

You can request XML type

I can not take it all together

MatrixParameter

recursive

Recursively output lower-level resources. Valid with true, TRUE, 1 etc.

type

Type to output. Any, filesystem, snapshot. The default is filesystem.

An example

GET / v2 / api / dataset / backup; type = all; recursive = true

Return value

HTTP response code

200 OK

success. XML / JSON data is returned.

404 NOT_FOUND

There is no specified data set.

503 SERVICE UNAVAILABLE

An internal error occurred

Example of JSON format (no XML type)

{

 "data":

   [

     "" dpool1 / data / kohju / backup "," none "," 1.58M "," 1.09M "," 496K "," / dpool1 / data / kohju / backup "," Mon May 19 15: 59 2014 " "yes", "on", "1.00 x"]

   ],

 "meta":

   ["name", "quota", "used", "usedbydataset", "usedbysnapshots", "mountpoint", "creation", "mounted", "canmount", "compress ratio"],

 "result": 0

}

meta

Describe meta information. Currently it is fixed and the parameters that fit the ArrayList are coming back. In the future, it may become possible to acquire arbitrary parameters to some extent.

data

The entity of data is returned in binary of ArrayList. The case where there are plural is added.

result

Result code. I am still bucket relaying the output result of the command line as it is.

PUT dataset

PUT / v2 / api / dataset [/ dataset name] [; MatrixParameter]

Create and mount a data set.

MatrixParameter

None

An example

PUT / v2 / api / dataset / backup

Return value

HTTP response code

201 Created

A data set was made.

409 Conflicted

I could not create a competing data set.

503 SERVICE UNAVAILABLE

There were some reasons, I could not accept it.

JSON format (XML is omitted)

Example:

{

 "result": 0,

 "dataset": "backup"

}

result

Result code. I am still bucket relaying the output result of the command line as it is.

dataset

Dataset name

DELETE dataset

DELETE / v2 / api / dataset [/ dataset name] [; MatrixParameter]

Delete the data set. Deleted data set will never return so be careful.

MatrixParameter

recursive

Delete child elements (snapshots and lower layers) of the data set at the same time. Be careful not to return the data set deleted recursively again.

An example

DELETE / v2 / api / dataset / backup

Return value

HTTP response code

200 OK

The data set was erased.

405 METHOD NOT ALLOWED

There are reasons why a data set exists but can not be deleted.

410 GONE

The data set did not exist.

503 SERVICE UNAVAILABLE

There were some reasons, I could not accept it.

Example of JSON format (XML is omitted)

Example:

{

 "result": 0

}

result

Result code. 0 if successful. Other than internal error code.

dataset / unique

PUT dataset / (unique)

PUT / v2 / api / dataset [/ dataset name] [; MatrixParameter] / (unique)

Create a unique data set.

By placing a random metacharacter,% in the dataset name, there will be a random character string in it. Any number of% may be installed. However,% needs to be URL-encoded and sent.

PUT dataset / (unique) attempts to create a unique Dataset by including% in the dataset name. If happen to happen to be a dataset name of an already existing name, we try to challenge by replacing the% character and secure uniqueness.

If the random character string overlaps the specified number of times, it returns 409 CONFLICTED of the HTTP response.

MatrixParameter

None

An example

PUT /v2/api/dataset/backup/data.% 25% 25% 25% 25 / (unique)

Return value

HTTP response code

201 Created

A data set was made.

409 Conflicted

I could not create a competing data set.

503 SERVICE UNAVAILABLE

There were some reasons, I could not accept it.

Example of JSON format (XML is omitted)

Example:

{

 "result": 0,

 "dataset": backup

}

result

Result code. 0 if successful. In case of conflict by several trials absolutely 22 (In that case, 409 is returned by HTTP response code). Other than internal error code.

dataset

Dataset name

revision

GET dataset / (revision)

GET / v 2 / api / dataset / (revision)

Returns the Version of the Muramasa dataset API.

This API is more special than the others and does not require credentials.

MatrixParameter

None

An example

GET / v 2 / api / dataset / (revision)

Return value

HTTP response code

200 OK

success. JSON data is returned.

Example of JSON format (XML is omitted)

Example:

{

   "result": 0,

   "revision": 2015041301

}

result

Always 0

revision

Return version. It has a date and a two-digit number.