POST Datatype

Description

Creates a new committed datatype.

Requests

Syntax

POST /datatypes  HTTP/1.1
Host: DOMAIN
Authorization: <authorization_string>

Request Parameters

This implementation of the operation does not use request parameters.

Request Headers

This implementation of the operation uses only the request headers that are common to most requests. See Common Request Headers

Request Elements

The request body must be a JSON object with a ‘type’ link key as described below. Optionally, the request body can include a ‘link’ key that describes how the new committed datatype will be linked.

type

The value of the type key can either be one of the predefined type strings (see predefined types), or a JSON representation of a type. (see Types).

Responses

Response Headers

This implementation of the operation uses only response headers that are common to most responses. See Common Response Headers.

Response Elements

On success, a JSON response will be returned with the following elements:

id

The UUID of the newly created datatype object.

attributeCount

The number of attributes belonging to the datatype.

created

A timestamp giving the time the group was created in UTC (ISO-8601 format).

lastModified

A timestamp giving the most recent time the group has been modified (i.e. attributes or links updated) in UTC (ISO-8601 format).

hrefs

An array of links to related resources. See Hypermedia.

Special Errors

The implementation of the operation does not return special errors. For general information on standard error codes, see Common Error Responses.

Examples

Sample Request

Create a new committed datatype using the “H5T_IEEE_F32LE” (32-bit float) predefined type.

POST /datatypes HTTP/1.1
Content-Length: 26
User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
host: newdtype.datatypetest.test.hdfgroup.org
Accept: */*
Accept-Encoding: gzip, deflate
{
"type": "H5T_IEEE_F32LE"
}

Sample Response

HTTP/1.1 201 Created
Date: Thu, 22 Jan 2015 19:06:17 GMT
Content-Length: 533
Content-Type: application/json
Server: TornadoServer/3.2.2
{
"id": "be08d40c-a269-11e4-84db-3c15c2da029e",
"attributeCount": 0,
"created": "2015-01-22T19:06:17Z",
"lastModified": "2015-01-22T19:06:17Z",
"hrefs": [
    {"href": "http://newdtype.datatypetest.test.hdfgroup.org/datatypes/be08d40c-a269-11e4-84db-3c15c2da029e", "rel": "self"},
    {"href": "http://newdtype.datatypetest.test.hdfgroup.org/groups/be00807d-a269-11e4-8d9c-3c15c2da029e", "rel": "root"},
    {"href": "http://newdtype.datatypetest.test.hdfgroup.org/datatypes/be08d40c-a269-11e4-84db-3c15c2da029e/attributes", "rel": "attributes"}
    ]
}