From 6a0dbfa4153379afaff42a7891a141627d90346e Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 18 Jul 2018 11:41:28 -0500 Subject: [PATCH 1/7] Updates for AclOps --- AclOps/GET_ACL.rst | 101 +++++++++++++++++------------- AclOps/GET_ACLs.rst | 146 ++++++++++++++++++++++++-------------------- AclOps/PUT_ACL.rst | 121 +++++++++++++++++++----------------- 3 files changed, 204 insertions(+), 164 deletions(-) diff --git a/AclOps/GET_ACL.rst b/AclOps/GET_ACL.rst index 3c5e1c9..4031bc9 100644 --- a/AclOps/GET_ACL.rst +++ b/AclOps/GET_ACL.rst @@ -17,7 +17,12 @@ To get a user's default access for a domain: .. code-block:: http GET /acls/ HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + GET /acls/?domain=DOMAIN HTTP/1.1 Authorization: To get a user's access information for a group: @@ -25,31 +30,45 @@ To get a user's access information for a group: .. code-block:: http GET /groups//acls/ HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: +.. code-block:: http + + GET /groups//acls/?domain=DOMAIN HTTP/1.1 + Authorization: + To get a user's access information for a dataset: .. code-block:: http GET /datasets//acls/ HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + GET /datasets//acls/?domain=DOMAIN HTTP/1.1 Authorization: - To get a user's access information for a committed datatype: .. code-block:: http GET /datatypes//acls/ HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + GET /datatypes//acls/?domain=DOMAIN HTTP/1.1 Authorization: where: - + * is the UUID of the requested dataset/group/committed datatype * is the userid for the requested user. Use the special userid "default" to get the default access permisions for the object - + Request Parameters ------------------ This implementation of the operation does not use request parameters. @@ -111,61 +130,57 @@ Sample Request .. code-block:: http - GET /groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e/acls/test_user1 HTTP/1.1 - host: tall.test.hdfgroup.org + GET /groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016/acls/default HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X GET -u username:password --header "X-Hdf-domain: /shared/tall.h5" hsdshdflab.hdfgroup.org/groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016/acls/default + Sample Response --------------- .. code-block:: http HTTP/1.1 200 OK - Date: Fri, 16 Jan 2015 20:06:08 GMT - Content-Length: 660 + Date: Wed, 18 Jul 2018 16:21:21 GMT + Content-Length: 408 Etag: "2c410d1c469786f25ed0075571a8e7a3f313cec1" Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json { - "acl": { - "create": false, - "delete": false, - "read": true, - "readACL": false, - "update": false, - "updateACL": false, - "userName": "test_user1" - }, - "hrefs": [ - { - "href": "http://tall_acl.test.hdfgroup.org/groups/eb8f6959-8775-11e5-96b6-3c15c2da029e/acls/test_user1", - "rel": "self" - }, - { - "href": "http://tall_acl.test.hdfgroup.org/groups/eb8f6959-8775-11e5-96b6-3c15c2da029e", - "rel": "root" - }, - { - "href": "http://tall_acl.test.hdfgroup.org/", - "rel": "home" + "acl": { + "userName": "default", + "create": false, + "update": false, + "updateACL": false, + "read": true, + "readACL": false, + "delete": false }, - { - "href": "http://tall_acl.test.hdfgroup.org/groups/eb8f6959-8775-11e5-96b6-3c15c2da029e", - "rel": "owner" - } - ] - + "hrefs": [ + {"rel": "self", "href": "hsdshdflab.hdfgroup.org/acls"}, + {"rel": "root", "href": "hsdshdflab.hdfgroup.org/groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016"}, + {"rel": "home", "href": "hsdshdflab.hdfgroup.org/"}, + {"rel": "owner", "href": "hsdshdflab.hdfgroup.org/"} + ] + } + Related Resources ================= * :doc:`PUT_ACL` * :doc:`GET_ACLs` - + \ No newline at end of file diff --git a/AclOps/GET_ACLs.rst b/AclOps/GET_ACLs.rst index 9f51b3a..d12151c 100644 --- a/AclOps/GET_ACLs.rst +++ b/AclOps/GET_ACLs.rst @@ -18,7 +18,12 @@ To get the ACL for a domain: .. code-block:: http GET /acls HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + GET /acls?domain=DOMAIN HTTP/1.1 Authorization: To get the ACL for a group: @@ -26,31 +31,44 @@ To get the ACL for a group: .. code-block:: http GET /groups//acls HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + GET /groups//acls?domain=DOMAIN HTTP/1.1 Authorization: - To get the ACL for a dataset: .. code-block:: http GET /datasets//acls HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + GET /datasets//acls?domain=DOMAIN HTTP/1.1 Authorization: - To get the ACL for a committed datatype: .. code-block:: http GET /datatypes//acls HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + GET /datatypes//acls?domain=DOMAIN HTTP/1.1 Authorization: where: - + * is the UUID of the requested dataset/group/committed datatype - + Request Parameters ------------------ This implementation of the operation does not use request parameters. @@ -114,81 +132,79 @@ Sample Request .. code-block:: http - GET /groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e/acls HTTP/1.1 - host: tall.test.hdfgroup.org + GET /groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016/acls HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X GET -u username:password --header "X-Hdf-domain: /shared/tall.h5" hsdshdflab.hdfgroup.org/groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016/acls + Sample Response --------------- .. code-block:: http HTTP/1.1 200 OK - Date: Fri, 16 Jan 2015 20:06:08 GMT - Content-Length: 660 + Date: Wed, 18 Jul 2018 16:30:29 GMT + Content-Length: 701 Etag: "2c410d1c469786f25ed0075571a8e7a3f313cec1" Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json { - "acls": [ - { - "create": true, - "delete": true, - "read": true, - "readACL": true, - "update": true, - "updateACL": true, - "userName": "test_user2" - }, - { - "create": false, - "delete": false, - "read": true, - "readACL": false, - "update": false, - "updateACL": false, - "userName": "test_user1" - }, - { - "create": false, - "delete": false, - "read": false, - "readACL": false, - "update": false, - "updateACL": false, - "userName": "default" - } - ], - "hrefs": [ - { - "href": "http://tall_acl.test.hdfgroup.org/groups/eb8f6959-8775-11e5-96b6-3c15c2da029e/acls", - "rel": "self" - }, - { - "href": "http://tall_acl.test.hdfgroup.org/groups/eb8f6959-8775-11e5-96b6-3c15c2da029e", - "rel": "root" - }, - { - "href": "http://tall_acl.test.hdfgroup.org/", - "rel": "home" - }, - { - "href": "http://tall_acl.test.hdfgroup.org/groups/eb8f6959-8775-11e5-96b6-3c15c2da029e", - "rel": "owner" - } - ] - + "acls": [ + { + "create": false, + "read": true, + "readACL": false, + "userName": "default", + "delete": false, + "update": false, + "updateACL": false + }, + { + "create": true, + "domain": "/shared/tall.h5", + "read": true, + "readACL": true, + "userName": "test_user1", + "update": true, + "delete": true, + "updateACL": true + }, + { + "create": false, + "domain": "/shared/tall.h5", + "read": true, + "readACL": false, + "userName": "test_user2", + "update": false, + "delete": false, + "updateACL": false + } + ], + "hrefs": [ + {"href": "hsdshdflab.hdfgroup.org/acls", "rel": "self"}, + {"href": "hsdshdflab.hdfgroup.org/groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016", "rel": "root"}, + {"href": "hsdshdflab.hdfgroup.org/", "rel": "home"}, + {"href": "hsdshdflab.hdfgroup.org/", "rel": "owner"} + ] + } + Related Resources ================= * :doc:`PUT_ACL` * :doc:`GET_ACL` - + \ No newline at end of file diff --git a/AclOps/PUT_ACL.rst b/AclOps/PUT_ACL.rst index 75641de..6d321ab 100644 --- a/AclOps/PUT_ACL.rst +++ b/AclOps/PUT_ACL.rst @@ -17,7 +17,12 @@ To update a user's access information for a domain: .. code-block:: http PUT /acls/ HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + PUT /acls/?domain=DOMAIN HTTP/1.1 Authorization: To update a user's access information for a group: @@ -25,32 +30,45 @@ To update a user's access information for a group: .. code-block:: http PUT /groups//acls/ HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: - -To get a user's access information for a dataset: +.. code-block:: http + + PUT /groups//acls/?domain=DOMAIN HTTP/1.1 + Authorization: + +To update a user's access information for a dataset: .. code-block:: http PUT /datasets//acls/ HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + PUT /datasets//acls/?domain=DOMAIN HTTP/1.1 Authorization: - -To get a user's access information for a committed datatype: +To update a user's access information for a committed datatype: .. code-block:: http PUT /datatypes//acls/ HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + PUT /datatypes//acls/?domain=DOMAIN HTTP/1.1 Authorization: where: - + * is the UUID of the requested dataset/group/committed datatype * is the userid for the requested user. Use the special userid "default" to get the default access permisions for the object - + Request Parameters ------------------ This implementation of the operation does not use request parameters. @@ -65,20 +83,16 @@ Request Elements The request body most include a JSON object that has the following keys and boolean values: - { - 'read': , - - 'create': , - - 'update': , - - 'delete': , - - 'readACL': , - - 'updateACL': - - } +.. code-block:: json + + { + "read": , + "create": , + "update": , + "delete": , + "readACL": , + "updateACL": + } Responses ========= @@ -113,55 +127,50 @@ Sample Request .. code-block:: http - PUT /groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e/acls/test_user1 HTTP/1.1 - host: tall.test.hdfgroup.org + PUT /groups/g-45f464d8-883e-11e8-a9dc-0242ac12000e/acls/test_user1 HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - - { 'read': True, 'create': False, 'update': False, - 'delete': False, 'readACL': False, 'updateACL': False } - + +.. code-block:: json + + { + "read": true, + "create": false, + "update": false, + "delete": false, + "readACL": false, + "updateACL": false + } + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X PUT -u username:password --header "X-Hdf-domain: /shared/tall.h5" + -d "{\"read\": true, \"create\": false, \"update\": false, \"delete\": false, \"readACL\": false, \"updateACL\": false}" + hsdshdflab.hdfgroup.org/groups/g-45f464d8-883e-11e8-a9dc-0242ac12000e/acls/test_user1 + Sample Response --------------- .. code-block:: http HTTP/1.1 201 Created - Date: Fri, 16 Jan 2015 20:06:08 GMT + Date: Wed, 18 Jul 2018 16:06:13 GMT Content-Length: 660 Etag: "2c410d1c469786f25ed0075571a8e7a3f313cec1" Content-Type: application/json - Server: TornadoServer/3.2.2 - -.. code-block:: json + Server: nginx/1.15.0 - - "hrefs": [ - { - "href": "http://tall_acl.test.hdfgroup.org/groups/eb8f6959-8775-11e5-96b6-3c15c2da029e/acls/test_user1", - "rel": "self" - }, - { - "href": "http://tall_acl.test.hdfgroup.org/groups/eb8f6959-8775-11e5-96b6-3c15c2da029e", - "rel": "root" - }, - { - "href": "http://tall_acl.test.hdfgroup.org/", - "rel": "home" - }, - { - "href": "http://tall_acl.test.hdfgroup.org/groups/eb8f6959-8775-11e5-96b6-3c15c2da029e", - "rel": "owner" - } - ] - Related Resources ================= * :doc:`GET_ACL` * :doc:`GET_ACLs` - + \ No newline at end of file From 077a6d86f40820fed472f3dd34bea55406ce2538 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 18 Jul 2018 11:48:21 -0500 Subject: [PATCH 2/7] Fix warning in AclOps --- AclOps/PUT_ACL.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AclOps/PUT_ACL.rst b/AclOps/PUT_ACL.rst index 6d321ab..18f66a6 100644 --- a/AclOps/PUT_ACL.rst +++ b/AclOps/PUT_ACL.rst @@ -83,9 +83,9 @@ Request Elements The request body most include a JSON object that has the following keys and boolean values: -.. code-block:: json +:: - { + { "read": , "create": , "update": , From 930b342c9e5f542195e407ca6f5431a891d5a221 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Wed, 18 Jul 2018 17:09:55 -0500 Subject: [PATCH 3/7] Updates for DatasetOps --- DatasetOps/DELETE_Dataset.rst | 44 ++-- DatasetOps/GET_DatasetShape.rst | 121 +++++----- DatasetOps/POST_Dataset.rst | 382 ++++++++++++++++++-------------- DatasetOps/POST_Value.rst | 46 ++-- DatasetOps/PUT_DatasetShape.rst | 51 +++-- DatasetOps/PUT_Value.rst | 103 +++++---- 6 files changed, 429 insertions(+), 318 deletions(-) diff --git a/DatasetOps/DELETE_Dataset.rst b/DatasetOps/DELETE_Dataset.rst index a1c62da..d843bf2 100644 --- a/DatasetOps/DELETE_Dataset.rst +++ b/DatasetOps/DELETE_Dataset.rst @@ -16,11 +16,16 @@ Syntax .. code-block:: http DELETE /datasets/ HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: - + +.. code-block:: http + + DELETE /datasets/?domain=DOMAIN HTTP/1.1 + Authorization: + ** is the UUID of the requested dataset to be deleted. - + Request Parameters ------------------ This implementation of the operation does not use request parameters. @@ -62,34 +67,31 @@ Sample Request .. code-block:: http - DELETE /datasets/289bb654-a2c6-11e4-97d8-3c15c2da029e HTTP/1.1 + DELETE /datasets/d-11dac970-8ace-11e8-8126-0242ac12000d HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Content-Length: 0 - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - host: tall_dset112_deleted.test.hdfgroup.org Accept: */* Accept-Encoding: gzip, deflate - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X DELETE -u username:pasword --header "X-Hdf-domain: /shared/tall.h5" hsdshdflab.hdfgroup.org/datasets/d-11dac970-8ace-11e8-8126-0242ac12000d + Sample Response --------------- .. code-block:: http HTTP/1.1 200 OK - Date: Fri, 23 Jan 2015 06:07:49 GMT - Content-Length: 287 + Date: Wed, 18 Jul 2018 21:15:42 GMT + Content-Length: 0 Content-Type: application/json - Server: TornadoServer/3.2.2 - -.. code-block:: json - - { - "hrefs": [ - {"href": "http://tall_dset112_deleted.test.hdfgroup.org/datasets", "rel": "self"}, - {"href": "http://tall_dset112_deleted.test.hdfgroup.org/groups/289b4873-a2c6-11e4-adfb-3c15c2da029e", "rel": "root"}, - {"href": "http://tall_dset112_deleted.test.hdfgroup.org/", "rel": "home"} - ] - } - + Server: nginx/1.15.0 + Related Resources ================= diff --git a/DatasetOps/GET_DatasetShape.rst b/DatasetOps/GET_DatasetShape.rst index fb435fa..b8aa730 100644 --- a/DatasetOps/GET_DatasetShape.rst +++ b/DatasetOps/GET_DatasetShape.rst @@ -14,11 +14,16 @@ Syntax .. code-block:: http GET /datasets//shape HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: - + +.. code-block:: http + + GET /datasets//shape?domain=DOMAIN HTTP/1.1 + Authorization: + ** is the UUID of the dataset that shape is requested for. - + Request Parameters ------------------ This implementation of the operation does not use request parameters. @@ -62,10 +67,6 @@ dataspace. The value of each element gives the maximum size of each dimension. of 0 indicates that the dimension has *unlimited* extent. maxdims is not returned for H5S_SIMPLE dataspaces which are not extensible or for H5S_NULL or H5S_SCALAR dataspaces. -fillvalue: A value, of a type compatible with the dataset's type, which gives the *fill* value -for the dataset (the value which elements will be initialized to when a dataspace -is extended). fillvalue is only returned for extensible dataspaces. - created ^^^^^^^ A timestamp giving the time the datashape (same as the dataset) was created in @@ -94,86 +95,100 @@ Sample Request .. code-block:: http - GET /datasets/3b57b6d4-a6a8-11e4-96b5-3c15c2da029e/shape HTTP/1.1 - host: tall.test.hdfgroup.org + GET /datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/shape HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X GET --header "X-Hdf-domain: /shared/tall.h5" hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/shape + Sample Response --------------- .. code-block:: http HTTP/1.1 200 OK - Date: Wed, 28 Jan 2015 04:43:41 GMT - Content-Length: 445 + Date: Wed, 18 Jul 2018 22:01:40 GMT + Content-Length: 440 Etag: "76ed777f151c70d0560d1414bffe1515a3df86b0" Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - - { - "shape": { - "class": "H5S_SIMPLE" - "dims": [10], - }, - "created": "2015-01-28T04:40:23Z", - "lastModified": "2015-01-28T04:40:23Z", - "hrefs": [ - {"href": "http://tall.test.hdfgroup.org/datasets/3b57b6d4-a6a8-11e4-96b5-3c15c2da029e", "rel": "self"}, - {"href": "http://tall.test.hdfgroup.org/datasets/3b57b6d4-a6a8-11e4-96b5-3c15c2da029e", "rel": "owner"}, - {"href": "http://tall.test.hdfgroup.org/groups/3b56ee54-a6a8-11e4-b2ae-3c15c2da029e", "rel": "root"} - ], + + { + "shape": { + "class": "H5S_SIMPLE", + "maxdims": [10, 10], + "dims": [10, 10] + }, + "lastModified": 1531174596, + "created": 1531174596, + "hrefs": [ + {"href": "hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/shape", "rel": "self"}, + {"href": "hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013", "rel": "owner"}, + {"href": "hsdshdflab.hdfgroup.org/groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016", "rel": "root"} + ] } - + Sample Request - Resizable -------------------------- .. code-block:: http - GET /datasets/a64010e8-a6aa-11e4-98c8-3c15c2da029e/shape HTTP/1.1 - host: resizable.test.hdfgroup.org + GET /datasets/d-20388136-8ad5-11e8-8126-0242ac12000d/shape HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X GET --header "X-Hdf-domain: /shared/tall.h5" hsdshdflab.hdfgroup.org/datasets/d-20388136-8ad5-11e8-8126-0242ac12000d/shape + Sample Response - Resizable ---------------------------- .. code-block:: http HTTP/1.1 200 OK - Date: Wed, 28 Jan 2015 05:00:59 GMT - Content-Length: 500 + Date: Wed, 18 Jul 2018 22:05:23 GMT + Content-Length: 432 Etag: "1082800980d6809a8008b22e225f1adde8afc73f" Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - + { - "shape": { - "class": "H5S_SIMPLE", - "dims": [10, 10], - "maxdims": [10, 0], - }, - "created": "2015-01-28T04:40:23Z", - "lastModified": "2015-01-28T04:40:23Z", - "hrefs": [ - {"href": "http://resizable.test.hdfgroup.org/datasets/a64010e8-a6aa-11e4-98c8-3c15c2da029e", "rel": "self"}, - {"href": "http://resizable.test.hdfgroup.org/datasets/a64010e8-a6aa-11e4-98c8-3c15c2da029e", "rel": "owner"}, - {"href": "http://resizable.test.hdfgroup.org/groups/a63f5dcf-a6aa-11e4-ab68-3c15c2da029e", "rel": "root"} - ] + "shape": { + "dims": [10, 25], + "class": "H5S_SIMPLE", + "maxdims": [0, 0] + }, + "lastModified": 1531950860, + "created": 1531950860, + "hrefs": [ + {"href": "hsdshdflab.hdfgroup.org/datasets/d-20388136-8ad5-11e8-8126-0242ac12000d/shape", "rel": "self"}, + {"href": "hsdshdflab.hdfgroup.org/datasets/d-20388136-8ad5-11e8-8126-0242ac12000d", "rel": "owner"}, + {"href": "hsdshdflab.hdfgroup.org/groups/g-45f464d8-883e-11e8-a9dc-0242ac12000e", "rel": "root"} + ] } - + Related Resources ================= * :doc:`GET_Dataset` * :doc:`GET_DatasetType` * :doc:`PUT_DatasetShape` - - + diff --git a/DatasetOps/POST_Dataset.rst b/DatasetOps/POST_Dataset.rst index 5349bc0..58a9575 100644 --- a/DatasetOps/POST_Dataset.rst +++ b/DatasetOps/POST_Dataset.rst @@ -14,9 +14,14 @@ Syntax .. code-block:: http POST /datasets HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: - + +.. code-block:: http + + POST /datasets?domain=DOMAIN HTTP/1.1 + Authorization: + Request Parameters ------------------ This implementation of the operation does not use request parameters. @@ -29,7 +34,7 @@ to most requests. See :doc:`../CommonRequestHeaders` Request Elements ---------------- The request body must include a JSON object with a "type" key. Optionally "shape", -"maxdims", and "link" keys can be provided. +"maxdims", "creationProperties" and "link" keys can be provided. type ^^^^ @@ -87,6 +92,10 @@ id ^^ The UUID of the newly created dataset. +root +^^^^ +The UUID of the root group of the domain which the new dataset is within. + attributeCount ^^^^^^^^^^^^^^ The number of attributes belonging to the dataset. @@ -121,281 +130,327 @@ Create a one-dimensional dataset with 10 floating point elements. .. code-block:: http POST /datasets HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Content-Length: 39 - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - host: newdset.datasettest.test.hdfgroup.org Accept: */* Accept-Encoding: gzip, deflate - + .. code-block:: json { - "shape": 10, - "type": "H5T_IEEE_F32LE" + "shape": 10, + "type": "H5T_IEEE_F32LE" } - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X POST -u username:password --header "X-Hdf-domain: /shared/tall.h5" --header "Content-Type: application/json" + -d "{\"shape\": 10, \"type\": \"H5T_IEEE_F32LE\"}" hsdshdflab.hdfgroup.org/datasets + Sample Response --------------- .. code-block:: http HTTP/1.1 201 Created - Date: Thu, 29 Jan 2015 06:14:02 GMT + Date: Wed, 18 Jul 2018 19:46:30 GMT Content-Length: 651 Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - + { - "id": "0568d8c5-a77e-11e4-9f7a-3c15c2da029e", - "attributeCount": 0, - "created": "2015-01-29T06:14:02Z", - "lastModified": "2015-01-29T06:14:02Z", - "hrefs": [ - {"href": "http://newdset.datasettest.test.hdfgroup.org/datasets/0568d8c5-a77e-11e4-9f7a-3c15c2da029e", "rel": "self"}, - {"href": "http://newdset.datasettest.test.hdfgroup.org/groups/055fe7de-a77e-11e4-bbe9-3c15c2da029e", "rel": "root"}, - {"href": "http://newdset.datasettest.test.hdfgroup.org/datasets/0568d8c5-a77e-11e4-9f7a-3c15c2da029e/attributes", "rel": "attributes"}, - {"href": "http://newdset.datasettest.test.hdfgroup.org/datasets/0568d8c5-a77e-11e4-9f7a-3c15c2da029e/value", "rel": "value"} - ] + "id": "d-438f976c-8ac3-11e8-9ac3-0242ac12000c", + "type": { + "class": "H5T_FLOAT", + "base": "H5T_IEEE_F32LE" + }, + "shape": { + "class": "H5S_SIMPLE", + "dims": [10] + }, + "lastModified": 1531943189, + "created": 1531943189, + "attributeCount": 0, + "root": "g-45f464d8-883e-11e8-a9dc-0242ac12000e" } - + Sample Request with Link ------------------------ Create a dataset with 10 variable length string elements. Create link in group: -"5e441dcf-..." with name: "linked_dset". +"g-45f464d8-..." with name: "linked_dset". .. code-block:: http POST /datasets HTTP/1.1 - Content-Length: 235 - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - host: newdsetwithlink.datasettest.test.hdfgroup.org + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Content-Length: 239 Accept: */* Accept-Encoding: gzip, deflate - + .. code-block:: json { - "type": { - "class": "H5T_STRING", - "strsize": "H5T_VARIABLE", - "cset": "H5T_CSET_ASCII", - "order": "H5T_ORDER_NONE", - "strpad": "H5T_STR_NULLTERM" - }, - "shape": 10, - "link": { - "id": "5e441dcf-a782-11e4-bd6b-3c15c2da029e", - "name": "linked_dset" - } - + "type": { + "class": "H5T_STRING", + "length": "H5T_VARIABLE", + "charSet": "H5T_CSET_ASCII", + "order": "H5T_ORDER_NONE", + "strPad": "H5T_STR_NULLTERM" + }, + "shape": 10, + "link": { + "id": "g-45f464d8-883e-11e8-a9dc-0242ac12000e", + "name": "linked_dset" + } } - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X POST -u username:password --header "X-Hdf-domain: /shared/tall.h5" --header "Content-Type: application/json" + -d "{\"type\": {\"class\": \"H5T_STRING\", \"length\": \"H5T_VARIABLE\", \"charSet\": \"H5T_CSET_ASCII\", \"order\": \"H5T_ORDER_NONE\", \"strPad\": \"H5T_STR_NULLTERM\"}, + \"shape\": 10, \"link\": {\"id\": \"g-45f464d8-883e-11e8-a9dc-0242ac12000e\", \"name\": \"linked_dset\"}}" hsdshdflab.hdfgroup.org/datasets + Sample Response with Link ------------------------- .. code-block:: http HTTP/1.1 201 Created - Date: Thu, 29 Jan 2015 06:45:09 GMT - Content-Length: 683 + Date: Wed, 18 Jul 2018 19:54:02 GMT + Content-Length: 363 Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - - + { - "id": "5e579297-a782-11e4-93f9-3c15c2da029e", - "attributeCount": 0, - "created": "2015-01-29T06:45:09Z", - "lastModified": "2015-01-29T06:45:09Z", - "hrefs": [ - {"href": "http://newdsetwithlink.datasettest.test.hdfgroup.org/datasets/5e579297-a782-11e4-93f9-3c15c2da029e", "rel": "self"}, - {"href": "http://newdsetwithlink.datasettest.test.hdfgroup.org/groups/5e441dcf-a782-11e4-bd6b-3c15c2da029e", "rel": "root"}, - {"href": "http://newdsetwithlink.datasettest.test.hdfgroup.org/datasets/5e579297-a782-11e4-93f9-3c15c2da029e/attributes", "rel": "attributes"}, - {"href": "http://newdsetwithlink.datasettest.test.hdfgroup.org/datasets/5e579297-a782-11e4-93f9-3c15c2da029e/value", "rel": "value"} - ] + "id": "d-5154aed6-8ac4-11e8-9db9-0242ac120007", + "shape": { + "class": "H5S_SIMPLE", + "dims": [10] + }, + "type": { + "charSet": "H5T_CSET_ASCII", + "order": "H5T_ORDER_NONE", + "strPad": "H5T_STR_NULLTERM", + "class": "H5T_STRING", + "length": "H5T_VARIABLE" + }, + "created": 1531943641, + "attributeCount": 0, + "lastModified": 1531943641, + "root": "g-45f464d8-883e-11e8-a9dc-0242ac12000e" } - + Sample Request - Resizable Dataset ---------------------------------- Create a one-dimensional dataset with 10 elements, but extendable to an unlimited dimension. - + .. code-block:: http POST /datasets HTTP/1.1 - Content-Length: 54 - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - host: resizabledset.datasettest.test.hdfgroup.org + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Content-Length: 53 Accept: */* Accept-Encoding: gzip, deflate - + .. code-block:: json { - "type": "H5T_IEEE_F32LE", - "shape": 10, - "maxdims": 0 + "type": "H5T_IEEE_F32LE", + "shape": 10, + "maxdims": 0 } - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X POST -u username:password --header "X-Hdf-domain: /shared/tall.h5" --header "Content-Type: application/json" + -d "{\"type\": \"H5T_IEEE_F32LE\", \"shape\": 10, \"maxdims\": 0}" hsdshdflab.hdfgroup.org/datasets + Sample Response - Resizable Dataset ----------------------------------- .. code-block:: http HTTP/1.1 201 Created - Date: Thu, 29 Jan 2015 08:28:19 GMT - Content-Length: 675 + Date: Wed, 18 Jul 2018 20:25:45 GMT + Content-Length: 292 Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - - { - "id": "c79933ab-a790-11e4-b36d-3c15c2da029e", - "attributeCount": 0, - "created": "2015-01-29T08:28:19Z", - "lastModified": "2015-01-29T08:28:19Z", - "hrefs": [ - {"href": "http://resizabledset.datasettest.test.hdfgroup.org/datasets/c79933ab-a790-11e4-b36d-3c15c2da029e", "rel": "self"}, - {"href": "http://resizabledset.datasettest.test.hdfgroup.org/groups/c7759c11-a790-11e4-ae03-3c15c2da029e", "rel": "root"}, - {"href": "http://resizabledset.datasettest.test.hdfgroup.org/datasets/c79933ab-a790-11e4-b36d-3c15c2da029e/attributes", "rel": "attributes"}, - {"href": "http://resizabledset.datasettest.test.hdfgroup.org/datasets/c79933ab-a790-11e4-b36d-3c15c2da029e/value", "rel": "value"} - ] + + { + "id": "d-bf2a5b64-8ac8-11e8-8126-0242ac12000d", + "type": { + "class": "H5T_FLOAT", + "base": "H5T_IEEE_F32LE" + }, + "shape": { + "maxdims": [0], + "class": "H5S_SIMPLE", + "dims": [10] + }, + "root": "g-45f464d8-883e-11e8-a9dc-0242ac12000e", + "attributeCount": 0, + "lastModified": 1531945544, + "created": 1531945544 } - + Sample Request - Committed Type ---------------------------------- Create a two-dimensional dataset which uses a committed type with UUID: - + .. code-block:: http POST /datasets HTTP/1.1 - Content-Length: 67 - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - host: committedtype.datasettest.test.hdfgroup.org + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Content-Length: 69 Accept: */* Accept-Encoding: gzip, deflate - + .. code-block:: json { - "type": "accd0b1e-a792-11e4-bada-3c15c2da029e", - "shape": [10, 10] + "type": "accd0b1e-a792-11e4-bada-3c15c2da029e", + "shape": [10, 10] } - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X POST -u username:password --header "X-Hdf-domain: /shared/tall.h5" --header "Content-Type: application/json" + -d "{\"type\": \"t-9bd41cc6-8ac9-11e8-b72d-0242ac12000a\", \"shape\": [10, 10]}" hsdshdflab.hdfgroup.org/datasets + Sample Response - Committed Type ----------------------------------- .. code-block:: http HTTP/1.1 201 Created - Date: Thu, 29 Jan 2015 08:41:53 GMT - Content-Length: 675 + Date: Wed, 18 Jul 2018 20:33:23 GMT + Content-Length: 328 Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - + { - "id": "ace8cdca-a792-11e4-ad88-3c15c2da029e", - "attributeCount": 0, - "created": "2015-01-29T08:41:53Z", - "lastModified": "2015-01-29T08:41:53Z", - "hrefs": [ - {"href": "http://committedtype.datasettest.test.hdfgroup.org/datasets/ace8cdca-a792-11e4-ad88-3c15c2da029e", "rel": "self"}, - {"href": "http://committedtype.datasettest.test.hdfgroup.org/groups/acc4d37d-a792-11e4-b326-3c15c2da029e", "rel": "root"}, - {"href": "http://committedtype.datasettest.test.hdfgroup.org/datasets/ace8cdca-a792-11e4-ad88-3c15c2da029e/attributes", "rel": "attributes"}, - {"href": "http://committedtype.datasettest.test.hdfgroup.org/datasets/ace8cdca-a792-11e4-ad88-3c15c2da029e/value", "rel": "value"} - ] + "id": "d-d04c4d2a-8ac9-11e8-9db9-0242ac120007", + "shape": { + "class": "H5S_SIMPLE", + "dims": [10, 10] + }, + "type": { + "base": "H5T_IEEE_F32LE", + "id": "t-9bd41cc6-8ac9-11e8-b72d-0242ac12000a", + "class": "H5T_FLOAT" + }, + "created": 1531946002, + "attributeCount": 0, + "lastModified": 1531946002, + "root": "g-45f464d8-883e-11e8-a9dc-0242ac12000e" } - + Sample Request - SZIP Compression with chunking ----------------------------------------------- .. code-block:: http POST /datasets HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Content-Length: 67 - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - host: szip.datasettest.test.hdfgroup.org Accept: */* Accept-Encoding: gzip, deflate - + .. code-block:: json { - "creationProperties": { - "filters": [ - { - "bitsPerPixel": 8, - "coding": "H5_SZIP_EC_OPTION_MASK", - "id": 4, - "pixelsPerBlock": 32, - "pixelsPerScanline": 100 + "creationProperties": { + "filters": [ + { + "bitsPerPixel": 8, + "coding": "H5_SZIP_EC_OPTION_MASK", + "id": 4, + "pixelsPerBlock": 32, + "pixelsPerScanline": 100 + } + ], + "layout": { + "class": "H5D_CHUNKED", + "dims": [ + 100, + 100 + ] } + }, + "shape": [ + 1000, + 1000 ], - "layout": { - "class": "H5D_CHUNKED", - "dims": [ - 100, - 100 - ] - } - }, - "shape": [ - 1000, - 1000 - ], - "type": "H5T_IEEE_F32LE" - } - + "type": "H5T_IEEE_F32LE" + } + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X POST -u username:password --header "X-Hdf-domain: /shared/tall.h5" --header "Content-Type: application/json" + -d "{\"creationProperties\": {\"filters\": [{\"bitsPerPixel\": 8, \"coding\": \"H5_SZIP_EC_OPTION_MASK\", \"id\": 4, \"pixelsPerBlock\": 32, \"pixelsPerScanline\": 100}], + \"layout\": {\"class\": \"H5D_CHUNKED\", \"dims\": [100, 100]}}, \"shape\": [1000, 1000], \"type\": \"H5T_IEEE_F32LE\"}" hsdshdflab.hdfgroup.org/datasets + Sample Response - SZIP Compression with chunking ------------------------------------------------ .. code-block:: http HTTP/1.1 201 Created - Date: Thu, 18 Jun 2015 08:41:53 GMT - Content-Length: 975 + Date: Wed, 18 Jul 2018 21:03:51 GMT + Content-Length: 284 Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json { - "id": "ad283c05-158c-11e5-bd67-3c15c2da029e", - "attributeCount": 0, - "created": "2015-06-18T07:36:04Z", - "lastModified": "2015-06-18T07:36:04Z", - "hrefs": [ - { - "href": "http://newdset_szip.datasettest.test.hdfgroup.org/datasets/ad283c05-158c-11e5-bd67-3c15c2da029e", - "rel": "self" + "id": "d-11dac970-8ace-11e8-8126-0242ac12000d", + "attributeCount": 0, + "type": { + "class": "H5T_FLOAT", + "base": "H5T_IEEE_F32LE" }, - { - "href": "http://newdset_szip.datasettest.test.hdfgroup.org/groups/ad2746d4-158c-11e5-a083-3c15c2da029e", - "rel": "root" + "shape": { + "class": "H5S_SIMPLE", + "dims": [1000, 1000] }, - { - "href": "http://newdset_szip.datasettest.test.hdfgroup.org/datasets/ad283c05-158c-11e5-bd67-3c15c2da029e/attributes", - "rel": "attributes" - }, - { - "href": "http://newdset_szip.datasettest.test.hdfgroup.org/datasets/ad283c05-158c-11e5-bd67-3c15c2da029e/value", - "rel": "value" - } - ] + "lastModified": 1531947830, + "created": 1531947830, + "root": "g-45f464d8-883e-11e8-a9dc-0242ac12000e" } - - Related Resources ================= @@ -404,6 +459,5 @@ Related Resources * :doc:`GET_Value` * :doc:`POST_Value` * :doc:`PUT_Value` - - \ No newline at end of file + diff --git a/DatasetOps/POST_Value.rst b/DatasetOps/POST_Value.rst index e6477d0..2dfae03 100644 --- a/DatasetOps/POST_Value.rst +++ b/DatasetOps/POST_Value.rst @@ -15,11 +15,16 @@ Syntax .. code-block:: http POST /datasets//value HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: - + +.. code-block:: http + + POST /datasets//value?domain=DOMAIN HTTP/1.1 + Authorization: + ** is the UUID of the requested dataset t - + Request Parameters ------------------ This implementation of the operation does not use request parameters. @@ -76,41 +81,48 @@ Sample Request .. code-block:: http POST /datasets/4e83ad1c-ab6e-11e4-babb-3c15c2da029e/value HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Content-Length: 92 - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - host: tall.test.hdfgroup.org Accept: */* Accept-Encoding: gzip, deflate - + .. code-block:: json { - "points": [19, 17, 13, 11, 7, 5, 3, 2] + "points": [19, 17, 13, 11, 7, 5, 3, 2] } - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X POST --header "X-Hdf-domain: /shared/tall.h5" --header "Content-Type: application/json" + -d "{\"points\": [19, 17, 13, 11, 7, 5, 3, 2]}" hsdshdflab.hdfgroup.org/datasets/d-be9c3582-83c5-11e8-947e-0242ac120014/value + Sample Response --------------- .. code-block:: http HTTP/1.1 200 OK - Date: Tue, 03 Feb 2015 06:31:38 GMT - Content-Length: 47 + Date: Wed, 18 Jul 2018 21:23:45 GMT + Content-Length: 40 Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - + { - "value": [0, 1, 4, 9, 16, 25, 36, 49, 64, 81] + "value": [0, 1, 4, 9, 16, 25, 36, 49] } - + Related Resources ================= * :doc:`GET_Dataset` * :doc:`GET_Value` * :doc:`PUT_Value` - - \ No newline at end of file + diff --git a/DatasetOps/PUT_DatasetShape.rst b/DatasetOps/PUT_DatasetShape.rst index 8d69494..5d7b4a3 100644 --- a/DatasetOps/PUT_DatasetShape.rst +++ b/DatasetOps/PUT_DatasetShape.rst @@ -18,11 +18,16 @@ Syntax .. code-block:: http PUT /datasets//shape HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: - + +.. code-block:: http + + PUT /datasets//shape?domain=DOMAIN HTTP/1.1 + Authorization: + ** is the UUID of the dataset whose shape will be modified. - + Request Parameters ------------------ This implementation of the operation does not use request parameters. @@ -72,40 +77,42 @@ Sample Request .. code-block:: http - PUT /datasets/b9b6acc0-a839-11e4-aa86-3c15c2da029e/shape HTTP/1.1 + PUT /datasets/d-20388136-8ad5-11e8-8126-0242ac12000d/shape HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Content-Length: 19 - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - host: resized.test.hdfgroup.org Accept: */* Accept-Encoding: gzip, deflate - + .. code-block:: json { - "shape": [10, 25] + "shape": [10, 25] } - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X PUT -u username:password --header "X-Hdf-domain: /shared/tall.h5" --header "Content-Type: application/json" + -d "{\"shape\": [10, 25]}" hsdshdflab.hdfgroup.org/datasets/d-20388136-8ad5-11e8-8126-0242ac12000d/shape + Sample Response --------------- .. code-block:: http HTTP/1.1 201 Created - Date: Fri, 30 Jan 2015 04:47:47 GMT - Content-Length: 331 + Date: Wed, 18 Jul 2018 21:54:47 GMT + Content-Length: 13 Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - { - "hrefs": [ - {"href": "http://resized.test.hdfgroup.org/datasets/22e1b235-a83b-11e4-97f4-3c15c2da029e", "rel": "self"}, - {"href": "http://resized.test.hdfgroup.org/datasets/22e1b235-a83b-11e4-97f4-3c15c2da029e", "rel": "owner"}, - {"href": "http://resized.test.hdfgroup.org/groups/22dfff8f-a83b-11e4-883d-3c15c2da029e", "rel": "root"} - ] - } - + {"hrefs": []} + Related Resources ================= @@ -114,6 +121,6 @@ Related Resources * :doc:`GET_Value` * :doc:`POST_Value` * :doc:`PUT_Value` - + \ No newline at end of file diff --git a/DatasetOps/PUT_Value.rst b/DatasetOps/PUT_Value.rst index 3c9607f..7db6f13 100644 --- a/DatasetOps/PUT_Value.rst +++ b/DatasetOps/PUT_Value.rst @@ -14,11 +14,16 @@ Syntax .. code-block:: http PUT /datasets//value HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: - + +.. code-block:: http + + PUT /datasets//value?domain=DOMAIN HTTP/1.1 + Authorization: + ** is the UUID of the requested dataset. - + Request Parameters ------------------ This implementation of the operation does not use request parameters. @@ -110,42 +115,52 @@ This example writes a 10x10 integer dataset with the values 0-99 inclusive. .. code-block:: http - PUT /datasets/817e2280-ab5d-11e4-afe6-3c15c2da029e/value HTTP/1.1 - Content-Length: 465 - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - host: valueput.datasettest.test.hdfgroup.org + PUT /datasets/d-d13cddf0-8ad1-11e8-8126-0242ac12000d/value HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Content-Length: 421 Accept: */* Accept-Encoding: gzip, deflate - + .. code-block:: json { - "value": [ - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - [10, 11, 12, 13, 14, 15, 16, 17, 18, 19], - [20, 21, 22, 23, 24, 25, 26, 27, 28, 29], - [30, 31, 32, 33, 34, 35, 36, 37, 38, 39], - [40, 41, 42, 43, 44, 45, 46, 47, 48, 49], - [50, 51, 52, 53, 54, 55, 56, 57, 58, 59], - [60, 61, 62, 63, 64, 65, 66, 67, 68, 69], - [70, 71, 72, 73, 74, 75, 76, 77, 78, 79], - [80, 81, 82, 83, 84, 85, 86, 87, 88, 89], - [90, 91, 92, 93, 94, 95, 96, 97, 98, 99] - ] + "value": [ + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], + [10, 11, 12, 13, 14, 15, 16, 17, 18, 19], + [20, 21, 22, 23, 24, 25, 26, 27, 28, 29], + [30, 31, 32, 33, 34, 35, 36, 37, 38, 39], + [40, 41, 42, 43, 44, 45, 46, 47, 48, 49], + [50, 51, 52, 53, 54, 55, 56, 57, 58, 59], + [60, 61, 62, 63, 64, 65, 66, 67, 68, 69], + [70, 71, 72, 73, 74, 75, 76, 77, 78, 79], + [80, 81, 82, 83, 84, 85, 86, 87, 88, 89], + [90, 91, 92, 93, 94, 95, 96, 97, 98, 99] + ] } - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X PUT -u username:password --header "X-Hdf-domain: /shared/tall.h5" --header "Content-Type: application/json" + -d "{\"value\": [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [10, 11, 12, 13, 14, 15, 16, 17, 18, 19], [20, 21, 22, 23, 24, 25, 26, 27, 28, 29], + [30, 31, 32, 33, 34, 35, 36, 37, 38, 39], [40, 41, 42, 43, 44, 45, 46, 47, 48, 49], [50, 51, 52, 53, 54, 55, 56, 57, 58, 59], + [60, 61, 62, 63, 64, 65, 66, 67, 68, 69], [70, 71, 72, 73, 74, 75, 76, 77, 78, 79], [80, 81, 82, 83, 84, 85, 86, 87, 88, 89], [90, 91, 92, 93, 94, 95, 96, 97, 98, 99]]}" + hsdshdflab.hdfgroup.org/datasets/d-d13cddf0-8ad1-11e8-8126-0242ac12000d/value + Sample Response --------------- .. code-block:: http HTTP/1.1 200 OK - Date: Tue, 03 Feb 2015 04:31:22 GMT + Date: Wed, 18 Jul 2018 21:34:41 GMT Content-Length: 0 Content-Type: text/html; charset=UTF-8 - Server: TornadoServer/3.2.2 - - + Server: nginx/1.15.0 + Sample Request - Selection -------------------------- @@ -154,39 +169,45 @@ request. .. code-block:: http - PUT /datasets/b2d0af00-ab65-11e4-a874-3c15c2da029e/value HTTP/1.1 - Content-Length: 92 - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - host: valueputsel.datasettest.test.hdfgroup.org + PUT /datasets/d-d13cddf0-8ad1-11e8-8126-0242ac12000d/value HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Content-Length: 64 Accept: */* Accept-Encoding: gzip, deflate - + .. code-block:: json - { - "start": 5, - "stop": 10, - "value": [13, 17, 19, 23, 29] + { + "start": [0, 4], + "stop": [1, 9], + "value": [13, 17, 19, 23, 29] } - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X PUT -u username:password --header "X-Hdf-domain: /shared/tall.h5" --header "Content-Type: application/json" + -d "{\"start\": [0, 4], \"stop\": [1, 9], \"value\": [13, 17, 19, 23, 29]}" hsdshdflab.hdfgroup.org/datasets/d-d13cddf0-8ad1-11e8-8126-0242ac12000d/value + Sample Response --------------- .. code-block:: http HTTP/1.1 200 OK - Date: Tue, 03 Feb 2015 05:30:01 GMT + Date: Wed, 18 Jul 2018 21:46:48 GMT Content-Length: 0 Content-Type: text/html; charset=UTF-8 - Server: TornadoServer/3.2.2 - - + Server: nginx/1.15.0 + Related Resources ================= * :doc:`GET_Dataset` * :doc:`GET_Value` * :doc:`POST_Value` - - \ No newline at end of file + From 047eee4566268d0a1da2e169e0e1f3c407905a12 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 19 Jul 2018 11:54:15 -0500 Subject: [PATCH 4/7] Further updates to DatasetOps --- DatasetOps/GET_Dataset.rst | 95 +++++++----- DatasetOps/GET_DatasetType.rst | 181 ++++++++++++----------- DatasetOps/GET_Datasets.rst | 117 ++++++++------- DatasetOps/GET_Value.rst | 259 +++++++++++++++++++-------------- 4 files changed, 367 insertions(+), 285 deletions(-) diff --git a/DatasetOps/GET_Dataset.rst b/DatasetOps/GET_Dataset.rst index d925ed4..46b7ea2 100644 --- a/DatasetOps/GET_Dataset.rst +++ b/DatasetOps/GET_Dataset.rst @@ -14,11 +14,16 @@ Syntax .. code-block:: http GET /datasets/ HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: - + +.. code-block:: http + + GET /datasets/?domain=DOMAIN HTTP/1.1 + Authorization: + **** is the UUID of the requested dataset. - + Request Parameters ------------------ This implementation of the operation does not use request parameters. @@ -93,55 +98,69 @@ Sample Request .. code-block:: http - GET /datasets/c8d83759-a2c6-11e4-8713-3c15c2da029e HTTP/1.1 - host: tall.test.hdfgroup.org + GET /datasets/d-bf1cb98c-83c5-11e8-b9ee-0242ac12000a HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X GET --header "X-Hdf-domain: /shared/tall.h5" hsdshdflab.hdfgroup.org/datasets/d-bf1cb98c-83c5-11e8-b9ee-0242ac12000a + Sample Response --------------- .. code-block:: http HTTP/1.1 200 OK - Date: Fri, 23 Jan 2015 06:15:33 GMT - Content-Length: 755 + Date: Thu, 19 Jul 2018 16:14:29 GMT + Content-Length: 966 Etag: "ecbd7e52654b0a8f4ccbebac06175ce5df5f8c79" Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - + { - "id": "c8d83759-a2c6-11e4-8713-3c15c2da029e", - "shape": { - "dims": [10], - "class": "H5S_SIMPLE" - }, - "type": { - "base": "H5T_IEEE_F32BE", - "class": "H5T_FLOAT" - }, - "creationProperties": { - "allocTime": "H5D_ALLOC_TIME_LATE", - "fillTime": "H5D_FILL_TIME_IFSET", + "id": "d-bf1cb98c-83c5-11e8-b9ee-0242ac12000a", + "root": "g-be5996fa-83c5-11e8-a8e6-0242ac120016", "layout": { - "class": "H5D_CONTIGUOUS" - } - }, - "attributeCount": 0, - "created": "2015-01-23T06:12:18Z", - "lastModified": "2015-01-23T06:12:18Z", - "hrefs": [ - {"href": "http://tall.test.hdfgroup.org/datasets/c8d83759-a2c6-11e4-8713-3c15c2da029e", "rel": "self"}, - {"href": "http://tall.test.hdfgroup.org/groups/c8d7842b-a2c6-11e4-b4f1-3c15c2da029e", "rel": "root"}, - {"href": "http://tall.test.hdfgroup.org/datasets/c8d83759-a2c6-11e4-8713-3c15c2da029e/attributes", "rel": "attributes"}, - {"href": "http://tall.test.hdfgroup.org/datasets/c8d83759-a2c6-11e4-8713-3c15c2da029e/value", "rel": "data"}, - {"href": "http://tall.test.hdfgroup.org/", "rel": "home"} - ] + "class": "H5D_CHUNKED", + "dims": [10] + }, + "creationProperties": { + "fillTime": "H5D_FILL_TIME_ALLOC", + "layout": { + "class": "H5D_CHUNKED", + "dims": [10] + } + }, + "shape": { + "class": "H5S_SIMPLE", + "dims": [10], + "maxdims": [10] + }, + "type": { + "class": "H5T_FLOAT", + "base": "H5T_IEEE_F32BE" + }, + "attributeCount": 0, + "domain": "/shared/tall.h5", + "created": 1531174597, + "lastModified": 1531174597, + "hrefs": [ + {"rel": "self", "href": "hsdshdflab.hdfgroup.org/datasets/d-bf1cb98c-83c5-11e8-b9ee-0242ac12000a"}, + {"rel": "root", "href": "hsdshdflab.hdfgroup.org/groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016"}, + {"rel": "home", "href": "hsdshdflab.hdfgroup.org/"}, + {"rel": "attributes", "href": "hsdshdflab.hdfgroup.org/datasets/d-bf1cb98c-83c5-11e8-b9ee-0242ac12000a/attributes"}, + {"rel": "data", "href": "hsdshdflab.hdfgroup.org/datasets/d-bf1cb98c-83c5-11e8-b9ee-0242ac12000a/value"} + ] } - + Related Resources ================= diff --git a/DatasetOps/GET_DatasetType.rst b/DatasetOps/GET_DatasetType.rst index 9b446ee..58778dc 100644 --- a/DatasetOps/GET_DatasetType.rst +++ b/DatasetOps/GET_DatasetType.rst @@ -14,11 +14,16 @@ Syntax .. code-block:: http GET /datasets//type HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: - + +.. code-block:: http + + GET /datasets//type?domain=DOMAIN HTTP/1.1 + Authorization: + ** is the UUID of the dataset the type information is requested for. - + Request Parameters ------------------ This implementation of the operation does not use request parameters. @@ -65,128 +70,128 @@ Sample Request - Predefined Type .. code-block:: http - GET /datasets/ba06ce68-a6b5-11e4-8ed3-3c15c2da029e/type HTTP/1.1 - host: scalar.test.hdfgroup.org + GET /datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/type HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl --header "X-Hdf-domain: /shared/tall.h5" hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/type + Sample Response - Predefined Type --------------------------------- .. code-block:: http HTTP/1.1 200 OK - Date: Wed, 28 Jan 2015 06:20:16 GMT - Content-Length: 519 + Date: Thu, 19 Jul 2018 16:04:48 GMT + Content-Length: 374 Etag: "802b160bf786596a9cb9f6d5cd6faa4fe1127e8c" Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json { - "type": { - "class": "H5T_INTEGER", - "order": "H5T_ORDER_LE", - "base_size": 4, - "base": "H5T_STD_I32LE", - "size": 4 - }, - "hrefs": [ - {"href": "http://scalar.test.hdfgroup.org/datasets/ba06ce68-a6b5-11e4-8ed3-3c15c2da029e/type", "rel": "self"}, - {"href": "http://scalar.test.hdfgroup.org/datasets/ba06ce68-a6b5-11e4-8ed3-3c15c2da029e", "rel": "owner"}, - {"href": "http://scalar.test.hdfgroup.org/groups/ba06992e-a6b5-11e4-9ba5-3c15c2da029e", "rel": "root"} - ] + "type": { + "base": "H5T_STD_I32BE", + "class": "H5T_INTEGER" + }, + "hrefs": [ + {"href": "hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/type", "rel": "self"}, + {"href": "hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013", "rel": "owner"}, + {"href": "hsdshdflab.hdfgroup.org/groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016", "rel": "root"} + ] } - + Sample Request - Compound Type -------------------------------- .. code-block:: http - GET /datasets/b9edddd7-a6b5-11e4-9afd-3c15c2da029e/type HTTP/1.1 - host: compound.test.hdfgroup.org + GET /datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014/type HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /home/test_user1/h5pyd_test/3.4/query_compound_dset.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X GET --header "X-Hdf-domain: /home/test_user1/h5pyd_test/3.4/query_compound_dset.h5" + hsdshdflab.hdfgroup.org/datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014/type + Sample Response - Compound Type -------------------------------- .. code-block:: http HTTP/1.1 200 OK - Date: Wed, 28 Jan 2015 06:20:16 GMT - Content-Length: 1199 + Date: Thu, 19 Jul 2018 16:08:38 GMT + Content-Length: 763 Etag: "1f97eac24aa18d3c462a2f2797c4782a1f2a0aa2" Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json { - "type": { - "class": "H5T_COMPOUND", - "fields": [ - { - "type": { - "order": "H5T_ORDER_LE", - "base_size": 8, - "class": "H5T_INTEGER", - "base": "H5T_STD_I64LE", - "size": 8}, - "name": "date" - }, { - "type": { - "strpad": "H5T_STR_NULLPAD", - "base_size": 6, "order": "H5T_ORDER_NONE", - "cset": "H5T_CSET_ASCII", - "strsize": 6, - "class": "H5T_STRING", - "size": 6}, - "name": "time" - }, { - "type": { - "order": "H5T_ORDER_LE", - "base_size": 8, - "class": "H5T_INTEGER", - "base": "H5T_STD_I64LE", - "size": 8}, - "name": "temp" - }, { - "type": { - "order": "H5T_ORDER_LE", - "base_size": 8, - "class": "H5T_FLOAT", - "base": "H5T_IEEE_F64LE", - "size": 8}, - "name": "pressure" - }, { - "type": { - "strpad": "H5T_STR_NULLPAD", - "base_size": 6, - "order": "H5T_ORDER_NONE", - "cset": "H5T_CSET_ASCII", - "strsize": 6, - "class": "H5T_STRING", - "size": 6}, - "name": "wind"} - ] - }, + "type": { + "class": "H5T_COMPOUND", + "fields": [ + { + "type": { + "strPad": "H5T_STR_NULLPAD", + "length": 4, + "class": "H5T_STRING", + "charSet": "H5T_CSET_ASCII" + }, + "name": "symbol" + }, + { + "type": { + "strPad": "H5T_STR_NULLPAD", + "length": 8, + "class": "H5T_STRING", + "charSet": "H5T_CSET_ASCII" + }, + "name": "date" + }, + { + "type": { + "class": "H5T_INTEGER", + "base": "H5T_STD_I32LE" + }, + "name": "open" + }, + { + "type": { + "class": "H5T_INTEGER", + "base": "H5T_STD_I32LE" + }, + "name": "close" + } + ] + }, "hrefs": [ - {"href": "http://compound.test.hdfgroup.org/datasets/b9edddd7-a6b5-11e4-9afd-3c15c2da029e/type", "rel": "self"}, - {"href": "http://compound.test.hdfgroup.org/datasets/b9edddd7-a6b5-11e4-9afd-3c15c2da029e", "rel": "owner"}, - {"href": "http://compound.test.hdfgroup.org/groups/b9eda805-a6b5-11e4-aa52-3c15c2da029e", "rel": "root"} - ] - } - + {"rel": "self", "href": "hsdshdflab.hdfgroup.org/datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014/type"}, + {"rel": "owner", "href": "hsdshdflab.hdfgroup.org/datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014"}, + {"rel": "root", "href": "hsdshdflab.hdfgroup.org/groups/g-a6b9f118-807b-11e8-a81a-0242ac12000b"} + ] + } + Related Resources ================= * :doc:`GET_Dataset` * :doc:`GET_DatasetShape` * :doc:`POST_Dataset` - - \ No newline at end of file + diff --git a/DatasetOps/GET_Datasets.rst b/DatasetOps/GET_Datasets.rst index ca0ffe8..c767c4e 100644 --- a/DatasetOps/GET_Datasets.rst +++ b/DatasetOps/GET_Datasets.rst @@ -14,9 +14,14 @@ Syntax .. code-block:: http GET /datasets HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: - + +.. code-block:: http + + GET /datasets?domain=DOMAIN HTTP/1.1 + Authorization: + Request Parameters ------------------ This implementation of the operation uses the following request parameters (both @@ -73,40 +78,46 @@ Sample Request .. code-block:: http GET /datasets HTTP/1.1 - host: tall.test.hdfgroup.org + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X GET --header "X-Hdf-domain: /shared/tall.h5" hsdshdflab.hdfgroup.org/datasets + Sample Response --------------- .. code-block:: http HTTP/1.1 200 OK - Date: Fri, 23 Jan 2015 06:33:36 GMT - Content-Length: 413 + Date: Thu, 19 Jul 2018 16:29:14 GMT + Content-Length: 405 Etag: "977e96c7bc63a6e05d10d56565df2ab8d30e404d" Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - - + { - "datasets": [ - "c8d7dd14-a2c6-11e4-a68c-3c15c2da029e", - "c8d7f159-a2c6-11e4-99af-3c15c2da029e", - "c8d83759-a2c6-11e4-8713-3c15c2da029e", - "c8d84a8a-a2c6-11e4-b457-3c15c2da029e" - ], - "hrefs": [ - {"href": "http://tall.test.hdfgroup.org/datasets", "rel": "self"}, - {"href": "http://tall.test.hdfgroup.org/groups/c8d7842b-a2c6-11e4-b4f1-3c15c2da029e", "rel": "root"}, - {"href": "http://tall.test.hdfgroup.org/", "rel": "home"} - ] + "datasets": [ + "d-be8bace4-83c5-11e8-90e7-0242ac120013", + "d-be9c3582-83c5-11e8-947e-0242ac120014", + "d-bf1cb98c-83c5-11e8-b9ee-0242ac12000a", + "d-bf2af63c-83c5-11e8-87e1-0242ac12000c" + ], + "hrefs": [ + {"rel": "self", "href": "hsdshdflab.hdfgroup.org/datasets"}, + {"rel": "root", "href": "hsdshdflab.hdfgroup.org/groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016"}, + {"rel": "home", "href": "hsdshdflab.hdfgroup.org/"} + ] } - + Sample Request with Marker and Limit ------------------------------------ @@ -116,47 +127,55 @@ The "Limit" request parameter is used to limit the number of UUIDs in the respon .. code-block:: http - GET /datasets?Marker=817db263-a2cc-11e4-87f2-3c15c2da029e&Limit=5 HTTP/1.1 - host: dset1k.test.hdfgroup.org + GET /datasets?Marker=d-85641798-8b73-11e8-bad6-0242ac120009&Limit=5 HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/many_datasets.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +*URL enclosed in quotes to prevent shell from seeing ampersand* + +.. code-block:: bash + + $ curl -X GET --header "X-Hdf-domain: /shared/many_datasets.h5" "hsdshdflab.hdfgroup.org/datasets?Marker=d-85641798-8b73-11e8-bad6-0242ac120009&Limit=5" + Sample Response with Marker and Limit ------------------------------------- .. code-block:: http - + HTTP/1.1 200 OK - Date: Fri, 23 Jan 2015 06:53:52 GMT - Content-Length: 459 + Date: Thu, 19 Jul 2018 16:51:42 GMT + Content-Length: 408 Etag: "cb708d4839cc1e165fe6bb30718e49589ef140f4" Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - + { - "datasets": [ - "817dcfb8-a2cc-11e4-9197-3c15c2da029e", - "817de9ee-a2cc-11e4-8378-3c15c2da029e", - "817e028a-a2cc-11e4-8ce3-3c15c2da029e", - "817e1b61-a2cc-11e4-ba39-3c15c2da029e", - "817e341c-a2cc-11e4-a16f-3c15c2da029e" - ], - "hrefs": [ - {"href": "http://dset1k.test.hdfgroup.org/datasets", "rel": "self"}, - {"href": "http://dset1k.test.hdfgroup.org/groups/81760a80-a2cc-11e4-bb55-3c15c2da029e", "rel": "root"}, - {"href": "http://dset1k.test.hdfgroup.org/", "rel": "home"} - ] - } - + "datasets": [ + "d-8652ac0a-8b73-11e8-827b-0242ac120007", + "d-875c8206-8b73-11e8-a0b6-0242ac12000e", + "d-88567b8a-8b73-11e8-9d44-0242ac12000b", + "d-8908c7cc-8b73-11e8-bad6-0242ac120009", + "d-89a73f9c-8b73-11e8-827b-0242ac120007" + ], + "hrefs": [ + {"href": "hsds.local/datasets", "rel": "self"}, + {"href": "hsds.local/groups/g-0e8ddffa-8b73-11e8-a0b6-0242ac12000e", "rel": "root"}, + {"href": "hsds.local/", "rel": "home"} + ] + } + Related Resources ================= * :doc:`DELETE_Dataset` * :doc:`GET_Dataset` * :doc:`POST_Dataset` - - \ No newline at end of file + diff --git a/DatasetOps/GET_Value.rst b/DatasetOps/GET_Value.rst index b86b367..930a33e 100644 --- a/DatasetOps/GET_Value.rst +++ b/DatasetOps/GET_Value.rst @@ -14,11 +14,16 @@ Syntax .. code-block:: http GET /datasets//value HTTP/1.1 - Host: DOMAIN + X-Hdf-domain: DOMAIN Authorization: - + +.. code-block:: http + + GET /datasets//value?domain=DOMAIN HTTP/1.1 + Authorization: + ** is the UUID of the requested dataset. - + Request Parameters ------------------ @@ -34,7 +39,7 @@ The number of tuples "start:stop:step" should equal the number of dimensions of For each tuple: -* start must be greater than equal to zero and less than the dimension extent +* start must be greater than or equal to zero and less than the dimension extent * stop must be greater than or equal to start and less than or equal to the dimension extent * step is optional and if provided must be greater than 0. If not provided, the step value for that dimension is assumed to be 1. @@ -119,185 +124,219 @@ Sample Request .. code-block:: http - GET /datasets/548f2f21-a83c-11e4-8baf-3c15c2da029e/value HTTP/1.1 - host: tall.test.hdfgroup.org + GET /datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/value HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X GET --header "X-Hdf-domain: /shared/tall.h5" hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/value + Sample Response --------------- .. code-block:: http HTTP/1.1 200 OK - Date: Fri, 30 Jan 2015 04:56:20 GMT - Content-Length: 776 + Date: Thu, 19 Jul 2018 15:02:38 GMT + Content-Length: 758 Etag: "788efb3caaba7fd2ae5d1edb40b474ba94c877a8" Content-Type: application/json - Server: TornadoServer/3.2.2 - - + Server: nginx/1.15.0 + .. code-block:: json { - "value": [ - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - [0, 2, 4, 6, 8, 10, 12, 14, 16, 18], - [0, 3, 6, 9, 12, 15, 18, 21, 24, 27], - [0, 4, 8, 12, 16, 20, 24, 28, 32, 36], - [0, 5, 10, 15, 20, 25, 30, 35, 40, 45], - [0, 6, 12, 18, 24, 30, 36, 42, 48, 54], - [0, 7, 14, 21, 28, 35, 42, 49, 56, 63], - [0, 8, 16, 24, 32, 40, 48, 56, 64, 72], - [0, 9, 18, 27, 36, 45, 54, 63, 72, 81] - ], - "hrefs": [ - {"href": "http://tall.test.hdfgroup.org/datasets/548f2f21-a83c-11e4-8baf-3c15c2da029e/value", "rel": "self"}, - {"href": "http://tall.test.hdfgroup.org/groups/548ed535-a83c-11e4-b58b-3c15c2da029e", "rel": "root"}, - {"href": "http://tall.test.hdfgroup.org/datasets/548f2f21-a83c-11e4-8baf-3c15c2da029e", "rel": "owner"}, - {"href": "http://tall.test.hdfgroup.org/", "rel": "home"} - ] + "value": [ + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], + [0, 2, 4, 6, 8, 10, 12, 14, 16, 18], + [0, 3, 6, 9, 12, 15, 18, 21, 24, 27], + [0, 4, 8, 12, 16, 20, 24, 28, 32, 36], + [0, 5, 10, 15, 20, 25, 30, 35, 40, 45], + [0, 6, 12, 18, 24, 30, 36, 42, 48, 54], + [0, 7, 14, 21, 28, 35, 42, 49, 56, 63], + [0, 8, 16, 24, 32, 40, 48, 56, 64, 72], + [0, 9, 18, 27, 36, 45, 54, 63, 72, 81] + ], + "hrefs": [ + {"href": "hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/value", "rel": "self"}, + {"href": "hsdshdflab.hdfgroup.org/groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016", "rel": "root"}, + {"href": "hsdshdflab.hdfgroup.org/", "rel": "home"}, + {"href": "hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013", "rel": "owner"} + ] } - + Sample Request - Selection -------------------------- .. code-block:: http GET /datasets/a299db70-ab57-11e4-9c00-3c15c2da029e/value?select=[1:9,1:9:2] HTTP/1.1 - host: tall.test.hdfgroup.org + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +*Note the use of the -g option to disable cURL's URL globbing parser* + +.. code-block:: bash + + $ curl -g -X GET --header "X-Hdf-domain: /shared/tall.h5" hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/value?select=[1:9,1:9:2] + Sample Response - Selection --------------------------- .. code-block:: http HTTP/1.1 200 OK - Date: Tue, 03 Feb 2015 04:01:41 GMT - Content-Length: 529 + Date: Thu, 19 Jul 2018 15:07:20 GMT + Content-Length: 511 Etag: "b370a3d34bdd7ebf57a496bc7f0da7bc5a1aafb9" Content-Type: application/json - Server: TornadoServer/3.2.2 - + Server: nginx/1.15.0 + .. code-block:: json - + { - "value": [ - [1, 3, 5, 7], - [2, 6, 10, 14], - [3, 9, 15, 21], - [4, 12, 20, 28], - [5, 15, 25, 35], - [6, 18, 30, 42], - [7, 21, 35, 49], - [8, 24, 40, 56] - ], - "hrefs": [ - {"href": "http://tall.test.hdfgroup.org/datasets/a299db70-ab57-11e4-9c00-3c15c2da029e/value", "rel": "self"}, - {"href": "http://tall.test.hdfgroup.org/groups/a29982cf-ab57-11e4-b976-3c15c2da029e", "rel": "root"}, - {"href": "http://tall.test.hdfgroup.org/datasets/a299db70-ab57-11e4-9c00-3c15c2da029e", "rel": "owner"}, - {"href": "http://tall.test.hdfgroup.org/", "rel": "home"} - ] + "value": [ + [1, 3, 5, 7], + [2, 6, 10, 14], + [3, 9, 15, 21], + [4, 12, 20, 28], + [5, 15, 25, 35], + [6, 18, 30, 42], + [7, 21, 35, 49], + [8, 24, 40, 56] + ], + "hrefs": [ + {"href": "hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/value", "rel": "self"}, + {"href": "hsdshdflab.hdfgroup.org/groups/g-be5996fa-83c5-11e8-a8e6-0242ac120016", "rel": "root"}, + {"href": "hsdshdflab.hdfgroup.org/", "rel": "home"}, + {"href": "hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013", "rel": "owner"} + ] } - - + Sample Request - Query -------------------------- -Get elements from dataset where the 'date' field is equal to 20 and the 'temp' field is greater than or equal to 70. +Get elements from a dataset where the 'open' field is greater than or equal to 2500 and the 'close' field is less than or equal to 3000. .. code-block:: http - GET /datasets/b2c82938-0e2e-11e5-9092-3c15c2da029e/value?query=(date%20==%2021)%20%26%20(temp%20%3E=%2072) HTTP/1.1 - host: compound.test.hdfgroup.org + GET /datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014/value?query=(open%20%3E=%202500)%20%26%20(close%20%3C=%203000) HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /home/test_user1/h5pyd_test/3.4/query_compound_dset.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X GET --header "X-Hdf-domain: /home/test_user1/h5pyd_test/3.4/query_compound_dset.h5" + hsdshdflab.hdfgroup.org/datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014/value?query=\(open%20%3E=%202500\)%20%26%20\(close%20%3C=%203000\) + Sample Response - Query ------------------------- .. code-block:: http HTTP/1.1 200 OK - Date: Thu, 11 Jun 2015 21:05:06 GMT - Content-Length: 805 + Date: Thu, 19 Jul 2018 15:48:22 GMT + Content-Length: 613 Etag: "927b5ed89616896d3dce7df8bdddac058321076a" Content-Type: application/json - Server: TornadoServer/4.1 - + Server: nginx/1.15.0 + .. code-block:: json - + { - "index": [68, 69, 70, 71], - "value": [ - [21, "17:53", 74, 29.87, "S 9"], - [21, "16:53", 75, 29.87, "SW 10"], - [21, "15:53", 79, 29.87, "S 12"], - [21, "14:53", 78, 29.87, "SW 9"] - ] - }, - "hrefs": [ - {"href": "http://compound.test.hdfgroup.org/datasets/b2c82938-0e2e-11e5-9092-3c15c2da029e/value", "rel": "self"}, - {"href": "http://compound.test.hdfgroup.org/groups/b2c7f935-0e2e-11e5-96ae-3c15c2da029e", "rel": "root"}, - {"href": "http://compound.test.hdfgroup.org/datasets/b2c82938-0e2e-11e5-9092-3c15c2da029e", "rel": "owner"}, - {"href": "http://compound.test.hdfgroup.org/", "rel": "home"} - ] - + "index": [1, 5, 6, 7, 8, 9], + "value": [ + ["AAPL", "20170102", 3054, 2933], + ["AMZN", "20170103", 3021, 2788], + ["EBAY", "20170104", 2798, 2876], + ["AAPL", "20170104", 2834, 2867], + ["AMZN", "20170104", 2891, 2978], + ["EBAY", "20170105", 2973, 2962] + ], + "hrefs": [ + {"href": "hsdshdflab.hdfgroup.org/datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014/value", "rel": "self"}, + {"href": "hsdshdflab.hdfgroup.org/groups/g-a6b9f118-807b-11e8-a81a-0242ac12000b", "rel": "root"}, + {"href": "hsdshdflab.hdfgroup.org/", "rel": "home"}, + {"href": "hsdshdflab.hdfgroup.org/datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014", "rel": "owner"} + ] + } + Sample Request - Query Batch ----------------------------- -Get elements where the 'date' field is equal to 23 and the index is between 24 and 72. Limit the number of results to 5. +Get elements where the 'open' field is less than or equal to 3000. Limit the number of results to 5. .. code-block:: http - GET /datasets/b2c82938-0e2e-11e5-9092-3c15c2da029e/value?query=date%20==%2023&Limit=5&select=[24:72] HTTP/1.1 - host: compound.test.hdfgroup.org + GET /datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014/value?query=(open%20%3C=%203000)&Limit=5 HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 Accept-Encoding: gzip, deflate Accept: */* - User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0 - + +Sample cURL command +------------------- + +*URL enclosed in quotes to prevent shell from seeing ampersand* + +.. code-block:: bash + + $ curl -X GET --header "X-Hdf-domain: /home/test_user1/h5pyd_test/3.4/query_compound_dset.h5" + "hsdshdflab.hdfgroup.org/datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014/value?query=(open%20%3C=%203000)&Limit=5" + Sample Response - Query Batch ----------------------------- .. code-block:: http HTTP/1.1 200 OK - Date: Thu, 11 Jun 2015 21:15:28 GMT - Content-Length: 610 + Date: Thu, 19 Jul 2018 15:59:56 GMT + Content-Length: 576 Etag: "927b5ed89616896d3dce7df8bdddac058321076a" Content-Type: application/json - Server: TornadoServer/4.1 - + Server: nginx/1.15.0 + .. code-block:: json - + { - "index": [24, 25, 26, 27, 28], - "value": [ - [23, "13:53", 65, 29.83, "W 5"], - [23, "12:53", 66, 29.84, "W 5"], - [23, "11:53", 64, 29.84, "E 6"], - [23, "10:53", 61, 29.86, "SE 5"], - [23, "9:53", 62, 29.86, "S 6"] - ], - "hrefs": [ - {"href": "http://compound.test.hdfgroup.org/datasets/b2c82938-0e2e-11e5-9092-3c15c2da029e/value", "rel": "self"}, - {"href": "http://compound.test.hdfgroup.org/groups/b2c7f935-0e2e-11e5-96ae-3c15c2da029e", "rel": "root"}, - {"href": "http://compound.test.hdfgroup.org/datasets/b2c82938-0e2e-11e5-9092-3c15c2da029e", "rel": "owner"}, - {"href": "http://compound.test.hdfgroup.org/", "rel": "home"} - ] - + "index": [2, 6, 7, 8, 9], + "value": [ + ["AMZN", "20170102", 2973, 3011], + ["EBAY", "20170104", 2798, 2876], + ["AAPL", "20170104", 2834, 2867], + ["AMZN", "20170104", 2891, 2978], + ["EBAY", "20170105", 2973, 2962] + ], + "hrefs": [ + {"rel": "self", "href": "hsdshdflab.hdfgroup.org/datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014/value"}, + {"rel": "root", "href": "hsdshdflab.hdfgroup.org/groups/g-a6b9f118-807b-11e8-a81a-0242ac12000b"}, + {"rel": "home", "href": "hsdshdflab.hdfgroup.org/"}, + {"rel": "owner", "href": "hsdshdflab.hdfgroup.org/datasets/d-a6d2ee5c-807b-11e8-947e-0242ac120014"} + ] + } + Related Resources ================= * :doc:`GET_Dataset` * :doc:`POST_Value` * :doc:`PUT_Value` - - \ No newline at end of file + From 5c27009793340f11444100704e959ee8618b0c9f Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Thu, 19 Jul 2018 14:04:09 -0500 Subject: [PATCH 5/7] Various minor fixes throughout --- AclOps/GET_ACL.rst | 4 ++-- AclOps/GET_ACLs.rst | 2 +- AclOps/PUT_ACL.rst | 6 +++--- AttrOps/DELETE_Attribute.rst | 19 +++++++++++++------ AttrOps/GET_Attribute.rst | 10 +++++++++- AttrOps/GET_Attributes.rst | 4 ++-- DatasetOps/DELETE_Dataset.rst | 2 +- DatasetOps/GET_Dataset.rst | 6 +++++- DatasetOps/GET_DatasetShape.rst | 2 +- DatasetOps/GET_DatasetType.rst | 2 +- DatasetOps/GET_Value.rst | 2 +- DatasetOps/POST_Dataset.rst | 27 ++++++++++++++++++++++++++- DatasetOps/POST_Value.rst | 4 ++-- DatasetOps/PUT_DatasetShape.rst | 2 +- DatasetOps/PUT_Value.rst | 2 +- DatatypeOps/DELETE_Datatype.rst | 4 ++-- DatatypeOps/GET_Datatype.rst | 4 ++-- DatatypeOps/GET_Datatypes.rst | 4 ++++ DatatypeOps/POST_Datatype.rst | 2 +- GroupOps/DELETE_Group.rst | 2 +- GroupOps/GET_Group.rst | 10 +++------- GroupOps/POST_Group.rst | 2 +- 22 files changed, 83 insertions(+), 39 deletions(-) diff --git a/AclOps/GET_ACL.rst b/AclOps/GET_ACL.rst index 4031bc9..d88ef95 100644 --- a/AclOps/GET_ACL.rst +++ b/AclOps/GET_ACL.rst @@ -66,8 +66,8 @@ To get a user's access information for a committed datatype: where: -* is the UUID of the requested dataset/group/committed datatype -* is the userid for the requested user. Use the special userid "default" to get the default access permisions for the object +* ** is the UUID of the requested dataset/group/committed datatype +* ** is the userid for the requested user. Use the special userid "default" to get the default access permisions for the object Request Parameters ------------------ diff --git a/AclOps/GET_ACLs.rst b/AclOps/GET_ACLs.rst index d12151c..2c404f6 100644 --- a/AclOps/GET_ACLs.rst +++ b/AclOps/GET_ACLs.rst @@ -67,7 +67,7 @@ To get the ACL for a committed datatype: where: -* is the UUID of the requested dataset/group/committed datatype +* ** is the UUID of the requested dataset/group/committed datatype Request Parameters ------------------ diff --git a/AclOps/PUT_ACL.rst b/AclOps/PUT_ACL.rst index 18f66a6..63eb6d4 100644 --- a/AclOps/PUT_ACL.rst +++ b/AclOps/PUT_ACL.rst @@ -66,8 +66,8 @@ To update a user's access information for a committed datatype: where: -* is the UUID of the requested dataset/group/committed datatype -* is the userid for the requested user. Use the special userid "default" to get the default access permisions for the object +* ** is the UUID of the requested dataset/group/committed datatype +* ** is the userid for the requested user. Use the special userid "default" to get the default access permisions for the object Request Parameters ------------------ @@ -81,7 +81,7 @@ to most requests. See :doc:`../CommonRequestHeaders` Request Elements ---------------- -The request body most include a JSON object that has the following keys and boolean values: +The request body must include a JSON object that has the following keys and boolean values: :: diff --git a/AttrOps/DELETE_Attribute.rst b/AttrOps/DELETE_Attribute.rst index 8e289d2..a1d18fd 100644 --- a/AttrOps/DELETE_Attribute.rst +++ b/AttrOps/DELETE_Attribute.rst @@ -11,37 +11,44 @@ Requests Syntax ------ + +To delete an attribute of a group: + .. code-block:: http - DELETE /groups// HTTP/1.1 + DELETE /groups//attributes/ HTTP/1.1 X-Hdf-domain: DOMAIN Authorization: .. code-block:: http - DELETE /groups//?domain=DOMAIN HTTP/1.1 + DELETE /groups//attributes/?domain=DOMAIN HTTP/1.1 Authorization: +To delete an attribute of a dataset: + .. code-block:: http - DELETE /datasets// HTTP/1.1 + DELETE /datasets//attributes/ HTTP/1.1 X-Hdf-domain: DOMAIN Authorization: .. code-block:: http - DELETE /datasets//?domain=DOMAIN HTTP/1.1 + DELETE /datasets//attributes/?domain=DOMAIN HTTP/1.1 Authorization: +To delete an attribute of a committed datatype: + .. code-block:: http - DELETE /datatypess// HTTP/1.1 + DELETE /datatypes//attributes/ HTTP/1.1 X-Hdf-domain: DOMAIN Authorization: .. code-block:: http - DELETE /datatypes//?domain=DOMAIN HTTP/1.1 + DELETE /datatypes//attributes/?domain=DOMAIN HTTP/1.1 Authorization: * ** is the UUID of the dataset/group/committed datatype diff --git a/AttrOps/GET_Attribute.rst b/AttrOps/GET_Attribute.rst index 71ecf89..273a6f8 100644 --- a/AttrOps/GET_Attribute.rst +++ b/AttrOps/GET_Attribute.rst @@ -38,7 +38,7 @@ To get an attribute of a dataset: GET /datasets//attributes/?domain=DOMAIN HTTP/1.1 Authorization: -To get an attribute of a datatype: +To get an attribute of a committed datatype: .. code-block:: http @@ -104,6 +104,14 @@ value A JSON array (or string or number for scalar datasets) giving the values of the requested attribute. +created +^^^^^^^ +A timestamp giving the time the attribute was created in UTC (ISO-8601 format). + +lastModified +^^^^^^^^^^^^ +A timestamp giving the most recent time the attribute has been modified (i.e. value updated) in UTC (ISO-8601 format). + hrefs ^^^^^ An array of links to related resources. See :doc:`../Hypermedia`. diff --git a/AttrOps/GET_Attributes.rst b/AttrOps/GET_Attributes.rst index 5d81d98..f2cd495 100644 --- a/AttrOps/GET_Attributes.rst +++ b/AttrOps/GET_Attributes.rst @@ -40,7 +40,7 @@ To get the attributes of a dataset: GET /datasets//attributes?domain=DOMAIN HTTP/1.1 Authorization: -To get the attributes of a datatype: +To get the attributes of a committed datatype: .. code-block:: http @@ -115,7 +115,7 @@ Examples Sample Request -------------- -Get attributes of a group with UUID: "1a956e54-...". +Get attributes of a group with UUID: "g-be5996fa-...". .. code-block:: http diff --git a/DatasetOps/DELETE_Dataset.rst b/DatasetOps/DELETE_Dataset.rst index d843bf2..361c6fa 100644 --- a/DatasetOps/DELETE_Dataset.rst +++ b/DatasetOps/DELETE_Dataset.rst @@ -24,7 +24,7 @@ Syntax DELETE /datasets/?domain=DOMAIN HTTP/1.1 Authorization: -** is the UUID of the requested dataset to be deleted. +* ** is the UUID of the requested dataset to be deleted. Request Parameters ------------------ diff --git a/DatasetOps/GET_Dataset.rst b/DatasetOps/GET_Dataset.rst index 46b7ea2..ff7ecf8 100644 --- a/DatasetOps/GET_Dataset.rst +++ b/DatasetOps/GET_Dataset.rst @@ -22,7 +22,7 @@ Syntax GET /datasets/?domain=DOMAIN HTTP/1.1 Authorization: -**** is the UUID of the requested dataset. +* ** is the UUID of the requested dataset. Request Parameters ------------------ @@ -51,6 +51,10 @@ id ^^ The UUID of the dataset object. +root +^^^^ +The UUID of the root group for the domain which the dataset is within. + type ^^^^ A JSON object representing the type of the dataset. See :doc:`../Types/index` for diff --git a/DatasetOps/GET_DatasetShape.rst b/DatasetOps/GET_DatasetShape.rst index b8aa730..2dbc51a 100644 --- a/DatasetOps/GET_DatasetShape.rst +++ b/DatasetOps/GET_DatasetShape.rst @@ -22,7 +22,7 @@ Syntax GET /datasets//shape?domain=DOMAIN HTTP/1.1 Authorization: -** is the UUID of the dataset that shape is requested for. +* ** is the UUID of the dataset that shape is requested for. Request Parameters ------------------ diff --git a/DatasetOps/GET_DatasetType.rst b/DatasetOps/GET_DatasetType.rst index 58778dc..b256490 100644 --- a/DatasetOps/GET_DatasetType.rst +++ b/DatasetOps/GET_DatasetType.rst @@ -22,7 +22,7 @@ Syntax GET /datasets//type?domain=DOMAIN HTTP/1.1 Authorization: -** is the UUID of the dataset the type information is requested for. +* ** is the UUID of the dataset the type information is requested for. Request Parameters ------------------ diff --git a/DatasetOps/GET_Value.rst b/DatasetOps/GET_Value.rst index 930a33e..bbd8eb0 100644 --- a/DatasetOps/GET_Value.rst +++ b/DatasetOps/GET_Value.rst @@ -22,7 +22,7 @@ Syntax GET /datasets//value?domain=DOMAIN HTTP/1.1 Authorization: -** is the UUID of the requested dataset. +* ** is the UUID of the requested dataset. Request Parameters ------------------ diff --git a/DatasetOps/POST_Dataset.rst b/DatasetOps/POST_Dataset.rst index 58a9575..6d2a7f5 100644 --- a/DatasetOps/POST_Dataset.rst +++ b/DatasetOps/POST_Dataset.rst @@ -94,7 +94,32 @@ The UUID of the newly created dataset. root ^^^^ -The UUID of the root group of the domain which the new dataset is within. +The UUID of the root group for the domain which the new dataset is within. + +type +^^^^ +A JSON object representing the type definition for the dataset. See :doc:`../Types/index` +for information on how different types are represented. + +shape +^^^^^ + +A JSON object with the following keys: + +class: A string with one of the following values: + + * H5S_NULL: A null dataspace, which has no elements + * H5S_SCALAR: A dataspace with a single element (although possibly of a complex datatype) + * H5S_SIMPLE: A dataspace that consists of a regular array of elements + +dims: An integer array whose length is equal to the number of dimensions (rank) of the +dataspace. The value of each element gives the current size of each dimension. Dims +is not returned for H5S_NULL or H5S_SCALAR dataspaces. + +maxdims: An integer array whose length is equal to the number of dimensions of the +dataspace. The value of each element gives the maximum size of each dimension. A value +of 0 indicates that the dimension has *unlimited* extent. maxdims is not returned for +H5S_SIMPLE dataspaces which are not extensible or for H5S_NULL or H5S_SCALAR dataspaces. attributeCount ^^^^^^^^^^^^^^ diff --git a/DatasetOps/POST_Value.rst b/DatasetOps/POST_Value.rst index 2dfae03..c3f91f8 100644 --- a/DatasetOps/POST_Value.rst +++ b/DatasetOps/POST_Value.rst @@ -23,7 +23,7 @@ Syntax POST /datasets//value?domain=DOMAIN HTTP/1.1 Authorization: -** is the UUID of the requested dataset t +* ** is the UUID of the requested dataset Request Parameters ------------------ @@ -80,7 +80,7 @@ Sample Request .. code-block:: http - POST /datasets/4e83ad1c-ab6e-11e4-babb-3c15c2da029e/value HTTP/1.1 + POST /datasets/d-be9c3582-83c5-11e8-947e-0242ac120014/value HTTP/1.1 Host: hsdshdflab.hdfgroup.org X-Hdf-domain: /shared/tall.h5 Content-Length: 92 diff --git a/DatasetOps/PUT_DatasetShape.rst b/DatasetOps/PUT_DatasetShape.rst index 5d7b4a3..290c1a1 100644 --- a/DatasetOps/PUT_DatasetShape.rst +++ b/DatasetOps/PUT_DatasetShape.rst @@ -26,7 +26,7 @@ Syntax PUT /datasets//shape?domain=DOMAIN HTTP/1.1 Authorization: -** is the UUID of the dataset whose shape will be modified. +* ** is the UUID of the dataset whose shape will be modified. Request Parameters ------------------ diff --git a/DatasetOps/PUT_Value.rst b/DatasetOps/PUT_Value.rst index 7db6f13..df39b0a 100644 --- a/DatasetOps/PUT_Value.rst +++ b/DatasetOps/PUT_Value.rst @@ -22,7 +22,7 @@ Syntax PUT /datasets//value?domain=DOMAIN HTTP/1.1 Authorization: -** is the UUID of the requested dataset. +* ** is the UUID of the requested dataset. Request Parameters ------------------ diff --git a/DatatypeOps/DELETE_Datatype.rst b/DatatypeOps/DELETE_Datatype.rst index a317871..5f03d7a 100644 --- a/DatatypeOps/DELETE_Datatype.rst +++ b/DatatypeOps/DELETE_Datatype.rst @@ -5,7 +5,7 @@ DELETE Datatype Description =========== The implementation of the DELETE operation deletes the committed datatype - named in the URI. All attributes of the datatype will also be deleted. +named in the URI. All attributes of the datatype will also be deleted. Requests ======== @@ -23,7 +23,7 @@ Syntax DELETE /datatypes/?domain=DOMAIN HTTP/1.1 Authorization: -** is the UUID of the datatype to be deleted. +* ** is the UUID of the datatype to be deleted. Request Parameters ------------------ diff --git a/DatatypeOps/GET_Datatype.rst b/DatatypeOps/GET_Datatype.rst index 836885b..88ec30e 100644 --- a/DatatypeOps/GET_Datatype.rst +++ b/DatatypeOps/GET_Datatype.rst @@ -22,7 +22,7 @@ Syntax GET /datatypes/?domain=DOMAIN HTTP/1.1 Authorization: -** is the UUID of the requested datatype. +* ** is the UUID of the requested datatype. Request Parameters ------------------ @@ -53,7 +53,7 @@ The UUID of the datatype object. root ^^^^ -The root group of the domain which the datatype is within. +The UUID of the root group for the domain which the datatype is within. type ^^^^ diff --git a/DatatypeOps/GET_Datatypes.rst b/DatatypeOps/GET_Datatypes.rst index c7f02ef..a920dc3 100644 --- a/DatatypeOps/GET_Datatypes.rst +++ b/DatatypeOps/GET_Datatypes.rst @@ -56,6 +56,10 @@ Response Elements On success, a JSON response will be returned with the following elements: +datatypes +^^^^^^^^^ +An array of UUIDs, one for each datatype in the domain. + hrefs ^^^^^ An array of links to related resources. See :doc:`../Hypermedia`. diff --git a/DatatypeOps/POST_Datatype.rst b/DatatypeOps/POST_Datatype.rst index 56f9bda..af71c5a 100644 --- a/DatatypeOps/POST_Datatype.rst +++ b/DatatypeOps/POST_Datatype.rst @@ -75,7 +75,7 @@ The UUID of the newly created datatype object. root ^^^^ -The root group of the domain which the datatype is within. +The UUID of the root group for the domain which the datatype is within. attributeCount ^^^^^^^^^^^^^^ diff --git a/GroupOps/DELETE_Group.rst b/GroupOps/DELETE_Group.rst index 1b49330..94abc6b 100644 --- a/GroupOps/DELETE_Group.rst +++ b/GroupOps/DELETE_Group.rst @@ -28,7 +28,7 @@ Syntax DELETE /groups/?domain=DOMAIN HTTP/1.1 Authorization: -** is the UUID of the group to be deleted. +* ** is the UUID of the group to be deleted. Request Parameters ------------------ diff --git a/GroupOps/GET_Group.rst b/GroupOps/GET_Group.rst index d051ec5..4bed47f 100644 --- a/GroupOps/GET_Group.rst +++ b/GroupOps/GET_Group.rst @@ -22,15 +22,11 @@ Syntax GET /groups/?domain=DOMAIN HTTP/1.1 Authorization: -** is the UUID of the requested group. +* ** is the UUID of the requested group. Request Parameters ------------------ - -include_links -^^^^^^^^^^^^^ - -If this request parameter is provided, the links of the group are included in the response. +This implementation of the operation does not use request parameters. Request Headers --------------- @@ -57,7 +53,7 @@ The UUID of the requested group. root ^^^^ -The root group of the domain that the group is within. +The UUID of the root group for the domain that the group is within. attributeCount ^^^^^^^^^^^^^^ diff --git a/GroupOps/POST_Group.rst b/GroupOps/POST_Group.rst index 63a78e6..9dffed9 100644 --- a/GroupOps/POST_Group.rst +++ b/GroupOps/POST_Group.rst @@ -71,7 +71,7 @@ The UUID of the newly created group. root ^^^^ -The root group of the domain which the group was created in. +The UUID of the root group for the domain which the group was created in. attributeCount ^^^^^^^^^^^^^^ From 66b0fa3cae1445e35e0297c0531f82e88c32861a Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 20 Jul 2018 10:45:39 -0500 Subject: [PATCH 6/7] Add notes about binary transfers to PUT and POST Value for datasets --- DatasetOps/POST_Value.rst | 15 +++++++++++++-- DatasetOps/PUT_Value.rst | 11 +++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/DatasetOps/POST_Value.rst b/DatasetOps/POST_Value.rst index c3f91f8..68d8ac6 100644 --- a/DatasetOps/POST_Value.rst +++ b/DatasetOps/POST_Value.rst @@ -31,8 +31,19 @@ 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 :doc:`../CommonRequestHeaders` +This implementation of the operation supports the common headers in addition to the "Accept" header value +of "application/octet-stream". Use this accept value if a binary response is desired. Binary data will be +more efficient for large data requests. If a binary response can be returned, the "Content-Type" response +header will be "application/octet-stream". Otherwise the response header will be "json". + +Note: Binary responses are only supported for datasets that have a fixed-length type +(i.e. either a fixed length primitive type or compound type that in turn consists of fixed-length types). Namely +variable length strings and variable length data types will always be returned as JSON. + +Note: if a binary response is returned, it will consist of the equivalent binary data of the "data" item in the JSON +response. No data representing "hrefs" is returned. + +For other request headers, see :doc:`../CommonRequestHeaders` Request Body ------------ diff --git a/DatasetOps/PUT_Value.rst b/DatasetOps/PUT_Value.rst index df39b0a..117e1a7 100644 --- a/DatasetOps/PUT_Value.rst +++ b/DatasetOps/PUT_Value.rst @@ -30,8 +30,15 @@ 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 :doc:`../CommonRequestHeaders` +This implementation of the operation supports the common headers in addition to the "Content-Type" header value +of "application/octet-stream". Use this Content-Type value if a binary transfer is desired. Binary data will be +more efficient for large data requests. + +Note: Binary responses are only supported for datasets that have a fixed-length type +(i.e. either a fixed length primitive type or compound type that in turn consists of fixed-length types). Namely +variable length strings and variable length data types will be unsupported for binary transfers. + +For other request headers, see :doc:`../CommonRequestHeaders` Request Body ------------ From fbdae00290bc741016a9e511bca59f77f4d8db26 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 20 Jul 2018 13:50:46 -0500 Subject: [PATCH 7/7] Updates for binary requests --- AttrOps/PUT_Attribute.rst | 6 +- AttrOps/index.rst | 17 ++- DatasetOps/GET_Value.rst | 232 ++++++++++++++++++++++++++++++++- DatasetOps/POST_Value.rst | 67 +++++++++- DatasetOps/PUT_Value.rst | 261 +++++++++++++++++++++++++++++++++++++- DatasetOps/index.rst | 2 +- 6 files changed, 561 insertions(+), 24 deletions(-) diff --git a/AttrOps/PUT_Attribute.rst b/AttrOps/PUT_Attribute.rst index ce08e7e..8290813 100644 --- a/AttrOps/PUT_Attribute.rst +++ b/AttrOps/PUT_Attribute.rst @@ -135,6 +135,7 @@ The value of the attribute will be 42. Host: hsdshdflab.hdfgroup.org X-Hdf-domain: /shared/tall.h5 Content-Length: 38 + Content-Type: application/json Accept: */* Accept-Encoding: gzip, deflate @@ -182,6 +183,7 @@ The attributes values will be "Hello, ..." and "Goodbye!". Host: hsdshdflab.hdfgroup.org X-Hdf-domain: /shared/tall.h5 Content-Length: 178 + Content-Type: application/json Accept: */* Accept-Encoding: gzip, deflate @@ -234,13 +236,13 @@ and a floating point element. PUT /groups/g-45f464d8-883e-11e8-a9dc-0242ac12000e/attributes/attr_compound HTTP/1.1 Host: hsdshdflab.hdfgroup.org X-Hdf-domain: /shared/tall.h5 - Content-Length: 187 + Content-Length: 0 + Content-Type: application/json Accept: */* Accept-Encoding: gzip, deflate .. code-block:: json - { "shape": 2, "type": { diff --git a/AttrOps/index.rst b/AttrOps/index.rst index bf123ab..a652aa1 100644 --- a/AttrOps/index.rst +++ b/AttrOps/index.rst @@ -20,9 +20,14 @@ attributes) is included in the request. Reading and Writing Data ------------------------- -Unlike datasets, an attribute's data can not be -read or written partially. Data can only be written as part of the PUT request. -Reading the data of an attribute is done by :doc:`GET_Attribute`. +To write data to an attribute, use the :doc:`../DatasetOps/PUT_Value` operation. + +To read data from an attribute, use the :doc:`../DatasetOps/GET_Value` operation. + +Unlike datasets, an attribute's data can not be read or written partially. As part of +the :doc:`../DatasetOps/GET_Value` operation, the entire set of data values for the +attribute is returned. As part of the :doc:`../DatasetOps/PUT_Value` operation, the +entire set of data values for the attribute must be updated. Listing attributes ------------------ @@ -44,6 +49,6 @@ List of Operations GET_Attribute GET_Attributes PUT_Attribute - - - + ../DatasetOps/GET_Value + ../DatasetOps/PUT_Value + diff --git a/DatasetOps/GET_Value.rst b/DatasetOps/GET_Value.rst index bbd8eb0..5a68ebf 100644 --- a/DatasetOps/GET_Value.rst +++ b/DatasetOps/GET_Value.rst @@ -4,13 +4,19 @@ GET Value Description =========== -Gets data values of a dataset. +Gets data values of a dataset or attribute. Requests ======== Syntax ------ + +Datasets +:::::::: + +To get the data values of a dataset: + .. code-block:: http GET /datasets//value HTTP/1.1 @@ -24,12 +30,60 @@ Syntax * ** is the UUID of the requested dataset. +Attributes +:::::::::: + +To get the data values of an attribute attached to a group: + +.. code-block:: http + + GET /groups//attributes//value HTTP/1.1 + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + GET /groups//attributes//value?domain=DOMAIN HTTP/1.1 + Authorization: + +To get the data values of an attribute attached to a dataset: + +.. code-block:: http + + GET /datasets//attributes//value HTTP/1.1 + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + GET /datasets//attributes//value?domain=DOMAIN HTTP/1.1 + Authorization: + +To get the data values of an attribute attached to a committed datatype: + +.. code-block:: http + + GET /datatypes//attributes//value HTTP/1.1 + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + GET /datatypes//attributes//value?domain=DOMAIN HTTP/1.1 + Authorization: + +* ** is the UUID of the requested dataset. +* ** is the name of the requested attribute + Request Parameters ------------------ +Datasets +:::::::: + select ^^^^^^ -Optionally the request can provide a select value to indicate a hyperslab selection for +Optionally, the request can provide a select value to indicate a hyperslab selection for the values to be returned - i.e. a rectangular (in 1, 2, or more dimensions) region of the dataset. Format is the following as a url-encoded value: @@ -65,13 +119,17 @@ Limit If provided, a positive integer value specifying the maximum number of elements to return. Only has an effect if used in conjunction with the query parameter. +Attributes +:::::::::: + +This implementation of the operation does not use request parameters. Request Headers --------------- This implementation of the operation supports the common headers in addition to the "Accept" header value of "application/octet-stream". Use this accept value if a binary response is desired. Binary data will be more efficient for large data requests. If a binary response can be returned, the "Content-Type" response -header will be "application/octet-stream". Otherwise the response header will be "json". +header will be "application/octet-stream". Otherwise the response header will be "application/json". Note: Binary responses are only supported for datasets that have a fixed-length type (i.e. either a fixed length primitive type or compound type that in turn consists of fixed-length types). Namely @@ -94,12 +152,16 @@ most responses. See :doc:`../CommonResponseHeaders`. Response Elements ----------------- +JSON Response +::::::::::::: + On success, a JSON response will be returned with the following elements: value ^^^^^ -A json array (integer or string for scalar datasets) giving the values of the requested -dataset region. +A json array (integer or string for scalar datasets or attributes) giving the values +of the requested region for datasets or the entire set of values for attributes +(attributes can't be partially read). index ^^^^^ @@ -110,14 +172,21 @@ hrefs ^^^^^ An array of links to related resources. See :doc:`../Hypermedia`. +Binary Response +::::::::::::::: + +On success, a binary response will be returned with only the binary data values of the +requested region for datasets or the entire set of binary data values for attributes (attributes +can't be partially read). No data representing "hrefs" is returned. + Special Errors -------------- This implementation of the operation does not return special errors. For general information on standard error codes, see :doc:`../CommonErrorResponses`. -Examples -======== +Dataset Examples +================ Sample Request -------------- @@ -332,6 +401,155 @@ Sample Response - Query Batch ] } +Sample Request - Binary +----------------------- + +.. code-block:: http + + GET /datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/value HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Accept-Encoding: gzip, deflate + Accept: application/octet-stream + +Sample cURL command +------------------- + +*Note the use of "--output -" to redirect output to the terminal. This is not advised, +as it can mess up the terminal, and "--output " should be used instead.* + +.. code-block:: bash + + $ curl --output - -X GET --header "X-Hdf-domain: /shared/tall.h5" --header "Accept: application/octet-stream" + hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/value + +Sample Response +--------------- + +.. code-block:: http + + HTTP/1.1 200 OK + Date: Fri, 20 Jul 2018 16:54:15 GMT + Content-Length: 400 + Etag: "788efb3caaba7fd2ae5d1edb40b474ba94c877a8" + Content-Type: application/octet-stream + Server: nginx/1.15.0 + +Hexdump of output as captured to file + +:: + + 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| + * + 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 |................| + 00000030 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 |................| + 00000040 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 |................| + 00000050 00 00 00 00 00 00 00 02 00 00 00 04 00 00 00 06 |................| + 00000060 00 00 00 08 00 00 00 0a 00 00 00 0c 00 00 00 0e |................| + 00000070 00 00 00 10 00 00 00 12 00 00 00 00 00 00 00 03 |................| + 00000080 00 00 00 06 00 00 00 09 00 00 00 0c 00 00 00 0f |................| + 00000090 00 00 00 12 00 00 00 15 00 00 00 18 00 00 00 1b |................| + 000000a0 00 00 00 00 00 00 00 04 00 00 00 08 00 00 00 0c |................| + 000000b0 00 00 00 10 00 00 00 14 00 00 00 18 00 00 00 1c |................| + 000000c0 00 00 00 20 00 00 00 24 00 00 00 00 00 00 00 05 |... ...$........| + 000000d0 00 00 00 0a 00 00 00 0f 00 00 00 14 00 00 00 19 |................| + 000000e0 00 00 00 1e 00 00 00 23 00 00 00 28 00 00 00 2d |.......#...(...-| + 000000f0 00 00 00 00 00 00 00 06 00 00 00 0c 00 00 00 12 |................| + 00000100 00 00 00 18 00 00 00 1e 00 00 00 24 00 00 00 2a |...........$...*| + 00000110 00 00 00 30 00 00 00 36 00 00 00 00 00 00 00 07 |...0...6........| + 00000120 00 00 00 0e 00 00 00 15 00 00 00 1c 00 00 00 23 |...............#| + 00000130 00 00 00 2a 00 00 00 31 00 00 00 38 00 00 00 3f |...*...1...8...?| + 00000140 00 00 00 00 00 00 00 08 00 00 00 10 00 00 00 18 |................| + 00000150 00 00 00 20 00 00 00 28 00 00 00 30 00 00 00 38 |... ...(...0...8| + 00000160 00 00 00 40 00 00 00 48 00 00 00 00 00 00 00 09 |...@...H........| + 00000170 00 00 00 12 00 00 00 1b 00 00 00 24 00 00 00 2d |...........$...-| + 00000180 00 00 00 36 00 00 00 3f 00 00 00 48 00 00 00 51 |...6...?...H...Q| + 00000190 + +Attribute Examples +================== + +Sample Request +-------------- + +.. code-block:: http + + GET /datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/attributes/attr1/value HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Accept-Encoding: gzip, deflate + Accept: */* + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X GET --header "X-Hdf-domain: /shared/tall.h5" hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/attributes/attr1/value + +Sample Response +--------------- + +.. code-block:: http + + HTTP/1.1 200 OK + Date: Fri, 20 Jul 2018 16:37:58 GMT + Content-Length: 415 + Etag: "788efb3caaba7fd2ae5d1edb40b474ba94c877a8" + Content-Type: application/json + Server: nginx/1.15.0 + +.. code-block:: json + + { + "value": [49, 115, 116, 32, 97, 116, 116, 114, 105, 98, 117, 116, 101, 32, 111, 102, 32, 100, 115, 101, 116, 49, 46, 49, 46, 49, 0], + "hrefs": [ + {"href": "hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/attributes/attr1", "rel": "self"}, + {"href": "hsdshdflab.hdfgroup.org/", "rel": "home"}, + {"href": "hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013", "rel": "owner"} + ] + } + +Sample Request - Binary +----------------------- + +.. code-block:: http + + GET /datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/attributes/attr1/value HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Accept-Encoding: gzip, deflate + Accept: application/octet-stream + +Sample cURL command +------------------- + +*Note the use of "--output -" to redirect output to the terminal. This is not advised, +as it can mess up the terminal, and "--output " should be used instead.* + +.. code-block:: bash + + $ curl --output - -X GET --header "X-Hdf-domain: /shared/tall.h5" --header "Accept: application/octet-stream" + hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/attributes/attr1/value + +Sample Response +--------------- + +.. code-block:: http + + HTTP/1.1 200 OK + Date: Fri, 20 Jul 2018 16:40:42 GMT + Content-Length: 27 + Etag: "788efb3caaba7fd2ae5d1edb40b474ba94c877a8" + Content-Type: application/octet-stream + Server: nginx/1.15.0 + +Output as captured to file + +:: + + 1st attribute of dset1.1.1\0 + Related Resources ================= diff --git a/DatasetOps/POST_Value.rst b/DatasetOps/POST_Value.rst index 68d8ac6..f907571 100644 --- a/DatasetOps/POST_Value.rst +++ b/DatasetOps/POST_Value.rst @@ -34,7 +34,7 @@ Request Headers This implementation of the operation supports the common headers in addition to the "Accept" header value of "application/octet-stream". Use this accept value if a binary response is desired. Binary data will be more efficient for large data requests. If a binary response can be returned, the "Content-Type" response -header will be "application/octet-stream". Otherwise the response header will be "json". +header will be "application/octet-stream". Otherwise the response header will be "application/json". Note: Binary responses are only supported for datasets that have a fixed-length type (i.e. either a fixed length primitive type or compound type that in turn consists of fixed-length types). Namely @@ -48,6 +48,9 @@ For other request headers, see :doc:`../CommonRequestHeaders` Request Body ------------ +JSON and Binary response requests +::::::::::::::::::::::::::::::::: + The request body should be a JSON object with the following key: points @@ -69,6 +72,9 @@ most responses. See :doc:`../CommonResponseHeaders`. Response Elements ----------------- +JSON Response +::::::::::::: + On success, a JSON response will be returned with the following elements: value @@ -77,6 +83,12 @@ An array of values where the length of the array is equal to the number of point in the request. Each value will be a string, integer, or JSON object consistent with the dataset type (e.g. a compound type). +Binary Response +::::::::::::::: + +On success, a binary response will be returned with the binary data values of the +requested points for the dataset. + Special Errors -------------- @@ -94,7 +106,7 @@ Sample Request POST /datasets/d-be9c3582-83c5-11e8-947e-0242ac120014/value HTTP/1.1 Host: hsdshdflab.hdfgroup.org X-Hdf-domain: /shared/tall.h5 - Content-Length: 92 + Content-Length: 40 Accept: */* Accept-Encoding: gzip, deflate @@ -119,7 +131,7 @@ Sample Response HTTP/1.1 200 OK Date: Wed, 18 Jul 2018 21:23:45 GMT - Content-Length: 40 + Content-Length: 39 Content-Type: application/json Server: nginx/1.15.0 @@ -129,6 +141,55 @@ Sample Response "value": [0, 1, 4, 9, 16, 25, 36, 49] } +Sample Request - Binary +----------------------- + +.. code-block:: http + + POST /datasets/d-be9c3582-83c5-11e8-947e-0242ac120014/value HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Content-Length: 40 + Accept: application/octet-stream + Accept-Encoding: gzip, deflate + +.. code-block:: json + + { + "points": [19, 17, 13, 11, 7, 5, 3, 2] + } + +Sample cURL command +------------------- + +*Note the use of "--output -" to redirect output to the terminal. This is not advised, +as it can mess up the terminal, and "--output " should be used instead.* + +.. code-block:: bash + + $ curl --output - -X POST --header "X-Hdf-domain: /shared/tall.h5" --header "Content-Type: application/json" --header "Accept: application/octet-stream" + -d "{\"points\": [19, 17, 13, 11, 7, 5, 3, 2]}" hsdshdflab.hdfgroup.org/datasets/d-be9c3582-83c5-11e8-947e-0242ac120014/value + +Sample Response +--------------- + +.. code-block:: http + + HTTP/1.1 200 OK + Date: Fri, 20 Jul 2018 17:54:40 GMT + Content-Length: 32 + Content-Type: application/json + Server: nginx/1.15.0 + +Hexdump of output as captured to file + +:: + + 00000000 00 00 00 13 00 00 00 11 00 00 00 0d 00 00 00 0b |................| + 00000010 00 00 00 07 00 00 00 05 00 00 00 03 00 00 00 02 |................| + 00000020 + + Related Resources ================= diff --git a/DatasetOps/PUT_Value.rst b/DatasetOps/PUT_Value.rst index 117e1a7..b387637 100644 --- a/DatasetOps/PUT_Value.rst +++ b/DatasetOps/PUT_Value.rst @@ -4,13 +4,17 @@ PUT Value Description =========== -Update the values in a dataset. +Updates data values of a dataset or attribute. Requests ======== Syntax ------ + +Datasets +:::::::: + .. code-block:: http PUT /datasets//value HTTP/1.1 @@ -24,8 +28,78 @@ Syntax * ** is the UUID of the requested dataset. +Attributes +:::::::::: + +To update the data values of an attribute attached to a group: + +.. code-block:: http + + PUT /groups//attributes//value HTTP/1.1 + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + PUT /groups//attributes//value?domain=DOMAIN HTTP/1.1 + Authorization: + +To update the data values of an attribute attached to a dataset: + +.. code-block:: http + + PUT /datasets//attributes//value HTTP/1.1 + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + PUT /datasets//attributes//value?domain=DOMAIN HTTP/1.1 + Authorization: + +To update the data values of an attribute attached to a committed datatype: + +.. code-block:: http + + PUT /datatypes//attributes//value HTTP/1.1 + X-Hdf-domain: DOMAIN + Authorization: + +.. code-block:: http + + PUT /datatypes//attributes//value?domain=DOMAIN HTTP/1.1 + Authorization: + +* ** is the UUID of the requested dataset. +* ** is the name of the requested attribute + Request Parameters ------------------ + +Datasets +:::::::: + +select +^^^^^^ + +**Note**: This request parameter should only be used when a binary request is being made. + +Optionally, the request can provide a select value to indicate a hyperslab selection for +the values to be returned - i.e. a rectangular (in 1, 2, or more dimensions) region of +the dataset. Format is the following as a url-encoded value: + +[dim1_start:dim1_end:dim1_step, dim2_start:dim2_end:dim2_step, ... , dimn_start:dimn_stop:dimn_step] + +The number of tuples "start:stop:step" should equal the number of dimensions of the dataset. + +For each tuple: + +* start must be greater than or equal to zero and less than the dimension extent +* stop must be greater than or equal to start and less than or equal to the dimension extent +* step is optional and if provided must be greater than 0. If not provided, the step value for that dimension is assumed to be 1. + +Attributes +:::::::::: This implementation of the operation does not use request parameters. Request Headers @@ -42,7 +116,15 @@ For other request headers, see :doc:`../CommonRequestHeaders` Request Body ------------ -The request body should be a JSON object with the following keys: + +Datasets +:::::::: + +If a binary request is being made, the request body should contain just the binary data values +to be written. Any desired selection information should then be passed as a request parameter instead +of in the request body. + +If a binary request is not being made, the request body should be a JSON object with the following keys: start: ^^^^^^ @@ -90,6 +172,25 @@ efficient for large data transfers than using a JSON array. Note: "value_base64" is only supported for fixed length datatypes. +Attributes +:::::::::: + +If a binary request is being made, the request body should contain just the binary data values +to be written. + +If a binary request is not being made, the request body should be a JSON object with the following keys: + +value: +^^^^^^ +A JSON array containing the data values to be written. + +value_base64: +^^^^^^^^^^^^^ + +Use this key instead of "value" to use base64-encoded binary data rather than JSON ascii. This will be more +efficient for large data transfers than using a JSON array. + +Note: "value_base64" is only supported for fixed length datatypes. Responses ========= @@ -111,9 +212,8 @@ Special Errors This implementation of the operation does not return special errors. For general information on standard error codes, see :doc:`../CommonErrorResponses`. -Examples -======== - +Dataset Examples +================ Sample Request -------------- @@ -210,6 +310,157 @@ Sample Response Content-Type: text/html; charset=UTF-8 Server: nginx/1.15.0 +Sample Request - Binary +----------------------- + +This example writes a 10x10 integer dataset with the values 0-99 inclusive using a binary request. + +*TODO* + +.. code-block:: http + + PUT /datasets/d-d13cddf0-8ad1-11e8-8126-0242ac12000d/value HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Content-Length: 421 + Content-Type: application/octet-stream + Accept: */* + Accept-Encoding: gzip, deflate + + + +Sample cURL command +------------------- + +.. code-block:: bash + + $ + +Sample Response +--------------- + +.. code-block:: http + + HTTP/1.1 200 OK + Date: Wed, 18 Jul 2018 21:34:41 GMT + Content-Length: 0 + Content-Type: text/html; charset=UTF-8 + Server: nginx/1.15.0 + +Sample Request - Binary w/ Selection +------------------------------------ + +This example writes a portion of the dataset by using a binary request with the selection +information supplied in the request parameters. + +*TODO* + +.. code-block:: http + + PUT /datasets/d-d13cddf0-8ad1-11e8-8126-0242ac12000d/value?select=[0:1:1,4:9:1] HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Content-Type: application/octet-stream + Content-Length: 64 + Accept: */* + Accept-Encoding: gzip, deflate + + + +Sample cURL command +------------------- + +.. code-block:: bash + + $ + +Sample Response +--------------- + +.. code-block:: http + + HTTP/1.1 200 OK + Date: Wed, 18 Jul 2018 21:46:48 GMT + Content-Length: 0 + Content-Type: text/html; charset=UTF-8 + Server: nginx/1.15.0 + + +Attribute Examples +================== + +Sample Request +-------------- + +.. code-block:: http + + PUT /datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/attributes/attr1/value HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Content-Type: application/json + Accept-Encoding: gzip, deflate + Accept: */* + +.. code-block:: json + + { + "value": [49, 115, 116, 32, 97, 116, 116, 114, 105, 98, 117, 116, 101, 32, 111, 102, 32, 100, 115, 101, 116, 49, 46, 49, 46, 49, 0] + } + +Sample cURL command +------------------- + +.. code-block:: bash + + $ curl -X PUT -u username:password --header "X-Hdf-domain: /shared/tall.h5" --header "Content-Type: application/json" + -d "{\"value\": [49, 115, 116, 32, 97, 116, 116, 114, 105, 98, 117, 116, 101, 32, 111, 102, 32, 100, 115, 101, 116, 49, 46, 49, 46, 49, 0]}" + hsdshdflab.hdfgroup.org/datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/attributes/attr1/value + +Sample Response +--------------- + +.. code-block:: http + + HTTP/1.1 200 OK + Date: Fri, 20 Jul 2018 16:37:58 GMT + Content-Length: 0 + Etag: "788efb3caaba7fd2ae5d1edb40b474ba94c877a8" + Server: nginx/1.15.0 + +Sample Request - Binary +----------------------- + +*TODO* + +.. code-block:: http + + PUT /datasets/d-be8bace4-83c5-11e8-90e7-0242ac120013/attributes/attr1/value HTTP/1.1 + Host: hsdshdflab.hdfgroup.org + X-Hdf-domain: /shared/tall.h5 + Content-Type: application/octet-stream + Accept-Encoding: gzip, deflate + Accept: */* + + + +Sample cURL command +------------------- + +.. code-block:: bash + + $ + +Sample Response +--------------- + +.. code-block:: http + + HTTP/1.1 200 OK + Date: Fri, 20 Jul 2018 16:37:58 GMT + Content-Length: 0 + Etag: "788efb3caaba7fd2ae5d1edb40b474ba94c877a8" + Server: nginx/1.15.0 + Related Resources ================= diff --git a/DatasetOps/index.rst b/DatasetOps/index.rst index 9e1ac95..444ae38 100644 --- a/DatasetOps/index.rst +++ b/DatasetOps/index.rst @@ -27,7 +27,7 @@ Writing data to a dataset ------------------------- To write data into the dataset, use the :doc:`PUT_Value` operation. The request can either provide values for the entire dataset, or values for a hyperslab (rectangular -sub-region) selection. In addition, if it desired to update a specific list of +sub-region) selection. In addition, if it is desired to update a specific list of data elements, a point selection (series of element coordinates) can be passed to the :doc:`PUT_Value` operation.