Full Code of HDFGroup/h5serv for AI

develop 12c1c4786259 cached
208 files
851.0 KB
246.3k tokens
465 symbols
1 requests
Download .txt
Showing preview only (896K chars total). Download the full file or copy to clipboard to get everything.
Repository: HDFGroup/h5serv
Branch: develop
Commit: 12c1c4786259
Files: 208
Total size: 851.0 KB

Directory structure:
gitextract_szc0bvdr/

├── .gitignore
├── .gitmodules
├── .travis.yml
├── COPYING
├── Dockerfile
├── README.rst
├── data/
│   ├── public/
│   │   └── tall.h5
│   └── readme.txt
├── docs/
│   ├── AclOps/
│   │   ├── GET_ACL.rst
│   │   ├── GET_ACLs.rst
│   │   ├── PUT_ACL.rst
│   │   └── index.rst
│   ├── AdminTools.rst
│   ├── AttrOps/
│   │   ├── DELETE_Attribute.rst
│   │   ├── GET_Attribute.rst
│   │   ├── GET_Attributes.rst
│   │   ├── PUT_Attribute.rst
│   │   └── index.rst
│   ├── Authorization.rst
│   ├── CommonErrorResponses.rst
│   ├── CommonRequestHeaders.rst
│   ├── CommonResponseHeaders.rst
│   ├── DatasetOps/
│   │   ├── DELETE_Dataset.rst
│   │   ├── GET_Dataset.rst
│   │   ├── GET_DatasetShape.rst
│   │   ├── GET_DatasetType.rst
│   │   ├── GET_Datasets.rst
│   │   ├── GET_Value.rst
│   │   ├── POST_Dataset.rst
│   │   ├── POST_Value.rst
│   │   ├── PUT_DatasetShape.rst
│   │   ├── PUT_Value.rst
│   │   └── index.rst
│   ├── DatatypeOps/
│   │   ├── DELETE_Datatype.rst
│   │   ├── GET_Datatype.rst
│   │   ├── GET_Datatypes.rst
│   │   ├── POST_Datatype.rst
│   │   └── index.rst
│   ├── Diagram.rst
│   ├── DomainOps/
│   │   ├── DELETE_Domain.rst
│   │   ├── GET_Domain.rst
│   │   ├── PUT_Domain.rst
│   │   └── index.rst
│   ├── FAQ/
│   │   └── index.rst
│   ├── GroupOps/
│   │   ├── DELETE_Group.rst
│   │   ├── DELETE_Link.rst
│   │   ├── GET_Group.rst
│   │   ├── GET_Groups.rst
│   │   ├── GET_Link.rst
│   │   ├── GET_Links.rst
│   │   ├── POST_Group.rst
│   │   ├── PUT_Link.rst
│   │   └── index.rst
│   ├── Hypermedia.rst
│   ├── Installation/
│   │   ├── ServerSetup.rst
│   │   └── index.rst
│   ├── Introduction/
│   │   └── index.rst
│   ├── License/
│   │   └── index.rst
│   ├── Makefile
│   ├── Reference.rst
│   ├── Resources.rst
│   ├── Tutorials/
│   │   ├── IPython_samples.rst
│   │   └── index.rst
│   ├── Types/
│   │   └── index.rst
│   ├── UsingIteration.rst
│   ├── Utilities.rst
│   ├── WhatsNew/
│   │   └── index.rst
│   ├── _static/
│   │   └── README
│   ├── build.sh
│   ├── conf.py
│   ├── index.rst
│   └── make.bat
├── entrypoint.sh
├── examples/
│   ├── h5pyd_ex1.ipynb
│   ├── h5pyd_ex2.ipynb
│   ├── nodejs/
│   │   └── gettoc.js
│   ├── pi_compute.ipynb
│   └── rest_ex1.ipynb
├── h5serv/
│   ├── __init__.py
│   ├── __main__.py
│   ├── app.py
│   ├── authFile.py
│   ├── authMongo.py
│   ├── config.py
│   ├── fileUtil.py
│   ├── h5watchdog.py
│   ├── httpErrorUtil.py
│   ├── passwordUtil.py
│   ├── timeUtil.py
│   └── tocUtil.py
├── setup.py
├── test/
│   ├── aws/
│   │   ├── config.py
│   │   └── roottest.py
│   ├── integ/
│   │   ├── acltest.py
│   │   ├── attributetest.py
│   │   ├── config.py
│   │   ├── datasettest.py
│   │   ├── datasettypetest.py
│   │   ├── datatypetest.py
│   │   ├── dirtest.py
│   │   ├── grouptest.py
│   │   ├── helper.py
│   │   ├── linktest.py
│   │   ├── makeattr.py
│   │   ├── makegroups.py
│   │   ├── roottest.py
│   │   ├── setupdata.py
│   │   ├── shapetest.py
│   │   ├── spidertest.py
│   │   └── valuetest.py
│   ├── test_files/
│   │   ├── array_attr.h5
│   │   ├── array_dset.h5
│   │   ├── arraytype.h5
│   │   ├── attr1k.h5
│   │   ├── bitfield_attr.h5
│   │   ├── bitfield_dset.h5
│   │   ├── bool_attr.h5
│   │   ├── bool_dset.h5
│   │   ├── committed_type.h5
│   │   ├── comp_complex.h5
│   │   ├── compound.h5
│   │   ├── compound_array.h5
│   │   ├── compound_array_attr.h5
│   │   ├── compound_array_dset.h5
│   │   ├── compound_attr.h5
│   │   ├── compound_committed.h5
│   │   ├── dim_scale.h5
│   │   ├── dim_scale_data.h5
│   │   ├── dset1k.h5
│   │   ├── dset_creationprop.h5
│   │   ├── dset_gzip.h5
│   │   ├── empty.h5
│   │   ├── enum_attr.h5
│   │   ├── enum_dset.h5
│   │   ├── ex_image2.h5
│   │   ├── ex_image3.h5
│   │   ├── fillvalue.h5
│   │   ├── fixed_string_attr.h5
│   │   ├── fixed_string_dset.h5
│   │   ├── group100.h5
│   │   ├── group1k.h5
│   │   ├── h5ex_d_alloc.h5
│   │   ├── h5ex_d_checksum.h5
│   │   ├── h5ex_d_chunk.h5
│   │   ├── h5ex_d_compact.h5
│   │   ├── h5ex_d_extern.h5
│   │   ├── h5ex_d_fillval.h5
│   │   ├── h5ex_d_gzip.h5
│   │   ├── h5ex_d_hyper.h5
│   │   ├── h5ex_d_nbit.h5
│   │   ├── h5ex_d_rdwr.h5
│   │   ├── h5ex_d_shuffle.h5
│   │   ├── h5ex_d_sofloat.h5
│   │   ├── h5ex_d_soint.h5
│   │   ├── h5ex_d_transform.h5
│   │   ├── h5ex_d_unlimadd.h5
│   │   ├── h5ex_d_unlimgzip.h5
│   │   ├── h5ex_d_unlimmod.h5
│   │   ├── namedtype.h5
│   │   ├── notahdf5file.h5
│   │   ├── null_objref_dset.h5
│   │   ├── null_space_attr.h5
│   │   ├── null_space_dset.h5
│   │   ├── objref_attr.h5
│   │   ├── objref_dset.h5
│   │   ├── opaque_attr.h5
│   │   ├── opaque_dset.h5
│   │   ├── regionref_attr.h5
│   │   ├── regionref_dset.h5
│   │   ├── resizable.h5
│   │   ├── sample.h5
│   │   ├── scalar.h5
│   │   ├── scalar_attr.h5
│   │   ├── tall.h5
│   │   ├── tall_with_udlink.h5
│   │   ├── tallrw.h5
│   │   ├── tgroup.h5
│   │   ├── tref.h5
│   │   ├── tstr.h5
│   │   ├── type1k.h5
│   │   ├── types_attr.h5
│   │   ├── types_dset.h5
│   │   ├── vlen_attr.h5
│   │   ├── vlen_dset.h5
│   │   ├── vlen_string_attr.h5
│   │   ├── vlen_string_dset.h5
│   │   ├── vlen_string_dset_utc.h5
│   │   ├── vlen_string_nullterm_attr.h5
│   │   ├── vlen_string_nullterm_dset.h5
│   │   ├── vlen_unicode_attr.h5
│   │   └── zerodim.h5
│   ├── testall.py
│   └── unit/
│       ├── config.py
│       ├── fileUtilTest.py
│       └── timeUtilTest.py
└── util/
    ├── admin/
    │   ├── add_user.py
    │   ├── config.py
    │   ├── getacl.py
    │   ├── import_file.py
    │   ├── makepwd_file.py
    │   ├── remove_db.py
    │   ├── setacl.py
    │   └── update_pwd.py
    ├── dumpobjdb.py
    ├── dumptojson.sh
    ├── exporth5.py
    ├── exportjson.py
    └── rebuildIndex.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
.DS_Store
*.pyc
data/*.h5
data/*.db
test/unit/*.h5
test/unit/*.db

# jetbrains IDE stuff
.idea
*.iml



================================================
FILE: .gitmodules
================================================
[submodule "hdf5-json"]
	path = hdf5-json
	url = https://github.com/HDFGroup/hdf5-json.git
[submodules "hdf5-json"]
	branch = stable


================================================
FILE: .travis.yml
================================================
language: python

notifications:
  email: false

python:
  - "2.7"
  - "3.4"
  - "3.5"
  - "3.6"
  - "3.7"
  - "3.8"


install:
    - sudo apt-get update -qq
    - sudo apt-get install -qq libhdf5-serial-dev
    - pip uninstall numpy -y 
    - pip install numpy>=1.10.4
    - pip install h5py
    - pip install requests
    - pip install pytz
    - pip install tornado
    - pip install watchdog
    - git clone https://github.com/HDFGroup/hdf5-json.git
    - cd hdf5-json
    - python setup.py install
    - cd ..
    - pip install .

script:
    - PYTHONPATH="test/unit" python test/testall.py --unit --failslow
    - python h5serv >h5serv.out &
    - sleep 5
    - PYTHONPATH="test/integ" python test/testall.py --integ --failslow


================================================
FILE: COPYING
================================================

Copyright Notice and License Terms for 
h5serv Software Service, Libraries and Utilities
-----------------------------------------------------------------------------

h5serv (HDF5 REST Server) Service, Libraries and Utilities
Copyright 2014-2017 by The HDF Group.

All rights reserved.

Redistribution and use in source and binary forms, with or without 
modification, are permitted for any purpose (including commercial purposes) 
provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, 
   this list of conditions, and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, 
   this list of conditions, and the following disclaimer in the documentation 
   and/or materials provided with the distribution.

3. In addition, redistributions of modified forms of the source or binary 
   code must carry prominent notices stating that the original code was 
   changed and the date of the change.

4. All publications or advertising materials mentioning features or use of 
   this software are asked, but not required, to acknowledge that it was 
   developed by The HDF Group and credit the contributors.

5. Neither the name of The HDF Group, nor the name of any Contributor may 
   be used to endorse or promote products derived from this software 
   without specific prior written permission from The HDF Group or the 
   Contributor, respectively.

DISCLAIMER: 
THIS SOFTWARE IS PROVIDED BY THE HDF GROUP AND THE CONTRIBUTORS 
"AS IS" WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED.  In no 
event shall The HDF Group or the Contributors be liable for any damages 
suffered by the users arising out of the use of this software, even if 
advised of the possibility of such damage. 


================================================
FILE: Dockerfile
================================================
FROM python:3.6
MAINTAINER John Readey <jreadey@hdfgroup.org>
RUN cd /usr/local/src                                    ; \
    pip install --upgrade pip                            ; \
    pip install h5py                                     ; \
    pip install tornado                                  ; \
    pip install requests                                 ; \
    pip install pytz                                     ; \
    pip install watchdog                                 ; \
    pip install pymongo       
WORKDIR /usr/local/src         
RUN git clone https://github.com/HDFGroup/hdf5-json.git  ; \
    cd hdf5-json                                         ; \
    python setup.py install                              ; \
    cd ..                                                ; \
    mkdir h5serv       
WORKDIR /usr/local/src/h5serv                                                          
COPY h5serv h5serv                                       
COPY util util                                         
COPY test test                                        
COPY data /data 
RUN  cp /usr/local/src/hdf5-json/data/hdf5/tall.h5 /data ; \                                      
     ln -s /data 
                              
EXPOSE 5000 

COPY entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh"]


================================================
FILE: README.rst
================================================
h5serv - REST-based service for HDF5 data
===========================================

.. image:: https://travis-ci.org/HDFGroup/h5serv.svg?branch=develop
    :target: https://travis-ci.org/HDFGroup/h5serv

Introduction
------------
h5serv is a web service that implements a REST-based web service for HDF5 data stores
as described in the paper: http://hdfgroup.org/pubs/papers/RESTful_HDF5.pdf. 

Notice
------
h5serv has been deprecated.  Users looking for a RESTful way of accessing HDF data should 
use HSDS (https://github.com/HDFGroup/hsds) instead.

Websites
--------

* Main website: http://www.hdfgroup.org
* Source code: https://github.com/HDFGroup/h5serv
* Mailing list: hdf-forum@lists.hdfgroup.org <hdf-forum@lists.hdfgroup.org>
* Documentation: http://h5serv.readthedocs.org


Quick Install
-------------

Install Python (2.7 or later) and the following packages:

* NumPy 1.10.4 or later
* h5py 2.5 or later
* tornado 4.0.2 or later
* watchdog 0.8.3 or later
* requests 2.3 or later (for client tests)

Clone the hdf5-json project: ``git clone https://github.com/HDFGroup/hdf5-json.git`` .
Next, cd to the hdf5-json folder and run: ``python setup.py install``.

Clone this project: ``git clone https://github.com/HDFGroup/h5serv.git``.

Running the Server
------------------

Start the server:  ``cd h5serv; python h5serv``.

By default the server will listen on port 5000.  The port and and several other defaults can be modified
with command line options.  For example to use port 8888 run:  ``python h5serv --port=8888``.

See test cases for examples of interacting with the server.  Run: ``python testall.py`` from the test directory 
to run through the entire test suite.

Also, the interface (at least as far as read requests) can be explored in a browser. Go to: http://127.0.0.1:5000/.  
A JSON browser plugin will be helpful for formatting responses from the server to be more human readable.

See h5serv/docs/Installation.rst for step by step install instructions.

Running with Docker
-------------------

To run h5serv as a docker container you just need to install Docker (no Python, h5py, etc. needed).

* Install docker: https://docs.docker.com/installation/#installation.
* Run the h5serv image: ``docker run -p 5000:5000 -d -v <mydata>:/data hdfgroup/h5serv`` where <mydata> is the folder path that contains any HDF5 files you want to made available through the h5serv REST API.  Since requests to the server can modify (or delete!) content, you probably want to create a new folder and copy files to it.
* Go to http://192.168.99.100:5000/ in your browser to verify the server is up and running (replace 192.168.99.100 with the IP address of the system or VM that is running the container).

Writing Client Applications
----------------------------
As a REST service, clients be developed using almost any programming language.  The 
test programs under: h5serv/test/integ illustrate some of the methods for peforming
different operations using Python. 

The related project: https://github.com/HDFGroup/h5pyd provides a (mostly) h5py-compatible 
interface to the server for Python clients.


Uninstalling
------------

h5serv does not modify anything in the system outside the directory where it was 
installed, so just remove the install directory and all contents to uninstall.

    
Reporting bugs (and general feedback)
-------------------------------------

Create new issues at http://github.com/HDFGroup/h5serv/issues for any problems you find. 

For general questions/feedback, please use the list (hdf-forum@lists.hdfgroup.org).


================================================
FILE: data/readme.txt
================================================
This is the default location for HDF5 data files to be visible in h5serv.


================================================
FILE: docs/AclOps/GET_ACL.rst
================================================
**********************************************
GET ACL
**********************************************

Description
===========
Returns access information for the given user for the object with the UUID provided in the URI.

Requests
========

Syntax
------

To get a user's default access for a domain:

.. code-block:: http

    GET /acls/<userid> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>

To get a user's access information for a group:

.. code-block:: http

    GET /groups/<id>/acls/<userid> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>   

To get a user's access information for a dataset:

.. code-block:: http

    GET /datasets/<id>/acls/<userid> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    

To get a user's access information for a committed datatype:

.. code-block:: http

    GET /datatypes/<id>/acls/<userid> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>

where:
    
* <id> is the UUID of the requested dataset/group/committed datatype
* <userid> 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.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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


acl
^^^
A JSON object that describe a users acces permisions.  Subkeys of acl are:

userName: the userid of the requested user

create: A boolean flag that indicated if the user is authorized to create new resources

delete: A boolean flag that indicated if the user is authorized to delete resources

read: A boolean flag that indicated if the user is authorized to read (GET) resources

update: A boolean flag that indicated if the user is authorized to update resources

readACL: A boolean flag that indicated if the user is authorized to read the object's ACL

updateACL: A boolean flag that indicated if the user is authorized to update the object's ACL

 
hrefs
^^^^^
An array of hypertext links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    GET /groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e/acls/test_user1 HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Fri, 16 Jan 2015 20:06:08 GMT
    Content-Length: 660
    Etag: "2c410d1c469786f25ed0075571a8e7a3f313cec1"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"
        },
        {
            "href": "http://tall_acl.test.hdfgroup.org/groups/eb8f6959-8775-11e5-96b6-3c15c2da029e",
            "rel": "owner"
        }
    ]
    
Related Resources
=================

* :doc:`PUT_ACL`
* :doc:`GET_ACLs`

 

 

================================================
FILE: docs/AclOps/GET_ACLs.rst
================================================
**********************************************
GET ACLs
**********************************************

Description
===========
Returns access information for all users defined in the ACL (Access Control List) 
for the object with the UUID provided in the URI.

Requests
========

Syntax
------

To get the ACL for a domain:

.. code-block:: http

    GET /acls HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>

To get the ACL for a group:

.. code-block:: http

    GET /groups/<id>/acls HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    

To get the ACL for a dataset:

.. code-block:: http

    GET /datasets/<id>/acls HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    

To get the ACL for a committed datatype:

.. code-block:: http

    GET /datatypes/<id>/acls HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>

where:
    
* <id> is the UUID of the requested dataset/group/committed datatype
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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


acls
^^^^
A JSON list that contains one element for each user specified in the ACL.
The elements will be JSON object that describe the users acces permisions.  
Subkeys of the element are are:

userName: the userid of the user ('default' for the default access)

create: A boolean flag that indicated if the user is authorized to create new resources

delete: A boolean flag that indicated if the user is authorized to delete resources

read: A boolean flag that indicated if the user is authorized to read (GET) resources

update: A boolean flag that indicated if the user is authorized to update resources

readACL: A boolean flag that indicated if the user is authorized to read the object's ACL

updateACL: A boolean flag that indicated if the user is authorized to update the object's ACL

 
hrefs
^^^^^
An array of hypertext links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    GET /groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e/acls  HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Fri, 16 Jan 2015 20:06:08 GMT
    Content-Length: 660
    Etag: "2c410d1c469786f25ed0075571a8e7a3f313cec1"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"
        }
    ]
    
Related Resources
=================

* :doc:`PUT_ACL`
* :doc:`GET_ACL`

 

 

================================================
FILE: docs/AclOps/PUT_ACL.rst
================================================
**********************************************
PUT ACL
**********************************************

Description
===========
Update the access information for the given user for the object with the UUID provided in the URI.

Requests
========

Syntax
------

To update a user's access information for a domain:

.. code-block:: http

    PUT /acls/<userid> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>

To update a user's access information for a group:

.. code-block:: http

    PUT /groups/<id>/acls/<userid> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    

To get a user's access information for a dataset:

.. code-block:: http

    PUT /datasets/<id>/acls/<userid> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    

To get a user's access information for a committed datatype:

.. code-block:: http

    PUT /datatypes/<id>/acls/<userid> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>

where:
    
* <id> is the UUID of the requested dataset/group/committed datatype
* <userid> 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.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Request Elements
----------------

The request body most include a JSON object that has the following keys and boolean values:

 { 
 'read': <True or False>, 
 
 'create': <True or False>, 
 
 'update': <True or False>, 
 
 'delete': <True or False>, 
 
 'readACL': <True or False>, 
 
 'updateACL': <True or False> 
 
 }

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

 
hrefs
^^^^^
An array of hypertext links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    PUT /groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e/acls/test_user1 HTTP/1.1
    host: tall.test.hdfgroup.org
    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 }
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Fri, 16 Jan 2015 20:06:08 GMT
    Content-Length: 660
    Etag: "2c410d1c469786f25ed0075571a8e7a3f313cec1"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    
    "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`

 

 

================================================
FILE: docs/AclOps/index.rst
================================================
####################
Access Control List
####################

Access Control List (ACL) are key-value stores that can be used to manage what operations can 
be performed by which user on group, dataset, or committed type objects.  Operations on other 
objects (e.g. links, dataspace, or attributes) use the ACL of the object they belong to.

Each ACL consists of 1 or more items in the form:

(username, read, create, update, delete, readACL, updateACL)

where username is a string, and read, create, update, delete, readACL, updateACL are booleans.
There flags have the following semantics when the given username is provided in the http
Authorization header:

* read: The given user is authorized for read access to the resource (generally all GET requests)
* create: The given user is authorized to create new resources (generally POST or PUT requests)
* update: The given user is authorized to modified a resource (e.g. :doc:`../DatasetOps\PUT_Value`)
* delete: The given user is authorized to delete a resource (e.g. Delete a Group)
* readACL: The given user is authorized to read the ACLs of a resource
* updateACL: The given user is authorized to modify the ACLs of a resource

A special username 'default' is used to denote the access permission for all other users who
or not list in the ACL (including un-authenticated requests that don't provide a username).

Example
-------

Suppose a given dataset has the following ACL:

========   ====  ======   ======  ======  =======  ========
username   read  create   update  delete  readACL  writeACL
========   ====  ======   ======  ======  =======  ========
default    true  false    false   false   false    false
joe        true  false    true    false   false    false
ann        true  true     true    true    true     true
========   ====  ======   ======  ======  =======  ========

This ACL would enable anyone to read (perform GET requests).  User 'joe' would be able 
to read and update (modify values in the dataset).  While user 'ann' would have full 
control to do any operation on the dataset (including modifying permissions for herself or
other users).

The following unauthenticated (no HTTP Authorization header) 
requests on the dataset would be granted or denied as follows:

* GET /datasets/<id> - granted (returns HTTP Status 200 - OK)
* POST /datasets/<id>/value - granted (returns HTTP Status 200 - OK)
* PUT /datasets/<id>/shape) - denied (returns HTTP Status 401 - Unauthorized)
* PUT /datasets/<id>/attributes/<name> - denied (returns HTTP Status 401 - Unauthorized)
* DELETE /datasets/<id>  - denied (returns HTTP Status 401 - Unauthorized)

Next the same set of requests are sent with 'joe' as the user in the HTTP Authorization header:

* GET /datasets/<id> - granted (returns HTTP Status 200 - OK)
* POST /datasets/<id>/value - granted (returns HTTP Status 200 - OK)
* PUT /datasets/<id>/shape) - grant (returns HTTP Status 200 - OK)
* PUT /datasets/<id>/attributes/<name> - denied (returns HTTP Status 403 - Forbidden)
* DELETE /datasets/<id>  - denied (returns HTTP Status 403 - Forbidden)

Finally the same set of requests are sent with 'ann' as the user:

* GET /datasets/<id> - granted (returns HTTP Status 200 - OK)
* POST /datasets/<id>/value - granted (returns HTTP Status 200 - OK)
* PUT /datasets/<id>/shape) - grant (returns HTTP Status 200 - OK)
* PUT /datasets/<id>/attributes/<name> - denied (returns HTTP Status 201 - Created)
* DELETE /datasets/<id>  - denied (returns HTTP Status 200 - OK)
 
Note: HTTP Status 401 basically says: "you can't have access until you tell me who your are", 
while HTTP Status 403 says: "I know who you are, but you don't have permissions to access this
resource."

Root ACL Inheritance
--------------------

In many cases it will be desired to have a default ACL that applies to each resource in the domain.
This can be accomplished by defining an ACL for the root group.  This will control the access 
rights for any resource unless of ACL is present in that resource for the requesting user.

The default ACL can be read or updated by forming a request with a uri that includes the root group id, 
i.e.: "/groups/<root_id>/acls", or by using the uri path for the domain, i.e. "/acls".


For a given user then, the permissions for a resource are found in the following way:

#. If the user is present in the resources ACL, those permissions are used
#. If no user is present in the resources ACL, but is present in the root group, those permissions are used
#. Otherwise, if a 'default' user is present in the resource ACL, those permissions are used
#. If a 'default' user is not present in the resource ACL, but is present in the root ACL, those permissions are used
#. If no 'default' user is present in the root ACL, the permissions defined in the 'default_acl' config is used
  
List of Operations
------------------

.. toctree::
   :maxdepth: 1

   GET_ACL
   GET_ACLs
   PUT_ACL
    
    


================================================
FILE: docs/AdminTools.rst
================================================
###################
Admin Tools
###################

The scripts described here are intended to be run on the server by "privileged" users.  These are all
located in the ``util\admin`` directory.

makepwd_file.py
---------------

This script creates an initial password file "passwd.h5".  The password file will be used to manage 
http basic authentication.  After creation, move the file into the location referenced by 
the 'password_file' configuration value.

Usage:

``python makepwd_file.py``

Use the update_pwd.py utility to create user accounts.

update_pwd.py
-------------

This script can be used to add users and passwords to the password file, list information about
one or more users, or to update a user's information (e.g. change the password).

Usage: 

``python update_pwd.py [-h] [-r] [-a] [-f FILE] [-u USER] [-p PASSWD]``
  
Options:
 * ``-h``: print usage information
 * ``-r``: update a user's entry
 * ``-a``: add a user (requires -u and -p options)
 * ``-f``: password file to be used
 * ``-u``: print/update information for specified user (otherwise show all users)
 * ``-p``: password to be set for the given users
 

  Example - list all users
       ``python update_pwd.py -f passwd.h5``
  Example - list user 'bob':
       ``python update_pwd.py -f passwd.h5 -u bob``
  Example - add a user 'ann':
       ``python update_pwd.py -f passwd.h5 -a -u ann -p mysecret``
  Example - changes password for user 'paul':
       ``python update_pwd.py -f passwd.h5 -r -u paul -p mysecret2``
       
 Note, there is no way to display the passwords for any user.  If a password is 
 lost, that users password must be reset.
  
        
getacl.py
-----------

This script displays ACL's of a given file or object within a file.

usage: ``python getacl.py [-h] [-file <file>]  [-path <h5path>] [userid_1, userid_2, ... userid_n]``

Options:
 * ``-h``: print usage information
 * ``-file``: (required) data file to be used 
 * ``-path``: h5path to object.  If not present, ACLs of the root group will be displayed
 * ``<userids>``: list of user ids to fetch ACLs for.  If not present, ACLs for all users will be printed

 
  Example - get all ACLs of tall.h5 root group
       ``python getacl.py -file ../../data/tall.h5``
  Example - get ACLs for userid 123 of root group in tall.h5
       ``python getacl.py -file ../../data/tall.h5 123``
  Example - get ACLs for userid 123 of the dataset identified by path '/g1/g1.1/dset1.1.1'
       ``python getacl.py -file ../../data/tall.h5 -path /g1/g1.1/dset1.1.1``
       
setacl.py
-----------

This script creates or modifies ACL's of a given file or object within a file.

usage: ``python setacl.py [-h] [-file <file>]  [-path <h5path>] [+-][crudep] [userid_1, userid_2, ... userid_n]``

Options:
 * ``-h``: print usage information
 * ``-file``: (required) data file to be used 
 * ``-path``: h5path to object.  If not present, ACLs of the root group will be modified
 * ``[+-][crudep]``: add (+) or remove (-) permisions for Create (c), Read (r), Update (u), Delete (d), rEadAcl (e), and Putacl (p)
 * ``<userids>``: list of user ids to sets ACLs for.  If not present, ACLs for the default user will be set.

 
  Example - set default permission of tall.h5 to read only
       ``python setacl.py -file ../../data/tall.h5 +r-cudep``
  Example - give userid 123 full control of tall.h5:
       ``python setacl.py -file ../../data/tall.h5 +crudep 123``
  Example - give userid read/update access to dataset at path '/g1/g1.1/dset1.1.1' 
       ``python setacl.py -file ../../data/tall.h5 -path /g1/g1.1/dset1.1.1 +ru-cdep 123``
         
 
 
 




    


================================================
FILE: docs/AttrOps/DELETE_Attribute.rst
================================================
**********************************************
DELETE Attribute
**********************************************

Description
===========
The implementation of the DELETE operation deletes the attribute named in the URI.  All 
attributes and links of the dataset will also be deleted.

Requests
========

Syntax
------
.. code-block:: http

    DELETE /groups/<id>/<name> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
* *<id>* is the UUID of the dataset/group/committed datatype
* *<name>* is the url-encoded name of the requested attribute
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    DELETE /groups/36ae688a-ac0e-11e4-a44b-3c15c2da029e/attributes/attr1 HTTP/1.1
    Content-Length: 0
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: tall_updated.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Wed, 04 Feb 2015 01:36:17 GMT
    Content-Length: 420
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
  
    {
    "hrefs": [
        {"href": "http://tall_updated.test.hdfgroup.org/groups/36ae688a-ac0e-11e4-a44b-3c15c2da029e/attributes", "rel": "self"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/36ae688a-ac0e-11e4-a44b-3c15c2da029e", "rel": "owner"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/36ae688a-ac0e-11e4-a44b-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/", "rel": "home"}
      ]
    }
    
Related Resources
=================

* :doc:`GET_Attributes`
* :doc:`GET_Attribute`
* :doc:`../DatasetOps/GET_Dataset`
* :doc:`../DatatypeOps/GET_Datatype`
* :doc:`../GroupOps/GET_Group`
* :doc:`PUT_Attribute`
 

 

================================================
FILE: docs/AttrOps/GET_Attribute.rst
================================================
**********************************************
GET Attribute
**********************************************

Description
===========
Gets the specified attribute of a dataset, group, or committed datatype.

Requests
========

Syntax
------

To get an attribute of a group:

.. code-block:: http

    GET /groups/<id>/attributes/<name> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
To get an attribute of a dataset:

.. code-block:: http

    GET /datasets/<id>/attributes/<name> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
To get an attribute of a datatype:

.. code-block:: http

    GET /datatypes/<id>/attributes/<name> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
 
where:    
    
* *<id>* is the UUID of the dataset/group/committed datatype
* *<name>* is the url-encoded name of the requested attribute
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

type
^^^^
A JSON object representing the type of the attribute.  See :doc:`../Types/index` for 
details of the type representation.

shape
^^^^^

A JSON object that represents the dataspace of the attribute.  Subkeys of shape are:

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 complext 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 the current size of each dimension.  Dims
is not returned for H5S_NULL or H5S_SCALAR dataspaces.

value
^^^^^
A json array (or string or number for scalar datasets) giving the values of the requested 
attribute.

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

Get an attribute named "attr1" from a group with UUID: "45a882e1-...".

.. code-block:: http

    GET /groups/1a956e54-abf6-11e4-b878-3c15c2da029e/attributes/attr1 HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Tue, 03 Feb 2015 22:44:04 GMT
    Content-Length: 648
    Etag: "55b2e2ce2d3a2449a49cfd76c4dae635ec43a150"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    {
    "name": "attr1", 
    "type": {
        "class": "H5T_INTEGER",
        "base": "H5T_STD_I8LE" 
    },
    "shape": {
        "class": "H5S_SIMPLE",
        "dims": [10]
    }, 
    "value": [97, 98, 99, 100, 101, 102, 103, 104, 105, 0], 
    "created": "2015-02-03T22:40:09Z", 
    "lastModified": "2015-02-03T22:40:09Z",   
    "hrefs": [
        {"href": "http://tall.test.hdfgroup.org/groups/1a956e54-abf6-11e4-b878-3c15c2da029e/attributes/attr1", "rel": "self"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/1a956e54-abf6-11e4-b878-3c15c2da029e", "rel": "owner"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/1a956e54-abf6-11e4-b878-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall.test.hdfgroup.org/", "rel": "home"}
      ]
    }
    
Related Resources
=================

* :doc:`DELETE_Attribute`
* :doc:`GET_Attributes`
* :doc:`../DatasetOps/GET_Dataset`
* :doc:`../DatatypeOps/GET_Datatype`
* :doc:`../GroupOps/GET_Group`
* :doc:`PUT_Attribute`
 

 

================================================
FILE: docs/AttrOps/GET_Attributes.rst
================================================
**********************************************
GET Attributes
**********************************************

Description
===========
Gets all the attributes of a dataset, group, or committed datatype.
For each attribute the request returns the attributes name, type, and shape.  To get 
the attribute data use :doc:`GET_Attribute`.

Requests
========

Syntax
------

To get the attributes of a group:

.. code-block:: http

    GET /groups/<id>/attributes HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
To get the attributes of a dataset:

.. code-block:: http

    GET /datasets/<id>/attributes HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
To get the attributes of a datatype:

.. code-block:: http

    GET /datatypes/<id>/attributes HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
 
where:    
    
* *<id>* is the UUID of the dataset/group/committed datatype
    
Request Parameters
------------------
This implementation of the operation uses the following request parameters (both 
optional):

Limit
^^^^^
If provided, a positive integer value specifying the maximum number of attributes to return.

Marker
^^^^^^
If provided, a string value indicating that only attributes that occur after the
marker value will be returned.
*Note:* the marker expression should be url-encoded.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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


attributes
^^^^^^^^^^

An array of JSON objects with an element for each returned attribute.
Each element will have keys: name, type, shape, created, and lastModified.  See 
:doc:`GET_Attribute` for a description of these keys.

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

Get attributes of a group with UUID: "45a882e1-...".

.. code-block:: http

    GET /groups/1a956e54-abf6-11e4-b878-3c15c2da029e/attributes HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Wed, 04 Feb 2015 00:49:28 GMT
    Content-Length: 807
    Etag: "7cbeefcf8d9997a8865bdea3bf2d541a14e9bf71"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    {
    "attributes": [
        {
        "name": "attr1", 
        "type": {
            "base": "H5T_STD_I8LE", 
            "class": "H5T_INTEGER"
            },
        "shape": {
            "dims": [10], 
            "class": "H5S_SIMPLE"
            },
        "created": "2015-02-03T22:40:09Z",
        "lastModified": "2015-02-03T22:40:09Z", 
        },
        "name": "attr2", 
         "type": {
            "base": "H5T_STD_I32BE", 
            "class": "H5T_INTEGER"
            }, 
        "shape": {
            "dims": [2, 2], 
            "class": "H5S_SIMPLE"
            }, 
        "created": "2015-02-03T22:40:09Z",
        "lastModified": "2015-02-03T22:40:09Z",    
        }
      ], 
      "hrefs": [
        {"href": "http://tall.test.hdfgroup.org/groups/1a956e54-abf6-11e4-b878-3c15c2da029e/attributes", "rel": "self"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/1a956e54-abf6-11e4-b878-3c15c2da029e", "rel": "owner"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/1a956e54-abf6-11e4-b878-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall.test.hdfgroup.org/", "rel": "home"}
      ]
    }
    

Sample Request - get Batch
---------------------------

Get 5 the five attributes that occur after attribute "a0004" from a of a group with UUID: 
"45a882e1-...".

.. code-block:: http

    GET /groups/4cecd4dc-ac0a-11e4-af59-3c15c2da029e/attributes?Marker=a0004&Limit=5 HTTP/1.1
    host: attr1k.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response - get Batch
---------------------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Wed, 04 Feb 2015 01:08:16 GMT
    Content-Length: 1767
    Etag: "9483f4356e08d12b719aa64ece09e659b05adaf2"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
 
    {
    "attributes": [
        {
        "name": "a0005", 
        "type": {"cset": "H5T_CSET_ASCII", "order": "H5T_ORDER_NONE", "class": "H5T_STRING", "strpad": "H5T_STR_NULLTERM", "strsize": "H5T_VARIABLE"}, 
        "shape": {"class": "H5S_SCALAR"}, 
        "created": "2015-02-03T22:40:09Z",
        "lastModified": "2015-02-03T22:40:09Z"
        }, {
        "name": "a0006", 
        "type": {"cset": "H5T_CSET_ASCII", "order": "H5T_ORDER_NONE", "class": "H5T_STRING", "strpad": "H5T_STR_NULLTERM", "strsize": "H5T_VARIABLE"}, 
        "shape": {"class": "H5S_SCALAR"}, 
        "created": "2015-02-03T22:40:09Z",
        "lastModified": "2015-02-03T22:40:09Z"
        }, {
        "name": "a0007",
        "type": {"cset": "H5T_CSET_ASCII", "order": "H5T_ORDER_NONE", "class": "H5T_STRING", "strpad": "H5T_STR_NULLTERM", "strsize": "H5T_VARIABLE"}, 
        "shape": {"class": "H5S_SCALAR"}, 
        "created": "2015-02-03T22:40:09Z",
        "lastModified": "2015-02-03T22:40:09Z"
        }, {
        "name": "a0008", 
        "type": {"cset": "H5T_CSET_ASCII", "order": "H5T_ORDER_NONE", "class": "H5T_STRING", "strpad": "H5T_STR_NULLTERM", "strsize": "H5T_VARIABLE"}, 
        "shape": {"class": "H5S_SCALAR"}, 
        "created": "2015-02-03T22:40:09Z",
        "lastModified": "2015-02-03T22:40:09Z"
        }, {
        "name": "a0009", 
        "type": {"cset": "H5T_CSET_ASCII", "order": "H5T_ORDER_NONE", "class": "H5T_STRING", "strpad": "H5T_STR_NULLTERM", "strsize": "H5T_VARIABLE"}, 
        "shape": {"class": "H5S_SCALAR"}, 
        "created": "2015-02-03T22:40:09Z",
        "lastModified": "2015-02-03T22:40:09Z"
        }
      ], 
    "hrefs": [
        {"href": "http://attr1k.test.hdfgroup.org/groups/4cecd4dc-ac0a-11e4-af59-3c15c2da029e/attributes", "rel": "self"}, 
        {"href": "http://attr1k.test.hdfgroup.org/groups/4cecd4dc-ac0a-11e4-af59-3c15c2da029e", "rel": "owner"}, 
        {"href": "http://attr1k.test.hdfgroup.org/groups/4cecd4dc-ac0a-11e4-af59-3c15c2da029e", "rel": "root"}, 
        {"href": "http://attr1k.test.hdfgroup.org/", "rel": "home"}
      ]
    }
    
Related Resources
=================

* :doc:`DELETE_Attribute`
* :doc:`GET_Attributes`
* :doc:`../DatasetOps/GET_Dataset`
* :doc:`../DatatypeOps/GET_Datatype`
* :doc:`../GroupOps/GET_Group`
* :doc:`PUT_Attribute`
 

 

================================================
FILE: docs/AttrOps/PUT_Attribute.rst
================================================
**********************************************
PUT Attribute
**********************************************

Description
===========
Creates a new attribute in a group, dataset, or committed datatype.

*Note*: The new attribute will replace any existing attribute with the same name.

Requests
========

Syntax
------

To create a group attribute:

.. code-block:: http

    PUT /groups/<id>/attributes/<name> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
To create a dataset attribute:

.. code-block:: http

    PUT /datasets/<id>/attributes/<name> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
To create a committed datatype attribute:

.. code-block:: http

    PUT /datatypes/<id>/attributes/<name> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
* *<id>* is the UUID of the dataset/group/committed datatype
* *<name>* is the url-encoded name of the requested attribute
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Request Elements
----------------

The request body must include a JSON object with "type" key.  Optionally a "shape"
key can be provide to make a non-scalar attribute.


type
^^^^

Specify's the desired type of the attribute.  Either a string that is one of the 
predefined type values, a uuid of a committed type, or a JSON object describing the type.
See :doc:`../Types/index` for details of the type specification.

shape
^^^^^^

Either a string with the value ``H5S_NULL`` or an
integer array describing the dimensions of the attribute. 
If shape is not provided, a scalar attribute will be created.
If a shape value of ``H5S_NULL`` is specified a null space attribute will be created.
(Null space attributes can not contain any data values.)

value
^^^^^

A JSON array (or number or string for scalar attributes with primitive types) that 
specifies the initial values for the attribute.  The elements of the array must be 
compatible with the type of the attribute.
Not valid to provide if the shape is ``H5S_NULL``.

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request - scalar attribute
----------------------------------

Create an integer scalar attribute in the group with UUID of "be319519-" named "attr4".  
The value of the attribute will be 42.

.. code-block:: http

    PUT /groups/be319519-acff-11e4-bf8e-3c15c2da029e/attributes/attr4 HTTP/1.1
    Content-Length: 38
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: tall_updated.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
    
.. code-block:: json

    {
    "type": "H5T_STD_I32LE", 
    "value": 42
    }
    
Sample Response - scalar attribute
-----------------------------------

.. code-block:: http

   HTTP/1.1 201 Created
   Date: Thu, 05 Feb 2015 06:25:30 GMT
   Content-Length: 359
   Content-Type: application/json
   Server: TornadoServer/3.2.2
    
.. code-block:: json
  
    {"hrefs": [
        {"href": "http://tall_updated.test.hdfgroup.org/groups/be319519-acff-11e4-bf8e-3c15c2da029e/attributes/attr4", "rel": "self"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/be319519-acff-11e4-bf8e-3c15c2da029e", "rel": "owner"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/be319519-acff-11e4-bf8e-3c15c2da029e", "rel": "root"}
      ]
    }
    
Sample Request - string attribute
----------------------------------

Create a two-element, fixed width string  attribute in the group with UUID of 
"be319519-" named "attr6".  
The attributes values will be "Hello, ..." and "Goodbye!".

.. code-block:: http

    PUT /groups/be319519-acff-11e4-bf8e-3c15c2da029e/attributes/attr6 HTTP/1.1
    Content-Length: 162
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: tall_updated.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
    
.. code-block:: json
  
    {
    "shape": [2], 
    "type": {
        "class": "H5T_STRING",
        "cset": "H5T_CSET_ASCII",  
        "strpad": "H5T_STR_NULLPAD", 
        "strsize": 40
    }, 
    "value": ["Hello, I'm a fixed-width string!", "Goodbye!"]
    }
    
Sample Response - string attribute
-----------------------------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Thu, 05 Feb 2015 06:42:14 GMT
    Content-Length: 359
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
     
    {
    "hrefs": [
        {"href": "http://tall_updated.test.hdfgroup.org/groups/be319519-acff-11e4-bf8e-3c15c2da029e/attributes/attr6", "rel": "self"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/be319519-acff-11e4-bf8e-3c15c2da029e", "rel": "owner"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/be319519-acff-11e4-bf8e-3c15c2da029e", "rel": "root"}
      ]
    }
    
Sample Request - compound type
----------------------------------

Create a two-element, attribute of group with UUID of 
"be319519-" named "attr_compound".   The attribute has a compound type with an integer
and a floating point element. 

.. code-block:: http

    PUT /groups/be319519-acff-11e4-bf8e-3c15c2da029e/attributes/attr_compound HTTP/1.1
    Content-Length: 187
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: tall_updated.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
.. code-block:: json
  
    
    {
    "shape": 2, 
    "type": {
        "class": "H5T_COMPOUND",
        "fields": [
            {"type": "H5T_STD_I32LE", "name": "temp"}, 
            {"type": "H5T_IEEE_F32LE", "name": "pressure"}
        ] 
    }, 
    "value": [[55, 32.34], [59, 29.34]]
    }
    
Sample Response - compound type 
-----------------------------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Thu, 05 Feb 2015 06:49:19 GMT
    Content-Length: 367
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
       
    {
    "hrefs": [
        {"href": "http://tall_updated.test.hdfgroup.org/groups/be319519-acff-11e4-bf8e-3c15c2da029e/attributes/attr_compound", "rel": "self"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/be319519-acff-11e4-bf8e-3c15c2da029e", "rel": "owner"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/be319519-acff-11e4-bf8e-3c15c2da029e", "rel": "root"}
      ]
    }
    
    
    
Related Resources
=================

* :doc:`DELETE_Attribute`
* :doc:`GET_Attribute`
* :doc:`GET_Attributes`
* :doc:`../DatasetOps/GET_Dataset`
* :doc:`../DatatypeOps/GET_Datatype`
* :doc:`../GroupOps/GET_Group`
 

 


================================================
FILE: docs/AttrOps/index.rst
================================================
########################
Attributes
########################

Like datasets (see :doc:`../DatasetOps/index`), attributes are objects that contain a 
homogeneous collection of elements
and have associatted type information.  Attributes are typically small metadata objects
that describe some aspect of the object (dataset, group, or committed datatype) that 
contains the attribute.

Creating Attributes
--------------------

Use :doc:`PUT_Attribute` to create an attribute.  If there is an existing attribute
with the same name, it will be overwritten by this request.  You can use
:doc:`GET_Attribute` to inquire if the attribute already exists or not.
When creating an attribute, the attribute name, type, and shape (for non-scalar
attributes) is included in the request.


Reading and Writing Data
-------------------------
Unlike datasets, attribute's data can not be
read or written partially.  Data can only be written as part of the PUT requests.  
Reading the data of an attribute is done by :doc:`GET_Attribute`.

Listing attributes
------------------
Use :doc:`GET_Attributes` to get information about all the attributes of a group, 
dataset, or committed datatype.

Deleting Attributes
-------------------

Use :doc:`DELETE_Attribute` to delete an attribute.

List of Operations
------------------

.. toctree::
   :maxdepth: 1

   DELETE_Attribute
   GET_Attribute
   GET_Attributes
   PUT_Attribute
 
    
    


================================================
FILE: docs/Authorization.rst
================================================
*********************************
Authorization and Authentication
*********************************

Request Authentication
-----------------------
h5serv supports HTTP Basic authentication to authenticate users by comparing an encrypted 
username and password against a value stored within a password file.  
(See :doc:`AdminTools` to create a password file and add user accounts.) 

If neither the requested object (Group, Dataset, or Committed Datatype) nor the object's root group
has an Access Control List (ACL), authorization is not required and no authentication string
needs to be supplied. See :doc:`../AclOps`) for information on how to use ACL's.

If the requested object (or object's root group), does have an ACL, authorization may be required 
(if the object is not publically readable),
and if so the requestor will need to provide an Authorization header in the request.  If 
authoriazation is required, but not provided, the server will return an HTTP Status of 401 - 
Unauthorized.

If authorization is required (i.e. a 401 response is received), the client should provide an authorization header in the
http request which conveys the userid and password.

The authorization string is constructed as follows:

 1. Username and password are combined into a string "username:password". Note that username cannot contain the ":" character
 2. The resulting string is then encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line
 3. The authorization method and a space i.e. "Basic " is then put before the encoded string

For example, if the user agent uses 'Aladdin' as the username and 'open sesame' as the password then the field is 
formed as follows:
``Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==``.  When passwords are being sent over an open
network, SSL connections should be used to avoid "man in the middle attacks".  The Base64 encoding is
easily reversible and if using plain http there is no assurance that the password will not be compromised.

If the authorization string is validated, the server will verify the request is authorized as
per the object's ACL list.  If not authorized a http status 403 - Forbidden will be returned.


User ids and passwords
----------------------

User ids and passwords are maintained in an HDF5 file referenced in the server config: 
'password_file'.  The admin tool (See :doc:`AdminTools`) script: update_pwd.py can be used 
to create new users and update passwords.


 


================================================
FILE: docs/CommonErrorResponses.rst
================================================
***************************
Common Error Responses
***************************

For each request, h5serv returns a standard HTTP status code as described below.
In general 2xx codes indicate success, 3xx codes some form of redirection, 4xx codes 
client error, and 5xx codes for server errors.  In addition to the numeric code, h5serv
will return an informational message as part of the response providing further 
information on the nature of the error.

 * ``200 OK`` - The request was completed successfully
 * ``201 Created`` - The request was fulfilled and a new resource (e.g. group, dataset, attribute was created) 
 * ``400 Bad Request`` - The request was not structured correctly (e.g. a required key was missing).
 * ``401 Unauthorization`` - Use authentitcation is required, supply an Authentication header with valid user and password
 * ``403 Forbidden`` - The requesting user does not have access to the requested resource
 * ``404 Not Found`` - The requested resource was not found (e.g. ``GET /groups/<id>`` where <id> was not a valid identifier for a group in the domain).
 * ``409 Conflict`` - This error is used with PUT requests where the resources cannot be created because there is an existing resource with the same name (e.g. PUT / where the requested domain is already present).
 * ``410 Gone`` - The resource requested has been recently deleted.
 * ``500 Internal Error`` - An unexpected error that indicates some problem occurred on the server.
 * ``501 Not Implemented`` - The request depends on a feature that is not yet implemented.


================================================
FILE: docs/CommonRequestHeaders.rst
================================================
***********************
Common Request Headers
***********************

The following describe common HTTP request headers as used in h5serv:

 * Request line: The first line of the request, the format is of the form HTTP verb (GET, PUT, DELETE, or POST) followed by the path to the resource (e.g. /group/<uuid>.  Some operations take one or more query parameters (see relevant documentation) 
 * Accept: Specified the media type that is acceptable for the response.  Valid values are "application/json", and "*/*.  In addiiton, GET Value (see :doc:`DatasetOps/GET_Value`) supports the value "application/octet-stream"
 * Authorization: A string that provides the requester's credentials for the request. See  :doc:`Authorization`
 * Host: the domain (i.e. related collection of groups, datasets, and attributes) that the request should apply to
 
 Note: the host header can also be provided as a query paramter.  Example: https://data.hdfgroup.org:7258/?host=tall.test.data.hdfgroup.org 


================================================
FILE: docs/CommonResponseHeaders.rst
================================================
***************************
Common Response Headers
***************************

The following describes some of the common response lines returned by h5serv.

 * Status Line: the first line of the ressponse will always by: "``HTTP/1.1``" followed by 
    a status code (e.g. 200) followed by a reason message (e.g. "``OK``").  For errors, 
    an additional error message may be included on this line.
    
 * Content-Length: the response size in bytes.
 
 * Etag: a hash code that indicates the state of the requested resource.  If the client
    sees the same Etag value for the same request, it can assume the resource has not           
    changes since the last request.
    
 * Content-Type: the mime type of the response.  Currently always "``application/json``".
    


================================================
FILE: docs/DatasetOps/DELETE_Dataset.rst
================================================
**********************************************
DELETE Dataset
**********************************************

Description
===========
The implementation of the DELETE operation deletes the dataset named in the URI.  All 
attributes and links of the dataset will also be deleted.  In addition any 
links from other groups to the deleted group will be removed.

Requests
========

Syntax
------
.. code-block:: http

    DELETE /datasets/<id> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
*<id>* is the UUID of the requested dataset to be deleted.
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    DELETE /datasets/289bb654-a2c6-11e4-97d8-3c15c2da029e HTTP/1.1
    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 Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Fri, 23 Jan 2015 06:07:49 GMT
    Content-Length: 287
    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"}
      ]
    }
    
Related Resources
=================

* :doc:`GET_Datasets`
* :doc:`GET_Dataset`
* :doc:`POST_Dataset`
 

 

================================================
FILE: docs/DatasetOps/GET_Dataset.rst
================================================
**********************************************
GET Dataset
**********************************************

Description
===========
Returns information about the dataset with the UUID given in the URI.

Requests
========

Syntax
------
.. code-block:: http

    GET /datasets/<id> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
**<id>** is the UUID of the requested dataset.
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

id
^^
The UUID of the dataset object.

type
^^^^
A JSON object representing the type of the dataset.  See :doc:`../Types/index` for 
details of the type representation.

shape
^^^^^
A JSON object representing the shape of the dataset.  See :doc:`GET_DatasetShape` for
details of the shape representation.

creationProperties
^^^^^^^^^^^^^^^^^^
A JSON object that describes chunk layout, filters, fill value, and other aspects of the dataset.
See: http://hdf5-json.readthedocs.org/en/latest/bnf/dataset.html#grammar-token-dcpl for a complete 
description of fields that can be used.

attributeCount
^^^^^^^^^^^^^^
The number of attributes belonging to the dataset.

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

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    GET /datasets/c8d83759-a2c6-11e4-8713-3c15c2da029e HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Fri, 23 Jan 2015 06:15:33 GMT
    Content-Length: 755
    Etag: "ecbd7e52654b0a8f4ccbebac06175ce5df5f8c79"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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",
        "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"}
      ] 
    }
    
Related Resources
=================

* :doc:`DELETE_Dataset`
* :doc:`../AttrOps/GET_Attributes`
* :doc:`GET_DatasetShape`
* :doc:`GET_DatasetType`
* :doc:`GET_Datasets`
* :doc:`GET_Value`
* :doc:`POST_Value`
* :doc:`PUT_Value`
 

 

================================================
FILE: docs/DatasetOps/GET_DatasetShape.rst
================================================
**********************************************
GET Shape
**********************************************

Description
===========
Gets shape of a dataset.

Requests
========

Syntax
------
.. code-block:: http

    GET /datasets/<id>/shape HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
*<id>* is the UUID of the dataset that shape is requested for.
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

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 complext 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 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.

fillvalue: A value of compatible with the dataset's type, which gives the *fill* value
for the dataset (the value for 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 
UTC (ISO-8601 format).

lastModified
^^^^^^^^^^^^
A timestamp giving the most recent time the dataspace has been modified (i.e. a  
dimension has been extended) in UTC (ISO-8601 format).

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    GET /datasets/3b57b6d4-a6a8-11e4-96b5-3c15c2da029e/shape HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Wed, 28 Jan 2015 04:43:41 GMT
    Content-Length: 445
    Etag: "76ed777f151c70d0560d1414bffe1515a3df86b0"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"}
      ], 
    }
    
Sample Request - Resizable
--------------------------

.. code-block:: http

    GET /datasets/a64010e8-a6aa-11e4-98c8-3c15c2da029e/shape HTTP/1.1
    host: resizable.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response - Resizable
----------------------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Wed, 28 Jan 2015 05:00:59 GMT
    Content-Length: 500
    Etag: "1082800980d6809a8008b22e225f1adde8afc73f"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"}
      ] 
    }
    
Related Resources
=================

* :doc:`GET_Dataset`
* :doc:`GET_DatasetType`
* :doc:`PUT_DatasetShape`
 

 


================================================
FILE: docs/DatasetOps/GET_DatasetType.rst
================================================
**********************************************
GET Type
**********************************************

Description
===========
Gets Type Information for a dataset.

Requests
========

Syntax
------
.. code-block:: http

    GET /datasets/<id>/type HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
*<id>* is the UUID of the dataset the type information is requested for.
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

type
^^^^
A JSON object representing the type definition for the dataset. See :doc:`../Types/index`
for information on how different types are represented.

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request - Predefined Type
--------------------------------

.. code-block:: http

    GET /datasets/ba06ce68-a6b5-11e4-8ed3-3c15c2da029e/type HTTP/1.1
    host: scalar.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response - Predefined Type
---------------------------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Wed, 28 Jan 2015 06:20:16 GMT
    Content-Length: 519
    Etag: "802b160bf786596a9cb9f6d5cd6faa4fe1127e8c"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"}
      ] 
    }
    
Sample Request - Compound Type
--------------------------------

.. code-block:: http

    GET /datasets/b9edddd7-a6b5-11e4-9afd-3c15c2da029e/type HTTP/1.1
    host: compound.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response - Compound Type
--------------------------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Wed, 28 Jan 2015 06:20:16 GMT
    Content-Length: 1199
    Etag: "1f97eac24aa18d3c462a2f2797c4782a1f2a0aa2"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"}
            ] 
        }, 
        "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"}
          ] 
        }
    
Related Resources
=================

* :doc:`GET_Dataset`
* :doc:`GET_DatasetShape`
* :doc:`POST_Dataset`
 

 

================================================
FILE: docs/DatasetOps/GET_Datasets.rst
================================================
**********************************************
GET Datasets
**********************************************

Description
===========
Returns UUIDs for all the datasets in a domain.

Requests
========

Syntax
------
.. code-block:: http

    GET /datasets HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
Request Parameters
------------------
This implementation of the operation uses the following request parameters (both 
optional):

Limit
^^^^^
If provided, a positive integer value specifying the maximum number of UUID's to return.

Marker
^^^^^^
If provided, a string value indicating that only UUID's that occur after the
marker value will be returned.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

datasets
^^^^^^^^
An array of UUID's, one for each dataset in the domain.

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    GET /datasets HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Fri, 23 Jan 2015 06:33:36 GMT
    Content-Length: 413
    Etag: "977e96c7bc63a6e05d10d56565df2ab8d30e404d"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"}
      ]
    }
    
Sample Request with Marker and Limit
------------------------------------

This example uses the "Marker" request parameter to return only UUIDs after the given
Marker value.
The "Limit" request parameter is used to limit the number of UUIDs in the response to 5.

.. code-block:: http

    GET /datasets?Marker=817db263-a2cc-11e4-87f2-3c15c2da029e&Limit=5 HTTP/1.1
    host: dset1k.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
 
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
    Etag: "cb708d4839cc1e165fe6bb30718e49589ef140f4"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
   
.. 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"}
      ]
    } 
    
Related Resources
=================

* :doc:`DELETE_Dataset`
* :doc:`GET_Dataset`
* :doc:`POST_Dataset`
 

 

================================================
FILE: docs/DatasetOps/GET_Value.rst
================================================
**********************************************
GET Value
**********************************************

Description
===========
Gets data values of a dataset.

Requests
========

Syntax
------
.. code-block:: http

    GET /datasets/<id>/value HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
*<id>* is the UUID of the requested dataset.
    
Request Parameters
------------------

select
^^^^^^
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 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.

query
^^^^^
Optionally the request can provide a query value to select items from a dataset based on a 
condition expression.  E.g. The condition: "(temp > 32.0) & (dir == 'N')" would return elements 
of the dataset where the 'temp' field was greater than 32.0 and the 'dir' field was equal to 'N'.

Note: the query value needs to be url-encoded.

Note: the query parameter can be used in conjunction with the select parameter to restrict the return set to
the provided selection.

Note: the query parameter can be used in conjunction with the Limit parameter to limit the 
number of matches returned.

Note: Currently the query parameter can only be used with compound type datasets that are
one-dimensional.

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.


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".

Note: Binary responses are only supported for dataset 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`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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.

index
^^^^^
A list of indexes for each element that met the query condition (only provided when 
the query request parameter is used).

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    GET /datasets/548f2f21-a83c-11e4-8baf-3c15c2da029e/value HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Fri, 30 Jan 2015 04:56:20 GMT
    Content-Length: 776
    Etag: "788efb3caaba7fd2ae5d1edb40b474ba94c877a8"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
    
.. 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"}
      ] 
    }
    
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
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response - Selection
---------------------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Tue, 03 Feb 2015 04:01:41 GMT
    Content-Length: 529
    Etag: "b370a3d34bdd7ebf57a496bc7f0da7bc5a1aafb9"
    Content-Type: application/json
    Server: TornadoServer/3.2.2    
    
.. 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"}
      ]
    }
    
    
Sample Request - Query
--------------------------

Get elements from dataset where the 'date' field is equal to 20 and the 'temp' field is greater or equal to 70.

.. 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
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response - Query
-------------------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Thu, 11 Jun 2015 21:05:06 GMT
    Content-Length: 805
    Etag: "927b5ed89616896d3dce7df8bdddac058321076a"
    Content-Type: application/json
    Server: TornadoServer/4.1    
    
.. 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"}
    ]
    
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.  

.. 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
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response - Query Batch
-----------------------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Thu, 11 Jun 2015 21:15:28 GMT
    Content-Length: 610
    Etag: "927b5ed89616896d3dce7df8bdddac058321076a"
    Content-Type: application/json
    Server: TornadoServer/4.1    
    
.. 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"}
    ]
        
Related Resources
=================

* :doc:`GET_Dataset`
* :doc:`POST_Value`
* :doc:`PUT_Value`
 

 

================================================
FILE: docs/DatasetOps/POST_Dataset.rst
================================================
**********************************************
POST Dataset
**********************************************

Description
===========
Creates a new Dataset.

Requests
========

Syntax
------
.. code-block:: http

    POST /datasets HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :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.

type
^^^^
Either a string that is one of the predefined type values, a uuid of a committed type,
or a JSON object describing the type.  See :doc:`../Types/index` for details of the
type specification.

shape
^^^^^^
Either a string with the value ``H5S_NULL`` or an
integer array describing the initial dimensions of the dataset.  If shape is not
provided, a scalar dataset will be created.
If the shape value of ``H5S_NULL`` is specified a dataset with a null dataspace will be 
created.  A null
dataset has attributes and a type, but will not be able to store any values.

maxdims
^^^^^^^
An integer array describing the maximum extent of each dimension (or 0 for unlimited
dimensions).  If maxdims is not provided that resulting dataset will be non-extensible.
Not valid to include if ``H5S_NULL`` is specified for the shape.

creationProperties
^^^^^^^^^^^^^^^^^^
A JSON object that can specify chunk layout, filters, fill value, and other aspects of the dataset.
See: http://hdf5-json.readthedocs.org/en/latest/bnf/dataset.html#grammar-token-dcpl for a complete 
description of fields that can be used.

If creationProperties is not provided, default values will be used

link["id"]
^^^^^^^^^^
The UUID of the group the new group should be linked to.  If the UUID is not valid,
the request will fail and a new group will not be created.

link["name"]
^^^^^^^^^^^^
The name of the new link.

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

id
^^
The UUID of the newly created dataset.

attributeCount
^^^^^^^^^^^^^^
The number of attributes belonging to the dataset.

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

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

Create a one-dimensional dataset with 10 floating point elements.

.. code-block:: http

    POST /datasets HTTP/1.1
    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"
    }
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Thu, 29 Jan 2015 06:14:02 GMT
    Content-Length: 651
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"}
      ]
    }
    
Sample Request with Link
------------------------

Create a dataset with 10 variable length string elements.  Create link in group: 
"5e441dcf-..." 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
    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"
      }
    
    }
    
Sample Response with Link
-------------------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Thu, 29 Jan 2015 06:45:09 GMT
    Content-Length: 683
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"}
      ]
    }
    
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
    Accept: */*
    Accept-Encoding: gzip, deflate
    
.. code-block:: json

    {
    "type": "H5T_IEEE_F32LE",
    "shape": 10,
    "maxdims": 0
    }
    
Sample Response - Resizable Dataset
-----------------------------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Thu, 29 Jan 2015 08:28:19 GMT
    Content-Length: 675
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"}
      ]
    }
    
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
    Accept: */*
    Accept-Encoding: gzip, deflate
    
.. code-block:: json

    {
    "type": "accd0b1e-a792-11e4-bada-3c15c2da029e",
    "shape": [10, 10]
    }
    
Sample Response - Committed Type
-----------------------------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Thu, 29 Jan 2015 08:41:53 GMT
    Content-Length: 675
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"}
      ]
    }
    
Sample Request - SZIP Compression with chunking
-----------------------------------------------

.. 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: 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
            }
        ],
        "layout": {
            "class": "H5D_CHUNKED",
            "dims": [
                100,
                100
            ]
        }
    },
    "shape": [
        1000,
        1000
    ],
    "type": "H5T_IEEE_F32LE"
   }
   
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
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. 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"
        },
        {
            "href": "http://newdset_szip.datasettest.test.hdfgroup.org/groups/ad2746d4-158c-11e5-a083-3c15c2da029e",
            "rel": "root"
        },
        {
            "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"
        }
    ]
    }


    
Related Resources
=================

* :doc:`GET_Dataset`
* :doc:`GET_Datasets`
* :doc:`GET_Value`
* :doc:`POST_Value`
* :doc:`PUT_Value`
 

 

================================================
FILE: docs/DatasetOps/POST_Value.rst
================================================
**********************************************
POST Value
**********************************************

Description
===========
Gets values of a data for a given point selection (provided in the body of the 
request).

Requests
========

Syntax
------
.. code-block:: http

    POST /datasets/<id>/value HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
*<id>* is the UUID of the requested dataset t
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Request Body
------------

The request body should be a JSON object with the following key:

points
^^^^^^

An array of points defining the selection.  Each point can either be an integer
(if the dataset has just one dimension), or an array where the length of the 
array is equal to the number of dimensions of the dataset.

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

value
^^^^^
An array of values where the length of the array is equal to the number of points 
in the request.  Each value will be a string, integer, or JSON object consist
with the dataset type (e.g. an compound type).

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    POST /datasets/4e83ad1c-ab6e-11e4-babb-3c15c2da029e/value HTTP/1.1
    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]
    }
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Tue, 03 Feb 2015 06:31:38 GMT
    Content-Length: 47
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
 
    {
    "value": [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
    }
    
Related Resources
=================

* :doc:`GET_Dataset`
* :doc:`GET_Value`
* :doc:`PUT_Value`
 

 

================================================
FILE: docs/DatasetOps/PUT_DatasetShape.rst
================================================
**********************************************
PUT Shape
**********************************************

Description
===========
Modifies the dimensions of a dataset.  Dimensions can only be changed if the dataset
was initially created with that dimension as *extensible* - i.e. the maxdims value
for that dimension is larger than the initial dimension size (or maxdims set to 0).

*Note:* Dimensions can only be made larger, they can not be reduced.

Requests
========

Syntax
------
.. code-block:: http

    PUT /datasets/<id>/shape HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
*<id>* is the UUID of the dataset whose shape will be modified.
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Request Elements
----------------
The request body must include a JSON object with a "shape" key as described below:

shape
^^^^^
An integer array giving the new dimensions of the dataset.

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    PUT /datasets/b9b6acc0-a839-11e4-aa86-3c15c2da029e/shape HTTP/1.1
    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]
    }
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Fri, 30 Jan 2015 04:47:47 GMT
    Content-Length: 331
    Content-Type: application/json
    Server: TornadoServer/3.2.2   
    
.. 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"}
      ]
    }
    
Related Resources
=================

* :doc:`GET_Dataset`
* :doc:`GET_DatasetShape`
* :doc:`GET_Value`
* :doc:`POST_Value`
* :doc:`PUT_Value`
 

 

================================================
FILE: docs/DatasetOps/PUT_Value.rst
================================================
**********************************************
PUT Value
**********************************************

Description
===========
Update the values in a dataset.

Requests
========

Syntax
------
.. code-block:: http

    PUT /datasets/<id>/value HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
*<id>* is the UUID of the requested dataset.
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Request Body
------------
The request body should be a JSON object with the following keys:

start:
^^^^^^
An optional key that gives the starting coordinate of the selection to be updated.  The
start value can either be an integer (for 1 dimensional arrays) or an array of integers
where the length of the array is equal to the number of dimensions of the dataset.  Each
value must be greater than equal to zero and less than the extent of the corresponding
dimension.

If start is not provided, the selection starts at 0 for each dimension.

stop:
^^^^^
An optional key that gives the ending coordinate of the selection to be updated.
The stop value can either be an integer (for 1 dimensional arrays) or an array of integers
where the length of the array is equal to the number of dimensions of the dataset.  Each
value must be greater than equal to start (or zero if start is not provided) and less than
the extent of the corresponding dimension.

step:
^^^^^
An optional key that gives the step value (i.e. the increment of the coordinate for
each supplied value). The step value can either be an integer (for 1 dimensional arrays) or
an array of integers where the length of the array is equal to the number of dimensions of
the dataset.  Each value must be greater than equal to start (or zero if start is not 
provided) and less than or equal to the extent of the corresponding dimension.

points:
^^^^^^^

An optional key that contains a list of array elements to be updated.  Each element of the list should be an 
an integer if the dataset is of rank 1 or an n-element list (which n is the dataset rank) is the dataset
rank is greater than 1.  If points is provided (indicating a point selection update), then start, stop, 
and step (used for hyperslab selection) should not be provied.

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
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

No response elements are returned.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========


Sample Request
--------------

This example writes a 10x10 integer datasets 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
    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]
      ]
    }
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Tue, 03 Feb 2015 04:31:22 GMT
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    Server: TornadoServer/3.2.2
    
    
Sample Request - Selection
--------------------------

This example writes a portion of the dataset by using the start and stop keys in the
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
    Accept: */*
    Accept-Encoding: gzip, deflate
    
.. code-block:: json

    {     
    "start": 5, 
    "stop": 10,
    "value": [13, 17, 19, 23, 29]
    }
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Tue, 03 Feb 2015 05:30:01 GMT
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    Server: TornadoServer/3.2.2
    
    
Related Resources
=================

* :doc:`GET_Dataset`
* :doc:`GET_Value`
* :doc:`POST_Value`
 

 

================================================
FILE: docs/DatasetOps/index.rst
================================================
######################
Datasets
######################

Datasets are objects that a composed of a homogenous collection of data elements.   Each
dataset has a *type* that specifies the structure of the individual elements (float, string,
compound, etc.), and a *shape* that specifies the layout of the data elements (scalar, 
one-dimensional, multi-dimensional).  In addition meta-data can be attached to a dataset
in the form of attributes.  See: :doc:`../AttrOps/index`.

Creating Datasets
-----------------

Use the :doc:`POST_Dataset` operation to create new datasets.  As part of the POST
request, JSON descriptions for the type and shape of the dataset are included with the
request.  Optionally, creation properties can be used to specify the chunk layout (how
the data elements are stored in the server) and compression filter (e.g. GZIP, LZF, SZIP).

Getting information about a dataset
-----------------------------------
Use the :doc:`GET_Dataset` operation to retrieve information about a datasets type,
shape, creation properties, and number of attributes.  To list all the datasets within a domain use 
:doc:`GET_Datasets`.  To list the datasets linked to a particular group use 
:doc:`../GroupOps/GET_Links` and look at links with a "collection" key of "datsets".

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 
data elements, a point selection (series of element coordinates) can be passed to the 
:doc:`PUT_Value` operation.
 
Reading data from a dataset
---------------------------
To read either the entire dataset, or a specified selection, use the :doc:`GET_Value`
operation.  Without any request parameters, the GET operation retuns all data values.  
To read a specific hyperslab, use the select parameter to start and end indexes of the hyperslab
(the selection can also include a step value to include a regular subset of the hyperslab).
Finally, for one-dimensional datasets with compound types, a *where* parameter can be used to 
select elements meeting a specified condition. 

To read a specific list of elements (by index values), use the :doc:`POST_Value` operation  (POST is 
used in this case rather than GET since the point selection values may be to 
large to include in the URI.) 

Resizable datasets
------------------
If one or more of the dimensions of a dataset may need to be extended after creation,
provide a *maxdims* key to the shape during creation (see :doc:`POST_dataset`).  If the value of the maxdims
dimension is 0, that dimension is *unlimited* and may be extended as much as desired.
If an upper limit is known, use that value in maxdims which will allow that dimension
to be extended up to the given value.
To resize the dataset, use :doc:`PUT_DataShape.rst` operation with the desired shape value(s) for
the new dimensions.

Note: dimensions can only be increased, not decreased.

Deleting datasets
-----------------
The :doc:`DELETE_Dataset` operation will remove the dataset, its attributes, and any
links to the object.

List of Operations
-------------------

.. toctree::
   :maxdepth: 1

   DELETE_Dataset
   GET_Dataset
   GET_Datasets
   GET_DatasetShape
   GET_DatasetType
   GET_Value
   POST_Dataset
   POST_Value
   PUT_DatasetShape
   PUT_Value
    
    


================================================
FILE: docs/DatatypeOps/DELETE_Datatype.rst
================================================
**********************************************
DELETE Datatype
**********************************************

Description
===========
The implementation of the DELETE operation deletes the committed datatype
 named in the URI.  All attributes the datatype will also be deleted.

Requests
========

Syntax
------
.. code-block:: http

    DELETE /datatypes/<id> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
*<id>* is the UUID of the datatype to be deleted.
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    DELETE /datatypes/93b6a335-ac44-11e4-8d71-3c15c2da029e HTTP/1.1
    Content-Length: 0
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: namedtype_deleted.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Wed, 04 Feb 2015 08:05:26 GMT
    Content-Length: 363
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
  
    {
    "hrefs": [
        {"href": "http://namedtype_deleted.test.hdfgroup.org/datatypes", "rel": "self"}, 
        {"href": "http://namedtype_deleted.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://namedtype_deleted.test.hdfgroup.org/groups/93b51245-ac44-11e4-8a21-3c15c2da029e", "rel": "root"}
      ]
    }
    
Related Resources
=================

* :doc:`../AttrOps/GET_Attributes`
* :doc:`GET_Datatype`
* :doc:`GET_Datatypes`
* :doc:`POST_Datatype`
* :doc:`../DatasetOps/POST_Dataset`
* :doc:`../AttrOps/PUT_Attribute`
 

 

================================================
FILE: docs/DatatypeOps/GET_Datatype.rst
================================================
**********************************************
GET Datatype
**********************************************

Description
===========
Returns information about the committed datatype with the UUID given in the URI.

Requests
========

Syntax
------
.. code-block:: http

    GET /datatypes/<id> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
*<id>* is the UUID of the requested datatype.
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

id
^^

The UUID of the datatype object.

type
^^^^
A JSON object representing the type of the datatype object.

attributeCount
^^^^^^^^^^^^^^
The number of attributes belonging to the datatype.

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

lastModified
^^^^^^^^^^^^
A timestamp giving the most recent time the dataset has been modified (i.e. attributes updated) in UTC (ISO-8601 format).

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Get the committed datatype with UUID: "f545543d-...".

Sample Request
--------------

.. code-block:: http

    GET /datatypes/f545543d-a1b4-11e4-8fa4-3c15c2da029e HTTP/1.1
    host: namedtype.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Wed, 21 Jan 2015 21:36:49 GMT
    Content-Length: 619
    Etag: "c53bc5b2d3c3b5059b71ef92ca7d144a2df54456"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    {
    "id": "f545543d-a1b4-11e4-8fa4-3c15c2da029e",
    "type": {
        "base": "H5T_IEEE_F32LE", 
        "class": "H5T_FLOAT"
      }, 
    "created": "2015-01-21T21:32:01Z", 
    "lastModified": "2015-01-21T21:32:01Z", 
    "attributeCount": 1, 
    "hrefs": [
        {"href": "http://namedtype.test.hdfgroup.org/datatypes/f545543d-a1b4-11e4-8fa4-3c15c2da029e", "rel": "self"}, 
        {"href": "http://namedtype.test.hdfgroup.org/groups/f545103d-a1b4-11e4-b4a1-3c15c2da029e", "rel": "root"}, 
        {"href": "http://namedtype.test.hdfgroup.org/datatypes/f545543d-a1b4-11e4-8fa4-3c15c2da029e/attributes", "rel": "attributes"}, 
        {"href": "http://namedtype.test.hdfgroup.org/", "rel": "home"}
      ]     
    }
    
Related Resources
=================

* :doc:`DELETE_Datatype`
* :doc:`GET_Datatypes`
* :doc:`POST_Datatype`
* :doc:`../DatasetOps/POST_Dataset`
* :doc:`../AttrOps/PUT_Attribute`
 

 

================================================
FILE: docs/DatatypeOps/GET_Datatypes.rst
================================================
**********************************************
GET Datatypes
**********************************************

Description
===========
Gets all the committed datatypes in a domain.

Requests
========

Syntax
------
.. code-block:: http

    GET /datatypes HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
Request Parameters
------------------
This implementation of the operation uses the following request parameters (both 
optional):

Limit
^^^^^
If provided, a positive integer value specifying the maximum number of UUID's to return.

Marker
^^^^^^
If provided, a string value indicating that only UUID's that occur after the
marker value will be returned.


Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    GET /datatypes HTTP/1.1
    host: namedtype.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Wed, 21 Jan 2015 22:42:30 GMT
    Content-Length: 350
    Etag: "e01f56869a9a919b1496c463f3569a2a7c319f11"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    {
    "datatypes": [
        "f54542e6-a1b4-11e4-90bf-3c15c2da029e", 
        "f545543d-a1b4-11e4-8fa4-3c15c2da029e"
    ], 
    "hrefs": [
        {"href": "http://namedtype.test.hdfgroup.org/datatypes", "rel": "self"}, 
        {"href": "http://namedtype.test.hdfgroup.org/groups/f545103d-a1b4-11e4-b4a1-3c15c2da029e", "rel": "root"}, 
        {"href": "http://namedtype.test.hdfgroup.org/", "rel": "home"}
      ]
    }
    
Sample Request with Marker and Limit
------------------------------------

This example uses the "Marker" request parameter to return only UUIDs after the given
Marker value.
Also the "Limit" request parameter is used to limit the number of UUIDs in the response to 5.

.. code-block:: http

    GET /datatypes?Marker=d779cd5e-a1e6-11e4-8fc5-3c15c2da029e&Limit=5 HTTP/1.1
    host: type1k.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
 
Sample Response with Marker and Limit
-------------------------------------

 .. code-block:: http
 
    HTTP/1.1 200 OK
    Date: Thu, 22 Jan 2015 03:32:13 GMT
    Content-Length: 461
    Etag: "a2e2d5a3ae63cd504d02b51d99f27b30d17b75b5"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
   
 .. code-block:: json
      
    {
    "datatypes": [
        "d779ddd9-a1e6-11e4-89e5-3c15c2da029e", 
        "d779ef11-a1e6-11e4-8837-3c15c2da029e", 
        "d77a008a-a1e6-11e4-8840-3c15c2da029e", 
        "d77a121e-a1e6-11e4-b2b0-3c15c2da029e", 
        "d77a2523-a1e6-11e4-aa6d-3c15c2da029e"
      ], 
    "hrefs": [
        {"href": "http://type1k.test.hdfgroup.org/datatypes", "rel": "self"}, 
        {"href": "http://type1k.test.hdfgroup.org/groups/d7742c14-a1e6-11e4-b2a8-3c15c2da029e", "rel": "root"}, 
        {"href": "http://type1k.test.hdfgroup.org/", "rel": "home"}
      ]
    }
        
    
Related Resources
=================

* :doc:`DELETE_Datatype`
* :doc:`GET_Datatype`
* :doc:`POST_Datatype`
* :doc:`../DatasetOps/POST_Dataset`
* :doc:`../AttrOps/PUT_Attribute`
 

 

================================================
FILE: docs/DatatypeOps/POST_Datatype.rst
================================================
**********************************************
POST Datatype
**********************************************

Description
===========
Creates a new committed datatype.

Requests
========

Syntax
------
.. code-block:: http

    POST /datatypes  HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

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

type
^^^^
The value of the type key can either be one of the predefined type strings 
(see predefined types), or a JSON representation of a type. (see :doc:`../Types/index`).

link
^^^^
If present, the link value must include the following subkeys:

link['id']
^^^^^^^^^^
The UUID of the group the new datatype should be linked from.  If the UUID is not valid,
the request will fail and a new datatype will not be created.

link['name']
^^^^^^^^^^^^
The name of the new link.

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

id
^^

The UUID of the newly created datatype object.

attributeCount
^^^^^^^^^^^^^^
The number of attributes belonging to the datatype.

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

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

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

.. code-block:: http

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

    {
    "type": "H5T_IEEE_F32LE"
    }
    
Sample Response
---------------

.. code-block:: http

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

Create a new committed datatype and link to root as "linked_dtype".

.. code-block:: http

    POST /datatypes HTTP/1.1
    Content-Length: 106
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: newlinkedtype.datatypetest.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
.. code-block:: json

    {
    "type": "H5T_IEEE_F64LE",
    "link": {
        "id": "76b0bbf8-a26c-11e4-8d4c-3c15c2da029e", 
        "name": "linked_dtype"
      }
    }
    
Sample Response with Link
-------------------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Thu, 22 Jan 2015 19:25:46 GMT
    Content-Length: 548
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    {
    "id": "76c3c33a-a26c-11e4-998c-3c15c2da029e", 
    "attributeCount": 0, 
    "created": "2015-01-22T19:25:46Z",
    "lastModified": "2015-01-22T19:25:46Z", 
    "hrefs": [
        {"href": "http://newlinkedtype.datatypetest.test.hdfgroup.org/datatypes/76c3c33a-a26c-11e4-998c-3c15c2da029e", "rel": "self"}, 
        {"href": "http://newlinkedtype.datatypetest.test.hdfgroup.org/groups/76b0bbf8-a26c-11e4-8d4c-3c15c2da029e", "rel": "root"}, 
        {"href": "http://newlinkedtype.datatypetest.test.hdfgroup.org/datatypes/76c3c33a-a26c-11e4-998c-3c15c2da029e/attributes", "rel": "attributes"}
      ]
    }
    
Related Resources
=================

* :doc:`DELETE_Datatype`
* :doc:`GET_Datatype`
* :doc:`GET_Datatypes`
* :doc:`../DatasetOps/POST_Dataset`
* :doc:`../AttrOps/PUT_Attribute`
 

 

================================================
FILE: docs/DatatypeOps/index.rst
================================================
#######################
Committed Datatypes
#######################

Committed datatypes (also know as "named types"), are object that describe types.  These
types can be used in the creation of datasets and attributes.

Committed datatypes can be linked to from a Group and can contain attributes, just like
a dataset or group object.

Creating committed datatypes
----------------------------

Use :doc:`POST_Datatype` to create a new datatype.  A complete description of the 
type must be sent with the POST request.

Getting information about a committed datatype
-----------------------------------------------

Use the :doc:`GET_Datatype` operation to retrieve information about a committed datatype.
To list all the committed datatypes within a domain use 
:doc:`GET_Datatypes`.  To list the committed types linked to a particular group use 
:doc:`../GroupOps/GET_Links` and examine link object with a "collection" key of 
"datatypes".

Deleting committed datatypes
----------------------------

Use :doc:`DELETE_Datatype` to delete a datatype.  Links from any group to the datatype
will be deleted.  

List of Operations
------------------

.. toctree::
   :maxdepth: 1

   DELETE_Datatype
   GET_Datatype
   GET_Datatypes
   POST_Datatype
    
    


================================================
FILE: docs/Diagram.rst
================================================
***************************
Diagram of REST operations
***************************

 
.. image:: RESTful_HDF5.png
   :width: 100 %
   :alt: alternate text
   :align: right

================================================
FILE: docs/DomainOps/DELETE_Domain.rst
================================================
**********************************************
DELETE Domain
**********************************************

Description
===========
The DELETE operation deletes the given domain and
all its resources (groups, datasets, attributes, etc.).

Requests
========

Syntax
------
.. code-block:: http

    DELETE /  HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

This implementation of the operation does not return any response elements.


Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

   DELETE / HTTP/1.1
   Content-Length: 0
   User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
   host: deleteme.test.hdfgroup.org
   Accept: */*
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Fri, 16 Jan 2015 03:47:33 GMT
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    Server: TornadoServer/3.2.2
    
 
    
Related Resources
=================

* :doc:`GET_Domain`
* :doc:`PUT_Domain`
 

 

================================================
FILE: docs/DomainOps/GET_Domain.rst
================================================
**********************************************
GET Domain
**********************************************

Description
===========
This operation retrieves information about the requested domain.

*Note:* If the HDF Dynamic DNS Server (see https://github.com/HDFGroup/dynamic-dns) is running, 
the operations can specify the domain as part of the URI.  Example:  
http://tall.data.hdfgroup.org:7253/ 
returns data about the domain "tall" hosted on data.hdfgroup.org.  
The DNS server will determine the proper IP that maps to this domain.

If the DNS Server is not setup, specify the desired domain in the Host line of the http
header.

Alternatively, the domain can be specified as a 'Host' query parameter.  Example:
http://127.0.0.1:7253?host=tall.data.hdfgroup.org.

If no Host value is supplied, the default Table of Contents (TOC) domain is returned.

Requests
========

Syntax
------
.. code-block:: http

    GET / HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

root
^^^^
The UUID of the root group of this domain.

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

lastModified
^^^^^^^^^^^^
A timestamp giving the most recent time that any content in the domain has been
modified in UTC (ISO-8601 format).

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return any special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    GET / HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Fri, 16 Jan 2015 03:51:58 GMT
    Content-Length: 508
    Etag: "e45bef255ffc0530c33857b88b15f551f371de38"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
    
    {
    "root": "052dcbbd-9d33-11e4-86ce-3c15c2da029e", 
    "created": "2015-01-16T03:51:58Z",
    "lastModified": "2015-01-16T03:51:58Z", 
    "hrefs": [
        {"href": "http://tall.test.hdfgroup.org/", "rel": "self"},
        {"href": "http://tall.test.hdfgroup.org/datasets", "rel": "database"}, 
        {"href": "http://tall.test.hdfgroup.org/groups", "rel": "groupbase"}, 
        {"href": "http://tall.test.hdfgroup.org/datatypes", "rel": "typebase"},
        {"href": "http://tall.test.hdfgroup.org/groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e", "rel": "root"}
    ]      
    }
    
Related Resources
=================

* :doc:`DELETE_Domain`
* :doc:`../GroupOps/GET_Group`
* :doc:`PUT_Domain`
 

 

================================================
FILE: docs/DomainOps/PUT_Domain.rst
================================================
**********************************************
PUT Domain
**********************************************

Description
===========
This operation creates a new domain.

*Note*: Initially the only object contained in the domain is the root group.  Use other
PUT and POST operations to create new objects in the domain.

*Note*: The operation will fail if the domain already exists (a 409 code will be returned).

Requests
========

Syntax
------
.. code-block:: http

    PUT / HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

root
^^^^
The UUID of the root group of this domain.

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

lastModified
^^^^^^^^^^^^
A timestamp giving the most recent time that any content in the domain has been
modified in UTC (ISO-8601 format).

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return any special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

An http status code of 409 (Conflict) will be returned if the domain already exists.

Examples
========

Sample Request
--------------

.. code-block:: http

    PUT / HTTP/1.1
    Content-Length: 0
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: newfile.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Fri, 16 Jan 2015 04:11:52 GMT
    Content-Length: 523
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    
  {
    "root": "cd31cfdc-9d35-11e4-aa58-3c15c2da029e",
    "created": "2015-01-16T04:11:52Z",
    "lastModified": "2015-01-16T04:11:52Z", 
    "hrefs": [
       {"href": "http://newfile.test.hdfgroup.org/", "rel": "self"}, 
       {"href": "http://newfile.test.hdfgroup.org/datasets", "rel": "database"}, 
       {"href": "http://newfile.test.hdfgroup.org/groups", "rel": "groupbase"}, 
       {"href": "http://newfile.test.hdfgroup.org/datatypes", "rel": "typebase"}, 
       {"href": "http://newfile.test.hdfgroup.org/groups/cd31cfdc-9d35-11e4-aa58-3c15c2da029e", "rel": "root"}
       ]    
  }
    
Related Resources
=================

* :doc:`DELETE_Domain`
* :doc:`../GroupOps/GET_Group`
* :doc:`GET_Domain`
 

 

================================================
FILE: docs/DomainOps/index.rst
================================================
#######################
Domains
#######################

In h5serv, domains are containers for related collection of resources, similar to a
file in the traditional HDF5 library.  In the h5serv implementation of the HDF5 REST API,
domains *are* files, but in general the HDF REST API supports alternative implementations 
(e.g. data that is stored in a database).
Most operations of the service act on a domain resource that is provided in 
the *Host* http header or (alternatively) the Host query parameter.

Mapping of file paths to domain names
-------------------------------------

To convert a file path to a domain name:

#. Remove the extension
#. Determine the path relative to the data directory
#. Replace '/' with '.'
#. Reverse the path
#. Add the domain suffix (using the domain config value)

As an example consider a server installation where that data directory is '/data'
and an HDF5 is located at ``/data/myfolder/an_hdf_file.h5`` and ``hdfgroup.org``
is the base domain.  The above sequence of steps would look like the following:

#. /data/myfolder/an_hdf_file
#. myfolder/an_hdf_file
#. myfolder.an_hdf_file
#. an_hdf_file.myfolder
#. an_hdf_file.myfolder.hdfgroup.org

The final expression is what should be used in the Host field for any request that access
that file.  

For path names that include non-alphanumeric charters, replace any such characters with 
the string '%XX' where XX is the hexidecimal value of the character.  For example:

``this.file.has.dots.h5``

becomes:

``this%2Efile%2Ehase%2Edots``


Creating Domains
----------------
Use :doc:`PUT_Domain` to create a domain.  The domain name must follow DNS conventions
(e.g. two consecutive "dots" are not allowed).  After creation, the domain will contain
just one resource, the root group.  

Use :doc:`GET_Domain` to get information about a domain, including the UUID of the 
domain's root group.

Getting Information about Domains
---------------------------------

Use :doc:`GET_Domain` to retreive information about a specific domain (specified in the Host
header).  If the Host value is not supplied, the service returns information on the 
auto-generated Table of Contents (TOC) that provides information on domains that are available.

Deleting Domains
----------------
Use :doc:`DELETE_Domain` to delete a domain.  All resources within the domain will be
deleted!

The TOC domain cannot be deleted.

List of Operations
------------------

.. toctree::
   :maxdepth: 1

   DELETE_Domain
   GET_Domain
   PUT_Domain
    
    


================================================
FILE: docs/FAQ/index.rst
================================================
###################
FAQ
###################


What datatypes are supported?
-----------------------------

=========================           ============================================    
Type                                Precisions                                       
=========================           ============================================    
Integer                             1, 2, 4 or 8 byte, BE/LE, signed/unsigned
Float                               4, 8  byte, BE/LE
Compound                            Arbitrary names and offsets
Strings (fixed-length)              Any length
Strings (variable-length)           Any length, ASCII 
Opaque                              Any length
Array                               Any supported type
Enumeration                         Any integer type                           
References                          Region and object
=========================           ============================================     

Unsupported types:

=========================           ============================================
Type                                Status                                 
=========================           ============================================
HDF5 VLEN (non-string)              Coming soon!
HDF5 "time" type
Opaque                              
Bitfields                            
=========================           ============================================


Why does h5serv use those long ids?
------------------------------------

h5serv uses the UUID standard (http://en.wikipedia.org/wiki/Universally_unique_identifier)
to identify objects (datasets, groups, and committed datatypes) uniquely.  The benefit of
using UUIDs is that objects can be uniquely identified without requiring any central 
coordination.

How can I get a dataset (or group) via a pathname?
--------------------------------------------------

You will need to iterate through the path to get the UUID of each subgroup.
E.g. suppose the path of interest is "/g1/g1.1" in the domain: "tall.data.hdfgroup.org".
Perform these actions to get the UUID of the group at /g1/g1.1.

#. ``GET /``  // returns the UUID of the root group
#. ``GET /groups/<root_uuid>/links/g1``  // returns the UUID of the group at "/g1"
#. ``GET /groups/<g1_uuid>/links/g1.1``  // returns the UUID of the group at "/g1/g1.1'

How do I guard against an attribute (dataset/group/file) from being deleted by a request?
-----------------------------------------------------------------------------------------
Future releases of h5serv will support authorization and permissions to protect content
that shouldn't be altered.

For now the choices are:

#. Don't expose the h5serv endpoint on a non-trusted network
#. Make the files readonly
#. Make periodic backups of all data files
#. Don't share the domain name with non-trusted sources.  Since h5serv doesn't provide an operation to list all domains on the server, creating a non-trivial domain name (e.g. "mydata_18494") will be relatively secure.

How can I display my data in a nice Web UI?
-------------------------------------------
There are many Javascript libraries (e.g. http://d3js.org) that can take the data 
returned by h5serv to create compelling graphics.  

I have a C or Fortran application that uses HDF5, how can I take advantage of h5serv?
-------------------------------------------------------------------------------------
We are planning on creating a hdf5 library plugin that will transparently invoke the 
REST api.  For now, you can use C-libraries such as libcurl to invoke h5serv requests.

Is there documentation on the JSON format generated by h5tojson.py:
-------------------------------------------------------------------
Yes.  There is a grammer published here: http://hdf5-json.readthedocs.org/en/latest/index.html. 

How do I submit a bug report?
------------------------------
If you have a Github account, create an issue here: 
https://github.com/HDFGroup/h5serv/issues.

Alternatively, you send a email to the HDF Group help desk: help@hdfgroup.org.


================================================
FILE: docs/GroupOps/DELETE_Group.rst
================================================
**********************************************
DELETE Group
**********************************************

Description
===========
The implementation of the DELETE operation deletes the group with the UUID given in the
URI.  All attributes and links of the group will also be deleted.  In addition any 
links from other groups **TO** the deleted group will be removed.

*Note:* Groups, datatypes, and datasets that are referenced by the group's links will 
**not** be deleted.  Use the DELETE operation for those objects to remove.

Requests
========

Syntax
------
.. code-block:: http

    DELETE /groups/<id> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
 
*<id>* is the UUID of the group to be deleted.
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    DELETE /groups/45a882e1-9d01-11e4-8acf-3c15c2da029e HTTP/1.1
    Host: testGroupDelete.test.hdfgroup.org
    Authorization: authorization_string
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Thu, 15 Jan 2015 21:55:51 GMT
    Content-Length: 270
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    
    {
    "hrefs": [
        {"href": "http://testGroupDelete.test.hdfgroup.org/groups", "rel": "self"}, 
        {"href": "http://testGroupDelete.test.hdfgroup.org/groups/45a06719-9d01-11e4-9b1c-3c15c2da029e", "rel": "root"}, 
        {"href": "http://testGroupDelete.test.hdfgroup.org/", "rel": "home"}
    ]
    }
    
Related Resources
=================

* :doc:`POST_Group`
* :doc:`GET_Group`
 

 

================================================
FILE: docs/GroupOps/DELETE_Link.rst
================================================
**********************************************
DELETE Link
**********************************************

Description
===========
The implementation of the DELETE operation deletes the link named in the URI.   

Groups, datatypes, and datasets that are referenced by the link will **not** be
deleted.   To delete groups, datatypes or datasets, use the appropriate DELETE operation
for those objects.

Requests
========

Syntax
------
.. code-block:: http

    DELETE /groups/<id>/links/<name> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
* *<id>* is the UUID of the group the link is a member of.
* *<name>* is the URL-encoded name of the link.
    
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

An attempt to delete the root group will return 403 - Forbidden.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    DELETE /groups/25dd052b-a06d-11e4-a29e-3c15c2da029e/links/deleteme HTTP/1.1
    Content-Length: 0
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: tall_updated.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Tue, 20 Jan 2015 06:25:37 GMT
    Content-Length: 299
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
  
    {
    "hrefs": [
        {"href": "http://tall_updated.test.hdfgroup.org/groups/25dd052b-a06d-11e4-a29e-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/25dd052b-a06d-11e4-a29e-3c15c2da029e", "rel": "owner"}
        ]
    }
    
Related Resources
=================

* :doc:`../DatasetOps/DELETE_Dataset`
* :doc:`../DatatypeOps/DELETE_Datatype`
* :doc:`DELETE_Group`
* :doc:`GET_Link`
* :doc:`GET_Groups`
* :doc:`POST_Group`
 

 

================================================
FILE: docs/GroupOps/GET_Group.rst
================================================
**********************************************
GET Group
**********************************************

Description
===========
Returns information about the group with the UUID given in the URI.

Requests
========

Syntax
------
.. code-block:: http

    GET /groups/<id> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
*<id>* 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.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

id
^^
The UUID of the requested group

attributeCount
^^^^^^^^^^^^^^
The number of attributes belonging to the group.

linkCount
^^^^^^^^^
The number of links belonging to the group.

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

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

hrefs
^^^^^
An array of hypertext links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    GET /groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Fri, 16 Jan 2015 20:06:08 GMT
    Content-Length: 660
    Etag: "2c410d1c469786f25ed0075571a8e7a3f313cec1"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    {
    "id": "052dcbbd-9d33-11e4-86ce-3c15c2da029e",
    "attributeCount": 2,
    "linkCount": 2,
    "created": "2015-01-16T03:47:22Z", 
    "lastModified": "2015-01-16T03:47:22Z",    
    "hrefs": [
        {"href": "http://tall.test.hdfgroup.org/groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e", "rel": "self"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e/links", "rel": "links"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e/attributes", "rel": "attributes"}
        ]
     }
    
Related Resources
=================

* :doc:`DELETE_Group`
* :doc:`GET_Links`
* :doc:`GET_Groups`
* :doc:`POST_Group`
* :doc:`../AttrOps/GET_Attribute`
 

 

================================================
FILE: docs/GroupOps/GET_Groups.rst
================================================
**********************************************
GET Groups
**********************************************

Description
===========
Returns UUIDs for all the groups in a domain (other than the root group).

Requests
========

Syntax
------
.. code-block:: http

    GET /groups HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
Request Parameters
------------------
This implementation of the operation uses the following request parameters (both 
optional):

Limit
^^^^^
If provided, a positive integer value specifying the maximum number of UUID's to return.

Marker
^^^^^^
If provided, a string value indicating that only UUID's that occur after the
marker value will be returned.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

groups
^^^^^^
An array of UUIDs - one for each group (including the root group) in the domain.
If the "Marker" and/or "Limit" request parameters are used, a subset of the UUIDs
may be returned.

hrefs
^^^^^
An array of hypertext links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    GET /groups HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Fri, 16 Jan 2015 21:53:48 GMT
    Content-Length: 449
    Etag: "83575a7865761b6d4eaf5d285ab1de062c49250b"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
    
    {
    "groups": [
        "052e001e-9d33-11e4-9a3d-3c15c2da029e", 
        "052e13bd-9d33-11e4-91a6-3c15c2da029e", 
        "052e5ae8-9d33-11e4-888d-3c15c2da029e", 
        "052e700a-9d33-11e4-9fe4-3c15c2da029e", 
        "052e89c7-9d33-11e4-b9bc-3c15c2da029e"
        ],
    "hrefs": [
        {"href": "http://tall.test.hdfgroup.org/groups", "rel": "self"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall.test.hdfgroup.org/", "rel": "home"}
        ] 
    }
    
Sample Request with Marker and Limit
------------------------------------

This example uses the "Marker" request parameter to return only UUIDs after the given
Marker value.
The "Limit" request parameter is used to limit the number of UUIDs in the response to 5.

.. code-block:: http

    GET /groups?Marker=cba6e3fd-9dbd-11e4-bf4a-3c15c2da029e&Limit=5 HTTP/1.1
    host: group1k.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
 
Sample Response with Marker and Limit
-------------------------------------

 .. code-block:: http
 
    HTTP/1.1 200 OK
    Date: Fri, 16 Jan 2015 22:02:46 GMT
    Content-Length: 458
    Etag: "49221af3436fdaca7e26c74b491ccf8698555f08"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
   
 .. code-block:: json
    
    {
    "groups": [
        "cba6fc19-9dbd-11e4-846e-3c15c2da029e", 
        "cba71842-9dbd-11e4-abd0-3c15c2da029e", 
        "cba73442-9dbd-11e4-a6e9-3c15c2da029e", 
        "cba74fc5-9dbd-11e4-bc15-3c15c2da029e", 
        "cba77c2e-9dbd-11e4-9c71-3c15c2da029e"
        ],  
    "hrefs": [
        {"href": "http://group1k.test.hdfgroup.org/groups", "rel": "self"}, 
        {"href": "http://group1k.test.hdfgroup.org/groups/cb9ebf11-9dbd-11e4-9e83-3c15c2da029e", "rel": "root"}, 
        {"href": "http://group1k.test.hdfgroup.org/", "rel": "home"}
        ]
    } 
        
Related Resources
=================

* :doc:`DELETE_Group`
* :doc:`GET_Links`
* :doc:`GET_Group`
* :doc:`POST_Group`
 

 

================================================
FILE: docs/GroupOps/GET_Link.rst
================================================
**********************************************
GET Link
**********************************************

Description
===========
Returns information about a Link.

Requests
========

Syntax
------
.. code-block:: http

    GET /groups/<id>/links/<name> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
* *<id>* is the UUID of the group the link is a member of.
* *<name>* is the URL-encoded name of the link.
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

link["title"]
^^^^^^^^^^^^^
The name of the link.

link["collection"]
^^^^^^^^^^^^^^^^^^
For hard links, the domain collection for which the object the link points to is a 
member of.  The value will be one of: "groups", "datasets", "datatypes".
For symbol links, this element is not present.

link["class"]
^^^^^^^^^^^^^
Indicates the type of link.  One of the following values will be returned:

* H5L_TYPE_HARD: A direct link to a group, dataset, or committed datatype object in the domain
* H5L_TYPE_SOFT: A symbolic link that gives a path to an object within the domain (object may or may not be present).
* H5L_TYPE_EXTERNAL: A symbolic link to an object that is external to the domain
* H5L_TYPE_UDLINK: A user-defined link (this implementation only provides title and class for user-defined links)

link["h5path"]
^^^^^^^^^^^^^^
For symbolic links ("H5L_TYPE_SOFT" or "H5L_TYPE_EXTERNAL"), the path to the resource the
link references.  

link["h5domain"]
^^^^^^^^^^^^^^^^
For external links, the path of the external domain containing the object that is linked.
*Note:* The domain may or may not exist.  Use GET / with the domain to verify.

link["id"]
^^^^^^^^^^^^
For hard links, the uuid of the object the link points to.  For symbolic links this
element is not present

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

lastModified
^^^^^^^^^^^^
A timestamp giving the most recent time the group has been
modified in UTC (ISO-8601 format).

hrefs
^^^^^
An array of hypertext links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request - Hard Link
--------------------------

.. code-block:: http

    GET /groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e/links/g1 HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response - Hard Link
---------------------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Fri, 16 Jan 2015 22:42:05 GMT
    Content-Length: 688
    Etag: "70c5c4f2f7cac9f7f155fe026f4c492f65e3fb8e"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
        
    {
    "link": {
        "title": "g1", 
        "collection": "groups", 
        "class": "H5L_TYPE_HARD", 
        "id": "052e001e-9d33-11e4-9a3d-3c15c2da029e"
    }, 
    "created": "2015-01-16T03:47:22Z",
    "lastModified": "2015-01-16T03:47:22Z", 
    "hrefs": [
        {"href": "http://tall.test.hdfgroup.org/groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e/links/g1", "rel": "self"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e", "rel": "owner"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/052e001e-9d33-11e4-9a3d-3c15c2da029e", "rel": "target"}
     ]
    } 
       
Sample Request - Soft Link
--------------------------

.. code-block:: http

    GET /groups/052e700a-9d33-11e4-9fe4-3c15c2da029e/links/slink HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0    
    Related Resources
    
Sample Response - Soft Link
---------------------------

.. code-block:: http
    
    HTTP/1.1 200 OK
    Date: Fri, 16 Jan 2015 23:29:27 GMT
    Content-Length: 620
    Etag: "7bd777729ac5af261c85c7e3b87ef0045739bf77"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    {
    "link": {
            "title": "slink",
            "class": "H5L_TYPE_SOFT",
            "h5path": "somevalue"
             }, 
    "created": "2015-01-16T03:47:22Z",
    "lastModified": "2015-01-16T03:47:22Z", 
    "hrefs": [
        {"href": "http://tall.test.hdfgroup.org/groups/052e700a-9d33-11e4-9fe4-3c15c2da029e/links/slink", "rel": "self"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e", "rel": "root"},
        {"href": "http://tall.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/052e700a-9d33-11e4-9fe4-3c15c2da029e", "rel": "owner"}, 
        {"href": "http://tall.test.hdfgroup.org/#h5path(somevalue)", "rel": "target"}
      ] 
    }
         
        
Sample Request - External Link
------------------------------

.. code-block:: http

    GET /groups/052e5ae8-9d33-11e4-888d-3c15c2da029e/links/extlink HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    
Sample Response - External Link
-------------------------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Tue, 20 Jan 2015 05:47:55 GMT
    Content-Length: 644
    Etag: "1b7a228acdb19f7259ed8a1b3ba4bc442b405ef9"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    {
    "link": {
        "title": "extlink", 
        "class": "H5L_TYPE_EXTERNAL",
        "h5path": "somepath",
        "h5domain": "somefile"
    }, 
    "created": "2015-01-16T03:47:22Z",
    "lastModified": "2015-01-16T03:47:22Z", 
    "hrefs": [
        {"href": "http://tall.test.hdfgroup.org/groups/052e5ae8-9d33-11e4-888d-3c15c2da029e/links/extlink", "rel": "self"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/052dcbbd-9d33-11e4-86ce-3c15c2da029e", "rel": "root"},
        {"href": "http://tall.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/052e5ae8-9d33-11e4-888d-3c15c2da029e", "rel": "owner"}, 
        {"href": "http://somefile.hdfgroup.org#h5path(somepath)", "rel": "target"}
      ] 
    }
    
    
        
Sample Request - User Defined Link
----------------------------------

.. code-block:: http

    GET /groups/0262c3a6-a069-11e4-8905-3c15c2da029e/links/udlink HTTP/1.1
    host: tall_with_udlink.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0


Sample Response - User Defined Link
-----------------------------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Tue, 20 Jan 2015 05:56:00 GMT
    Content-Length: 576
    Etag: "2ab310eba3bb4282f84d643fcc30e591da485576"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json

    {
    "link": {
        "class": "H5L_TYPE_USER_DEFINED", 
        "title": "udlink"
        }, 
    "created": "2015-01-16T03:47:22Z",
    "lastModified": "2015-01-16T03:47:22Z", 
    "hrefs": [
        {"href": "http://tall_with_udlink.test.hdfgroup.org/groups/0262c3a6-a069-11e4-8905-3c15c2da029e/links/udlink", "rel": "self"}, 
        {"href": "http://tall_with_udlink.test.hdfgroup.org/groups/0260b214-a069-11e4-a840-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall_with_udlink.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://tall_with_udlink.test.hdfgroup.org/groups/0262c3a6-a069-11e4-8905-3c15c2da029e", "rel": "owner"}
    ]       
    }
    
=================

* :doc:`DELETE_Link`
* :doc:`GET_Links`
* :doc:`PUT_Link`
 

 

================================================
FILE: docs/GroupOps/GET_Links.rst
================================================
**********************************************
GET Links
**********************************************

Description
===========
Returns all the links for a given group.

Requests
========

Syntax
------
.. code-block:: http

    GET /groups/<id>/links HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
* *<id>* is the UUID of the group the links to be returned are a member of.
    
Request Parameters
------------------
This implementation of the operation uses the following request parameters (both 
optional):

Limit
^^^^^
If provided, a positive integer value specifying the maximum number of links to return.

Marker
^^^^^^
If provided, a string value indicating that only links that occur after the
marker value will be returned.


Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

links
^^^^^
An array of JSON objects giving information about each link returned.
See :doc:`GET_Link` for a description of the link response elements.

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

.. code-block:: http

    GET /groups/0ad37be1-a06f-11e4-8651-3c15c2da029e/links HTTP/1.1
    host: tall.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0  
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Tue, 20 Jan 2015 06:55:19 GMT
    Content-Length: 607
    Etag: "49edcce6a8f724108d41d52c98002d6255286ff8"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
   
    {
    "links": [
        {
            "title": "g1.2.1",
            "class": "H5L_TYPE_HARD",
            "collection": "groups",
            "id": "0ad38d45-a06f-11e4-a909-3c15c2da029e"
        }, 
        {
            "title": "extlink",
            "class": "H5L_TYPE_EXTERNAL",
            "h5path": "somepath",
            "file": "somefile"  
        }
    ],
    "hrefs": [
        {"href": "http://tall.test.hdfgroup.org/groups/0ad37be1-a06f-11e4-8651-3c15c2da029e/links", "rel": "self"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/0ad2e151-a06f-11e4-bc68-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/0ad37be1-a06f-11e4-8651-3c15c2da029e", "rel": "owner"}
        ]
    } 
    
Sample Request Batch
--------------------

.. code-block:: http

    GET /groups/76bddb1e-a06e-11e4-86d6-3c15c2da029e/links?Marker=g0089&Limit=5 HTTP/1.1
    host: group1k.test.hdfgroup.org
    Accept-Encoding: gzip, deflate
    Accept: */*
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0  
    
Sample Response Batch
---------------------

.. code-block:: http

    HTTP/1.1 200 OK
    Date: Tue, 20 Jan 2015 07:30:03 GMT
    Content-Length: 996
    Etag: "221affdeae54076d3493ce8ce0ed80ddb89c6e27"
    Content-Type: application/json
    Server: TornadoServer/3.2.2
    
.. code-block:: json
   
     
    {
    "links": [
        {"title": "g0090", "id": "76c53485-a06e-11e4-96f3-3c15c2da029e", "class": "H5L_TYPE_HARD", "collection": "groups"}, 
        {"title": "g0091", "id": "76c54d40-a06e-11e4-a342-3c15c2da029e", "class": "H5L_TYPE_HARD", "collection": "groups"}, 
        {"title": "g0092", "id": "76c564f5-a06e-11e4-bccd-3c15c2da029e", "class": "H5L_TYPE_HARD", "collection": "groups"}, 
        {"title": "g0093", "id": "76c57d19-a06e-11e4-a9a8-3c15c2da029e", "class": "H5L_TYPE_HARD", "collection": "groups"}, 
        {"title": "g0094", "id": "76c5941c-a06e-11e4-b641-3c15c2da029e", "class": "H5L_TYPE_HARD", "collection": "groups"}
      ],
    "hrefs": [
        {"href": "http://group1k.test.hdfgroup.org/groups/76bddb1e-a06e-11e4-86d6-3c15c2da029e/links", "rel": "self"}, 
        {"href": "http://group1k.test.hdfgroup.org/groups/76bddb1e-a06e-11e4-86d6-3c15c2da029e", "rel": "root"}, 
        {"href": "http://group1k.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://group1k.test.hdfgroup.org/groups/76bddb1e-a06e-11e4-86d6-3c15c2da029e", "rel": "owner"}
      ]
    } 
       
Related Resources
=================

* :doc:`DELETE_Link`
* :doc:`GET_Link`
* :doc:`GET_Group`
* :doc:`PUT_Link`
 

 

================================================
FILE: docs/GroupOps/POST_Group.rst
================================================
**********************************************
POST Group
**********************************************

Description
===========
Creates a new Group.

*Note:* By default he new Group will not be linked from any other group in the domain.
A link element can be included in the request body to have an existing group link to 
the new group.
Alternatively, use the *PUT link* operation to link the new 
group.

Requests
========

Syntax
------
.. code-block:: http

    POST /groups HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Request Elements
----------------
Optionally the request body can be a JSON object that has a link key with sub-keys:

id
^^
The UUID of the group the new group should be linked to.  If the UUID is not valid,
the request will fail and a new group will not be created.

name
^^^^
The name of the new link.


Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

id
^^
The UUID of the newly created group

attributeCount
^^^^^^^^^^^^^^
The number of attributes belonging to the group.

linkCount
^^^^^^^^^
The number of links belonging to the group.

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

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request
--------------

Create a new, un-linked Group.

.. code-block:: http

    POST /groups HTTP/1.1
    Content-Length: 0
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: testGroupPost.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
Sample Response
---------------

.. code-block:: http

    HTTP/1.1 201 Created
    Content-Length: 705
    Content-Location: http://testGroupPost.test.hdfgroup.org/groups/777978c5-a078-11e4-8755-3c15c2da029e
    Server: TornadoServer/3.2.2
    Location: http://testGroupPost.test.hdfgroup.org/groups/777978c5-a078-11e4-8755-3c15c2da029e
    Date: Tue, 20 Jan 2015 07:46:38 GMT
    Content-Type: application/json
    
.. code-block:: json
  
    {
    "id": "777978c5-a078-11e4-8755-3c15c2da029e",
    "created": "2015-01-20T07:46:38Z", 
    "lastModified": "2015-01-20T07:46:38Z", 
    "attributeCount": 0, 
    "linkCount": 0,
    "hrefs": [
        {"href": "http://testGroupPost.test.hdfgroup.org/groups/777978c5-a078-11e4-8755-3c15c2da029e", "rel": "self"}, 
        {"href": "http://testGroupPost.test.hdfgroup.org/groups/777978c5-a078-11e4-8755-3c15c2da029e/links", "rel": "links"}, 
        {"href": "http://testGroupPost.test.hdfgroup.org/groups/777109b3-a078-11e4-8512-3c15c2da029e", "rel": "root"}, 
        {"href": "http://testGroupPost.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://testGroupPost.test.hdfgroup.org/groups/777978c5-a078-11e4-8755-3c15c2da029e/attributes", "rel": "attributes"}
      ]
    }
    
Sample Request with Link
------------------------

Create a new Group, link to root (which has uuid of "36b921f3-...") as "linked_group".

.. code-block:: http

    POST /groups HTTP/1.1
    Content-Length: 79
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: testGroupPostWithLink.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
.. code-block:: json

    {
    "link": {
        "id": "36b921f3-a07a-11e4-88da-3c15c2da029e", 
        "name": "linked_group"
      }
    }
    
Sample Response with Link
-------------------------

.. code-block:: http

    HTTP/1.1 201 Created
    Content-Length: 745
    Content-Location: http://testGroupPostWithLink.test.hdfgroup.org/groups/36cbe08a-a07a-11e4-8301-3c15c2da029e
    Server: TornadoServer/3.2.2
    Location: http://testGroupPostWithLink.test.hdfgroup.org/groups/36cbe08a-a07a-11e4-8301-3c15c2da029e
    Date: Tue, 20 Jan 2015 07:59:09 GMT
    Content-Type: application/json
    
.. code-block:: json
     
    {
    "id": "36cbe08a-a07a-11e4-8301-3c15c2da029e",   
    "attributeCount": 0, 
    "linkCount": 0, 
    "created": "2015-01-20T07:59:09Z", 
    "lastModified": "2015-01-20T07:59:09Z", 
    "hrefs": [
        {"href": "http://testGroupPostWithLink.test.hdfgroup.org/groups/36cbe08a-a07a-11e4-8301-3c15c2da029e", "rel": "self"}, 
        {"href": "http://testGroupPostWithLink.test.hdfgroup.org/groups/36cbe08a-a07a-11e4-8301-3c15c2da029e/links", "rel": "links"}, 
        {"href": "http://testGroupPostWithLink.test.hdfgroup.org/groups/36b921f3-a07a-11e4-88da-3c15c2da029e", "rel": "root"}, 
        {"href": "http://testGroupPostWithLink.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://testGroupPostWithLink.test.hdfgroup.org/groups/36cbe08a-a07a-11e4-8301-3c15c2da029e/attributes", "rel": "attributes"}
        ]
    }
    
Related Resources
=================

* :doc:`DELETE_Group`
* :doc:`GET_Links`
* :doc:`PUT_Link`
* :doc:`GET_Group`
* :doc:`GET_Groups`
 

 

================================================
FILE: docs/GroupOps/PUT_Link.rst
================================================
**********************************************
PUT Link
**********************************************

Description
===========
Creates a new link in a given group.

Either hard, soft, or external links can be created based on the request elements.
See examples below.

*Note:* any existing link with the same name will be replaced with the new link.


Requests
========

Syntax
------
.. code-block:: http

    PUT /groups/<id>/links/<name> HTTP/1.1
    Host: DOMAIN
    Authorization: <authorization_string>
    
* *<id>* is the UUID of the group that the link will be created in.
* *<name>* is the URL-encoded name of the link.
    
Request Parameters
------------------
This implementation of the operation does not use request parameters.

Request Headers
---------------
This implementation of the operation uses only the request headers that are common
to most requests.  See :doc:`../CommonRequestHeaders`

Request Elements
----------------
The request body must include a JSON object that has the following key:

id
^^
The UUID of the group the new group should be linked to.  If the UUID is not valid,
the request will fail and a new group will not be created.
If this key is present, the h5path and h5domain keys will be ignored

h5path
^^^^^^
A string describing a path to an external resource.  If this key is present an
soft or external link will be created.

h5domain
^^^^^^^^
A string giving the external domain where the resource is present.
If this key is present, the h5path key must be provided as well.
 

Responses
=========

Response Headers
----------------

This implementation of the operation uses only response headers that are common to 
most responses.  See :doc:`../CommonResponseHeaders`.

Response Elements
-----------------

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

hrefs
^^^^^
An array of links to related resources.  See :doc:`../Hypermedia`.

Special Errors
--------------

The implementation of the operation does not return special errors.  For general 
information on standard error codes, see :doc:`../CommonErrorResponses`.

Examples
========

Sample Request - Create Hard Link
---------------------------------

In group "e0309a0a-...", create a hard link named "g3" that points to the object 
with uuid "e032ad9c-...".

.. code-block:: http

    PUT /groups/e0309a0a-a198-11e4-b127-3c15c2da029e/links/g3 HTTP/1.1
    Content-Length: 46
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: tall_updated.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
.. code-block:: json

    {"id": "e032ad9c-a198-11e4-8d53-3c15c2da029e"}
    
Sample Response - Create Hard Link
----------------------------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Wed, 21 Jan 2015 18:11:09 GMT
    Content-Length: 418
    Content-Type: application/json
    Server: TornadoServer/3.2.2

    
.. code-block:: json
  
    {
    "hrefs": [
        {"href": "http://tall_updated.test.hdfgroup.org/groups/e0309a0a-a198-11e4-b127-3c15c2da029e/links/g3", "rel": "self"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/e0309a0a-a198-11e4-b127-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/e0309a0a-a198-11e4-b127-3c15c2da029e", "rel": "owner"}
      ]
    }
    
Sample Request - Create Soft Link
---------------------------------

In group "e0309a0a-...", create a soft link named "softlink" that contains the path 
"/somewhere".

.. code-block:: http

    PUT /groups/e0309a0a-a198-11e4-b127-3c15c2da029e/links/softlink HTTP/1.1
    Content-Length: 24
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: tall_updated.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
.. code-block:: json
   
    {"h5path": "/somewhere"}
    
Sample Response - Create Soft Link
----------------------------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Wed, 21 Jan 2015 18:35:26 GMT
    Content-Length: 424
    Content-Type: application/json
    Server: TornadoServer/3.2.2
  
.. code-block:: json
      
    {
    "hrefs": [
        {"href": "http://tall_updated.test.hdfgroup.org/groups/e0309a0a-a198-11e4-b127-3c15c2da029e/links/softlink", "rel": "self"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/e0309a0a-a198-11e4-b127-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/e0309a0a-a198-11e4-b127-3c15c2da029e", "rel": "owner"}
      ]
    }
    
Sample Request - Create External Link
-------------------------------------

In group "d2f8bd6b-...", create an external link named "extlink" that references the  
object at path: "/somewhere" in domain: "external_target.test.hdfgroup.org".

.. code-block:: http

    PUT /groups/d2f8bd6b-a1b1-11e4-ae1c-3c15c2da029e/links/extlink HTTP/1.1
    Content-Length: 69
    User-Agent: python-requests/2.3.0 CPython/2.7.8 Darwin/14.0.0
    host: tall_updated.test.hdfgroup.org
    Accept: */*
    Accept-Encoding: gzip, deflate
    
.. code-block:: json
   
    {"h5domain": "external_target.test.hdfgroup.org", "h5path": "/dset1"}
    
Sample Response - Create External Link
--------------------------------------

.. code-block:: http

    HTTP/1.1 201 Created
    Date: Wed, 21 Jan 2015 21:09:45 GMT
    Content-Length: 423
    Content-Type: application/json
    Server: TornadoServer/3.2.2
  
.. code-block:: json
         
    {
    "hrefs": [
        {"href": "http://tall_updated.test.hdfgroup.org/groups/d2f8bd6b-a1b1-11e4-ae1c-3c15c2da029e/links/extlink", "rel": "self"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/d2f8bd6b-a1b1-11e4-ae1c-3c15c2da029e", "rel": "root"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/", "rel": "home"}, 
        {"href": "http://tall_updated.test.hdfgroup.org/groups/d2f8bd6b-a1b1-11e4-ae1c-3c15c2da029e", "rel": "owner"}
        ]
    }
    
    
Related Resources
=================

* :doc:`DELETE_Link`
* :doc:`GET_Link`
* :doc:`GET_Links`
* :doc:`GET_Group`
 

 

================================================
FILE: docs/GroupOps/index.rst
================================================
####################
Groups
####################

Groups are objects that can be used to organize objects within a domain.  Groups contain
*links* which can reference other objects (datasets, groups or committed datatypes).
There are four different types of links that can be used:

* hard: A direct link to a group, dataset, or committed datatype object in the domain.
* soft: A symbolic link that gives a path to an object within the domain (object may or may not be present).
* external: A symbolic link to an object that is external to the domain.
* user-defined: A user-defined link (this implementation only provides title and class for user-defined links).

Groups all have attributes which can be used to store meta-data about the group.

Creating Groups
---------------

Use the :doc:`POST_Group` to create new Groups.  Initially the new group will have no
links and no attributes.


Getting information about Groups
--------------------------------

Use :doc:`GET_Group` to get information about a group: attribute count, link count,
creation and modification times.

To retrieve the UUIDs of all the groups in a domain, use :doc:`GET_Groups`.

To retrieve the links of a group use :doc:`GET_Links`. Use :doc:`GET_Link` to get
information about a specific link.

To get a group's attributes, use :doc:`../AttrOps/GET_Attributes`. 

Updating Links
---------------

To create a hard, soft, or external link, use :doc:`PUT_Link`.   

To delete a link use :doc:`DELETE_Link`.

*Note*: deleting a link doesn't delete the object that it refers to.


Deleting Groups
---------------
Use :doc:`DELETE_Group` to remove a group.  All attributes and links of the group
will be deleted.

*Note:* deleting a group will not delete any objects (datasets or other groups) that the
the group's links points to.  These objects may become *anonymous*, i.e. they are not
referenced by any link, but can still be accessed via ``GET`` request with the object
uuid.

List of Operations
------------------

.. toctree::
   :maxdepth: 1

   DELETE_Group
   DELETE_Link
   GET_Group
   GET_Groups
   GET_Link
   GET_Links
   POST_Group
   PUT_Link
    
    


================================================
FILE: docs/Hypermedia.rst
================================================
*************************
Hypermedia
*************************

h5serv supports the REST convention of **HATEOAS** or *Hypermedia as the Engine of 
Application State*.  The idea is (see http://en.wikipedia.org/wiki/HATEOS for a full 
explanation) is that each response include links to related resources related to 
the requested resource.

For example, consider the request for a dataset: ``GET /datasets/<id>``.  The response
will be a JSON representation of the dataset describing it's type, shape, and other
aspects.  Related resources to the dataset would include:

 * the dataset's attributes
 * the dataset's value
 * the dataset collection of the domain
 * the root group of the domain the dataset is in
 * the domain resource
 
So the ``GET /datasets/<id>`` response includes a key ``hrefs`` that contains an
a JSON array.  Each array element has a key: ``href`` - the related resource, and a key:
``rel`` that denotes the type of relation.   Example:

.. code-block:: json
       
    {
    "hrefs": [
        {"href": "http://tall.test.hdfgroup.org/datasets/<id>", "rel": "self"}, 
        {"href": "http://tall.test.hdfgroup.org/groups/<id>", "rel": "root"}, 
        {"href": "http://tall.test.hdfgroup.org/datasets/<id>/attributes", "rel": "attributes"}, 
        {"href": "http://tall.test.hdfgroup.org/datasets/<id>/value", "rel": "data"}, 
        {"href": "http://tall.test.hdfgroup.org/", "rel": "home"}
      ] 
    }
    
This enables clients to "explore" the api without detailed knowledge of the API.

This is the list of relations used in h5serv:

 * attributes - the attributes of the resource 
 * data - the resources data (used for datasets)
 * database - the collection of all datasets in the domain
 * groupbase - the collection of all groups in the domain
 * home - the domain the resource is a member of
 * owner - the containing object of this resource (e.g. the group an attribute is a member of)
 * root - the root group of the domain the resource is a member of
 * self - this resource
 * typebase - the collection of all committed types in the domain


================================================
FILE: docs/Installation/ServerSetup.rst
================================================
###################
Installing h5serv
###################

You should find h5serv quite easy to setup.  The server (based on Python Tornado) is 
self-contained, so you will not need to setup Apache or other web server software to utilize
h5serv.


Prerequisites
-------------

A computer running a 64-bit version of Windows, Mac OS X, or Linux.

You will also need the following Python packages:

* Python 2.7 or later
* NumPy 1.10.4 or later
* h5py 2.5 or later
* tornado 4.0.2 or later
* watchdog 0.8.3 or later
* requests 2.3 or later (for client tests)

If you are not familiar with installing Python packages, the easiest route is to 
use a package manager such as Anaconda (as described below).

If you have a git client installed on your system, you can directly download the h5serv 
source from GitHub: ``git clone --recursive https://github.com/HDFGroup/h5serv.git``.  
Otherwise, you can download a zip file of the source from GitHub (as described below).


Installing on Windows
---------------------

Anaconda from Continuum Analytics can be used to easily manage the package dependencies 
needed for HDF Server.  

In a browser go to: http://continuum.io/downloads and click the "Windows 64-bit 
Python 2.7 Graphical Installer" button.

Install Anaconda using the default options.

Once Anaconda is installed select "Anaconda Command Prompt" from the start menu.

In the command window that appears, create a new anaconda environment using the following command:
``conda create -n h5serv python=2.7 h5py tornado requests pytz``

Answer 'y' to the prompt, and the packages will be fetched.

In the same command window, run: ``activate h5serv``

Install the watchdog package (this is currently not available through Anaconda):
``pip install watchdog``

Download the hdf5-json project: ``git clone https://github.com/HDFGroup/hdf5-json.git`` .
Alternatively, in a browser go to: https://github.com/HDFGroup/hdf5-json and click the 
"Download ZIP" button (right side of page).   Download the zip file and extract to
the destination directory of your choice.  

Next, cd to the hdf5-json folder and run: ``python setup.py install``.

Download the h5serv project: ``git clone https://github.com/HDFGroup/h5serv.git`` .
Alternatively, download the source zip as described above. 

Next, in the command window, cd to the folder you extracted the source files to.

Run: ``python h5serv``
You should see the output: "Starting event loop on port: 5000".

You may then see a security alert: "Windows Firewall has blocked some features of this 
program".  Click "Allow access" with the default option (Private network access).

At this point the server is running, waiting on any requests being sent to port 5000.
Go to the "verification" section below to try out the service.

Installing on Linux/Mac OS X
-----------------------------

Anaconda from Continuum Analytics can be used to easily manage the package dependencies 
needed for HDF Server.  

In a browser go to: http://continuum.io/downloads and click the "Mac OS X 64-bit 
Python 2.7 Graphical Installer" button for Mac OS X or: "Linux 64-bit Python 2.7".

Install Anaconda using the default options.

Once Anaconda is installed, open a new shell and run the following on the command line:

``conda create -n h5serv python=2.7 h5py tornado requests pytz``

Answer 'y' to the prompt, and the packages will be fetched.

Install the watchdog package (this is currently not available through Anaconda):
``pip install watchdog``

In the same shell, run: ``source activate h5serv``

Download the hdf5-json project: ``git clone https://github.com/HDFGroup/hdf5-json.git`` .
Alternatively, in a browser go to: https://github.com/HDFGroup/hdf5-json and click the 
"Download ZIP" button (right side of page).   Download the zip file and extract to
the destination directory of your choice.  

Next, cd to the hdf5-json folder and run: ``python setup.py install``.

Download the h5serv project: ``git clone https://github.com/HDFGroup/h5serv.git`` .
Alternatively, download the source zip as described above. 

Next, in the command window, cd to the folder you extracted the source files to.

Run: ``python h5serv``
You should see the output: "Starting event loop on port: 5000".

At this point the server is running, waiting on any requests being sent to port 5000.
Go to the "verification" section below to try out the service.


Verification
-------------

To verify that h5serv was installed correctly, you can run the test suite included
with the installation.  

Open a new shell (on Windows, run "Annaconda Command Prompt" from the start menu).

In this shell, run the following commands:

* source activate h5serv  (just: activate h5serv on Windows)
* cd <h5serv installation directory>
* cd test
* python testall.py

All tests should report OK. 

Server Configuration
--------------------

The file ``h5serv/server/config.py`` provides several configuration options that can be
used to customize h5serv.  Each of the options can be changed by:

 * Changing the value in the config.py file and re-starting the service.
 * Passing a command line option to ``h5serv`` o
Download .txt
gitextract_szc0bvdr/

├── .gitignore
├── .gitmodules
├── .travis.yml
├── COPYING
├── Dockerfile
├── README.rst
├── data/
│   ├── public/
│   │   └── tall.h5
│   └── readme.txt
├── docs/
│   ├── AclOps/
│   │   ├── GET_ACL.rst
│   │   ├── GET_ACLs.rst
│   │   ├── PUT_ACL.rst
│   │   └── index.rst
│   ├── AdminTools.rst
│   ├── AttrOps/
│   │   ├── DELETE_Attribute.rst
│   │   ├── GET_Attribute.rst
│   │   ├── GET_Attributes.rst
│   │   ├── PUT_Attribute.rst
│   │   └── index.rst
│   ├── Authorization.rst
│   ├── CommonErrorResponses.rst
│   ├── CommonRequestHeaders.rst
│   ├── CommonResponseHeaders.rst
│   ├── DatasetOps/
│   │   ├── DELETE_Dataset.rst
│   │   ├── GET_Dataset.rst
│   │   ├── GET_DatasetShape.rst
│   │   ├── GET_DatasetType.rst
│   │   ├── GET_Datasets.rst
│   │   ├── GET_Value.rst
│   │   ├── POST_Dataset.rst
│   │   ├── POST_Value.rst
│   │   ├── PUT_DatasetShape.rst
│   │   ├── PUT_Value.rst
│   │   └── index.rst
│   ├── DatatypeOps/
│   │   ├── DELETE_Datatype.rst
│   │   ├── GET_Datatype.rst
│   │   ├── GET_Datatypes.rst
│   │   ├── POST_Datatype.rst
│   │   └── index.rst
│   ├── Diagram.rst
│   ├── DomainOps/
│   │   ├── DELETE_Domain.rst
│   │   ├── GET_Domain.rst
│   │   ├── PUT_Domain.rst
│   │   └── index.rst
│   ├── FAQ/
│   │   └── index.rst
│   ├── GroupOps/
│   │   ├── DELETE_Group.rst
│   │   ├── DELETE_Link.rst
│   │   ├── GET_Group.rst
│   │   ├── GET_Groups.rst
│   │   ├── GET_Link.rst
│   │   ├── GET_Links.rst
│   │   ├── POST_Group.rst
│   │   ├── PUT_Link.rst
│   │   └── index.rst
│   ├── Hypermedia.rst
│   ├── Installation/
│   │   ├── ServerSetup.rst
│   │   └── index.rst
│   ├── Introduction/
│   │   └── index.rst
│   ├── License/
│   │   └── index.rst
│   ├── Makefile
│   ├── Reference.rst
│   ├── Resources.rst
│   ├── Tutorials/
│   │   ├── IPython_samples.rst
│   │   └── index.rst
│   ├── Types/
│   │   └── index.rst
│   ├── UsingIteration.rst
│   ├── Utilities.rst
│   ├── WhatsNew/
│   │   └── index.rst
│   ├── _static/
│   │   └── README
│   ├── build.sh
│   ├── conf.py
│   ├── index.rst
│   └── make.bat
├── entrypoint.sh
├── examples/
│   ├── h5pyd_ex1.ipynb
│   ├── h5pyd_ex2.ipynb
│   ├── nodejs/
│   │   └── gettoc.js
│   ├── pi_compute.ipynb
│   └── rest_ex1.ipynb
├── h5serv/
│   ├── __init__.py
│   ├── __main__.py
│   ├── app.py
│   ├── authFile.py
│   ├── authMongo.py
│   ├── config.py
│   ├── fileUtil.py
│   ├── h5watchdog.py
│   ├── httpErrorUtil.py
│   ├── passwordUtil.py
│   ├── timeUtil.py
│   └── tocUtil.py
├── setup.py
├── test/
│   ├── aws/
│   │   ├── config.py
│   │   └── roottest.py
│   ├── integ/
│   │   ├── acltest.py
│   │   ├── attributetest.py
│   │   ├── config.py
│   │   ├── datasettest.py
│   │   ├── datasettypetest.py
│   │   ├── datatypetest.py
│   │   ├── dirtest.py
│   │   ├── grouptest.py
│   │   ├── helper.py
│   │   ├── linktest.py
│   │   ├── makeattr.py
│   │   ├── makegroups.py
│   │   ├── roottest.py
│   │   ├── setupdata.py
│   │   ├── shapetest.py
│   │   ├── spidertest.py
│   │   └── valuetest.py
│   ├── test_files/
│   │   ├── array_attr.h5
│   │   ├── array_dset.h5
│   │   ├── arraytype.h5
│   │   ├── attr1k.h5
│   │   ├── bitfield_attr.h5
│   │   ├── bitfield_dset.h5
│   │   ├── bool_attr.h5
│   │   ├── bool_dset.h5
│   │   ├── committed_type.h5
│   │   ├── comp_complex.h5
│   │   ├── compound.h5
│   │   ├── compound_array.h5
│   │   ├── compound_array_attr.h5
│   │   ├── compound_array_dset.h5
│   │   ├── compound_attr.h5
│   │   ├── compound_committed.h5
│   │   ├── dim_scale.h5
│   │   ├── dim_scale_data.h5
│   │   ├── dset1k.h5
│   │   ├── dset_creationprop.h5
│   │   ├── dset_gzip.h5
│   │   ├── empty.h5
│   │   ├── enum_attr.h5
│   │   ├── enum_dset.h5
│   │   ├── ex_image2.h5
│   │   ├── ex_image3.h5
│   │   ├── fillvalue.h5
│   │   ├── fixed_string_attr.h5
│   │   ├── fixed_string_dset.h5
│   │   ├── group100.h5
│   │   ├── group1k.h5
│   │   ├── h5ex_d_alloc.h5
│   │   ├── h5ex_d_checksum.h5
│   │   ├── h5ex_d_chunk.h5
│   │   ├── h5ex_d_compact.h5
│   │   ├── h5ex_d_extern.h5
│   │   ├── h5ex_d_fillval.h5
│   │   ├── h5ex_d_gzip.h5
│   │   ├── h5ex_d_hyper.h5
│   │   ├── h5ex_d_nbit.h5
│   │   ├── h5ex_d_rdwr.h5
│   │   ├── h5ex_d_shuffle.h5
│   │   ├── h5ex_d_sofloat.h5
│   │   ├── h5ex_d_soint.h5
│   │   ├── h5ex_d_transform.h5
│   │   ├── h5ex_d_unlimadd.h5
│   │   ├── h5ex_d_unlimgzip.h5
│   │   ├── h5ex_d_unlimmod.h5
│   │   ├── namedtype.h5
│   │   ├── notahdf5file.h5
│   │   ├── null_objref_dset.h5
│   │   ├── null_space_attr.h5
│   │   ├── null_space_dset.h5
│   │   ├── objref_attr.h5
│   │   ├── objref_dset.h5
│   │   ├── opaque_attr.h5
│   │   ├── opaque_dset.h5
│   │   ├── regionref_attr.h5
│   │   ├── regionref_dset.h5
│   │   ├── resizable.h5
│   │   ├── sample.h5
│   │   ├── scalar.h5
│   │   ├── scalar_attr.h5
│   │   ├── tall.h5
│   │   ├── tall_with_udlink.h5
│   │   ├── tallrw.h5
│   │   ├── tgroup.h5
│   │   ├── tref.h5
│   │   ├── tstr.h5
│   │   ├── type1k.h5
│   │   ├── types_attr.h5
│   │   ├── types_dset.h5
│   │   ├── vlen_attr.h5
│   │   ├── vlen_dset.h5
│   │   ├── vlen_string_attr.h5
│   │   ├── vlen_string_dset.h5
│   │   ├── vlen_string_dset_utc.h5
│   │   ├── vlen_string_nullterm_attr.h5
│   │   ├── vlen_string_nullterm_dset.h5
│   │   ├── vlen_unicode_attr.h5
│   │   └── zerodim.h5
│   ├── testall.py
│   └── unit/
│       ├── config.py
│       ├── fileUtilTest.py
│       └── timeUtilTest.py
└── util/
    ├── admin/
    │   ├── add_user.py
    │   ├── config.py
    │   ├── getacl.py
    │   ├── import_file.py
    │   ├── makepwd_file.py
    │   ├── remove_db.py
    │   ├── setacl.py
    │   └── update_pwd.py
    ├── dumpobjdb.py
    ├── dumptojson.sh
    ├── exporth5.py
    ├── exportjson.py
    └── rebuildIndex.py
Download .txt
SYMBOL INDEX (465 symbols across 37 files)

FILE: h5serv/app.py
  function to_bytes (line 49) | def to_bytes(a_string):
  function to_str (line 55) | def to_str(a_string):
  class DefaultHandler (line 61) | class DefaultHandler(RequestHandler):
    method put (line 62) | def put(self):
    method get (line 69) | def get(self):
    method post (line 76) | def post(self):
    method delete (line 83) | def delete(self):
  class BaseHandler (line 91) | class BaseHandler(tornado.web.RequestHandler):
    method set_default_headers (line 96) | def set_default_headers(self):
    method options (line 104) | def options(self):
    method get_current_user (line 112) | def get_current_user(self):
    method verifyAcl (line 142) | def verifyAcl(self, acl, action):
    method baseHandler (line 162) | def baseHandler(self, checkExists=True):
    method getExternalHref (line 207) | def getExternalHref(self, domain, h5path=None):
    method getHref (line 239) | def getHref(self, uri, query=None):
    method setDefaultAcl (line 257) | def setDefaultAcl(self):
    method getFilePath (line 288) | def getFilePath(self, domain, checkExists=True):
    method convertExternalPath (line 333) | def convertExternalPath(self, path_name):
    method isWritable (line 390) | def isWritable(self, filePath):
    method isTocFilePath (line 395) | def isTocFilePath(self, filePath):
    method nameDecode (line 404) | def nameDecode(self, name):
    method nameEncode (line 411) | def nameEncode(self, name):
    method getRequestId (line 438) | def getRequestId(self):
    method getAcceptType (line 484) | def getAcceptType(self):
  class LinkCollectionHandler (line 493) | class LinkCollectionHandler(BaseHandler):
    method get (line 494) | def get(self):
  class LinkHandler (line 574) | class LinkHandler(BaseHandler):
    method getName (line 575) | def getName(self, uri):
    method get (line 607) | def get(self):
    method put (line 675) | def put(self):
    method delete (line 779) | def delete(self):
  class AclHandler (line 818) | class AclHandler(BaseHandler):
    method getRequestCollectionName (line 819) | def getRequestCollectionName(self):
    method getName (line 849) | def getName(self):
    method convertUserIdToUserName (line 880) | def convertUserIdToUserName(self, acl_in):
    method get (line 910) | def get(self):
    method put (line 1001) | def put(self):
  class TypeHandler (line 1091) | class TypeHandler(BaseHandler):
    method get (line 1092) | def get(self):
    method delete (line 1140) | def delete(self):
  class DatatypeHandler (line 1171) | class DatatypeHandler(BaseHandler):
    method get (line 1172) | def get(self):
  class ShapeHandler (line 1208) | class ShapeHandler(BaseHandler):
    method get (line 1210) | def get(self):
    method put (line 1246) | def put(self):
  class DatasetHandler (line 1316) | class DatasetHandler(BaseHandler):
    method getDatasetNumElements (line 1318) | def getDatasetNumElements(self, shape_item):
    method getPreviewQuery (line 1336) | def getPreviewQuery(self, shape_item):
    method get (line 1376) | def get(self):
    method delete (line 1440) | def delete(self):
  class ValueHandler (line 1475) | class ValueHandler(BaseHandler):
    method getSliceQueryParam (line 1477) | def getSliceQueryParam(self, dim, extent):
    method getHyperslabSelection (line 1568) | def getHyperslabSelection(self, dsetshape, start, stop, step):
    method get (line 1635) | def get(self):
    method post (line 1780) | def post(self):
    method put (line 1869) | def put(self):
  class AttributeHandler (line 1987) | class AttributeHandler(BaseHandler):
    method convertToTuple (line 1990) | def convertToTuple(self, data):
    method getRequestName (line 1999) | def getRequestName(self):
    method getRequestCollectionName (line 2023) | def getRequestCollectionName(self):
    method get (line 2044) | def get(self):
    method put (line 2134) | def put(self):
    method delete (line 2243) | def delete(self):
  class GroupHandler (line 2290) | class GroupHandler(BaseHandler):
    method get (line 2292) | def get(self):
    method delete (line 2373) | def delete(self):
  class GroupCollectionHandler (line 2403) | class GroupCollectionHandler(BaseHandler):
    method get (line 2405) | def get(self):
    method post (line 2450) | def post(self):
  class DatasetCollectionHandler (line 2548) | class DatasetCollectionHandler(BaseHandler):
    method get (line 2550) | def get(self):
    method post (line 2593) | def post(self):
  class TypeCollectionHandler (line 2761) | class TypeCollectionHandler(BaseHandler):
    method get (line 2762) | def get(self):
    method post (line 2807) | def post(self):
  class RootHandler (line 2904) | class RootHandler(BaseHandler):
    method getRootResponse (line 2906) | def getRootResponse(self, filePath):
    method get (line 2943) | def get(self):
    method put (line 2965) | def put(self):
    method delete (line 3024) | def delete(self):
  class InfoHandler (line 3073) | class InfoHandler(RequestHandler):
    method get (line 3075) | def get(self):
  function sig_handler (line 3114) | def sig_handler(sig, frame):
  function shutdown (line 3120) | def shutdown():
  function make_app (line 3143) | def make_app():
  function updateToc (line 3208) | def updateToc(filepath):
  function periodicCallback (line 3238) | def periodicCallback():
  function main (line 3249) | def main():

FILE: h5serv/authFile.py
  class AuthClient (line 29) | class AuthClient(object):
    method __init__ (line 31) | def __init__(self, filepath):
    method getUserInfo (line 44) | def getUserInfo(self, user_name):
    method getUserId (line 98) | def getUserId(self, user_name):
    method getUserName (line 110) | def getUserName(self, userid):
    method validateUserPassword (line 154) | def validateUserPassword(self, user_name, password):

FILE: h5serv/authMongo.py
  class AuthClient (line 31) | class AuthClient(object):
    method __init__ (line 33) | def __init__(self, mongouri):
    method getUserInfo (line 48) | def getUserInfo(self, user_name):
    method getUserId (line 95) | def getUserId(self, user_name):
    method getUserName (line 107) | def getUserName(self, userid):
    method validateUserPassword (line 143) | def validateUserPassword(self, user_name, password):

FILE: h5serv/config.py
  function get (line 43) | def get(x):
  function update (line 67) | def update(d):

FILE: h5serv/fileUtil.py
  function getFileModCreateTimes (line 27) | def getFileModCreateTimes(filePath):
  function isIPAddress (line 32) | def isIPAddress(s):
  function posixpath (line 56) | def posixpath(filepath):
  function join (line 67) | def join(path, paths):
  function getFilePath (line 74) | def getFilePath(host_value, auth=None):
  function getTocFilePathForDomain (line 143) | def getTocFilePathForDomain(host_value, auth=None):
  function getUserFilePath (line 209) | def getUserFilePath(file_path):
  function getDomain (line 225) | def getDomain(file_path, base_domain=None):
  function verifyFile (line 264) | def verifyFile(filePath, writable=False):
  function isFile (line 279) | def isFile(filePath):
  function makeDirs (line 291) | def makeDirs(filePath):

FILE: h5serv/h5watchdog.py
  class H5EventHandler (line 9) | class H5EventHandler(FileSystemEventHandler):
    method __init__ (line 12) | def __init__(self, event_queue):
    method on_moved (line 16) | def on_moved(self, event):
    method on_created (line 23) | def on_created(self, event):
    method on_deleted (line 33) | def on_deleted(self, event):
    method on_modified (line 41) | def on_modified(self, event):
  function h5observe (line 51) | def h5observe(data_path, event_queue):

FILE: h5serv/httpErrorUtil.py
  function errNoToHttpStatus (line 4) | def errNoToHttpStatus(error_code):

FILE: h5serv/passwordUtil.py
  function to_string (line 28) | def to_string(data):
  function to_bytes (line 37) | def to_bytes(data):
  function encrypt_pwd (line 46) | def encrypt_pwd(passwd):
  function getAuthClient (line 54) | def getAuthClient():

FILE: h5serv/timeUtil.py
  function unixTimeToUTC (line 5) | def unixTimeToUTC(timestamp):

FILE: h5serv/tocUtil.py
  function getTocFilePath (line 29) | def getTocFilePath(user=None):
  function isTocFilePath (line 42) | def isTocFilePath(filePath):
  function getSubgroupId (line 56) | def getSubgroupId(db, group_uuid, link_name):
  function addTocEntry (line 75) | def addTocEntry(domain, filePath,  userid=None):
  function removeTocEntry (line 132) | def removeTocEntry(domain, filePath, userid=None):
  function createTocFile (line 174) | def createTocFile(datapath):

FILE: test/aws/roottest.py
  class RootTest (line 18) | class RootTest(unittest.TestCase):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method testGetInfo (line 24) | def testGetInfo(self):
    method testGetDomain (line 33) | def testGetDomain(self):

FILE: test/integ/acltest.py
  class AclTest (line 26) | class AclTest(unittest.TestCase):
    method __init__ (line 27) | def __init__(self, *args, **kwargs):
    method getHeaders (line 35) | def getHeaders(self, user=None):
    method getUUIDByPath (line 43) | def getUUIDByPath(self, path):
    method setupAcls (line 51) | def setupAcls(self):
    method testGetDomainDefaultAcls (line 88) | def testGetDomainDefaultAcls(self):
    method testGetDomainAcls (line 98) | def testGetDomainAcls(self):
    method testPutDomain (line 140) | def testPutDomain(self):
    method testAttributes (line 153) | def testAttributes(self):
    method testDataset (line 200) | def testDataset(self):
    method testValue (line 260) | def testValue(self):
    method testDatatypes (line 309) | def testDatatypes(self):
    method testGroups (line 368) | def testGroups(self):
    method testRoot (line 466) | def testRoot(self):

FILE: test/integ/attributetest.py
  class AttributeTest (line 18) | class AttributeTest(unittest.TestCase):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method testGetGroupAttr (line 23) | def testGetGroupAttr(self):
    method testGetDatasetAttr (line 51) | def testGetDatasetAttr(self):
    method testGetAll (line 100) | def testGetAll(self):
    method testGetBatch (line 116) | def testGetBatch(self):
    method testGetNullSpace (line 142) | def testGetNullSpace(self):
    method testGetCompound (line 163) | def testGetCompound(self):
    method testGetCompoundArray (line 204) | def testGetCompoundArray(self):
    method testGetCommitted (line 236) | def testGetCommitted(self):
    method testGetArray (line 253) | def testGetArray(self):
    method testGetBool (line 285) | def testGetBool(self):
    method testGetVLenString (line 310) | def testGetVLenString(self):
    method testGetFixedString (line 337) | def testGetFixedString(self):
    method testGetEnum (line 365) | def testGetEnum(self):
    method testGetVlen (line 398) | def testGetVlen(self):
    method testGetOpaque (line 424) | def testGetOpaque(self):
    method testGetObjectReference (line 444) | def testGetObjectReference(self):
    method testGetRegionReference (line 469) | def testGetRegionReference(self):
    method testGetScalar (line 517) | def testGetScalar(self):
    method testGetScalarString (line 535) | def testGetScalarString(self):
    method testGetDimensionScale (line 555) | def testGetDimensionScale(self):
    method testPut (line 612) | def testPut(self):
    method testPutScalar (line 642) | def testPutScalar(self):
    method testPutList (line 661) | def testPutList(self):
    method testPutFixedString (line 685) | def testPutFixedString(self):
    method testPutVariableString (line 703) | def testPutVariableString(self):
    method testPutNullSpace (line 721) | def testPutNullSpace(self):
    method testPutObjReference (line 741) | def testPutObjReference(self):
    method testPutRegionReference (line 760) | def testPutRegionReference(self):
    method testPutCompound (line 800) | def testPutCompound(self):
    method testPutCommittedType (line 842) | def testPutCommittedType(self):
    method testPutDimensionScale (line 877) | def testPutDimensionScale(self):
    method testPutInvalid (line 906) | def testPutInvalid(self):
    method testDelete (line 917) | def testDelete(self):
    method testGetInvalidName (line 927) | def testGetInvalidName(self):

FILE: test/integ/datasettest.py
  class DatasetTest (line 18) | class DatasetTest(unittest.TestCase):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method testGet (line 23) | def testGet(self):
    method testGetResizable (line 46) | def testGetResizable(self):
    method testGetScalar (line 110) | def testGetScalar(self):
    method testGetScalarString (line 128) | def testGetScalarString(self):
    method testGetSimpleOneElement (line 145) | def testGetSimpleOneElement(self):
    method testGetSimpleOneElementString (line 163) | def testGetSimpleOneElementString(self):
    method testGetNullSpace (line 181) | def testGetNullSpace(self):
    method testGetCompound (line 199) | def testGetCompound(self):
    method testGetCompoundArray (line 232) | def testGetCompoundArray(self):
    method testGetCompoundCommitted (line 263) | def testGetCompoundCommitted(self):
    method testGetCompoundArray (line 296) | def testGetCompoundArray(self):
    method testGetCommitted (line 349) | def testGetCommitted(self):
    method testGetArray (line 368) | def testGetArray(self):
    method testGetFixedString (line 394) | def testGetFixedString(self):
    method testGetEnum (line 415) | def testGetEnum(self):
    method testGetBool (line 444) | def testGetBool(self):
    method testGetVlen (line 471) | def testGetVlen(self):
    method testGetOpaque (line 492) | def testGetOpaque(self):
    method testGetObjReference (line 511) | def testGetObjReference(self):
    method testGetNullObjReference (line 529) | def testGetNullObjReference(self):
    method testGetRegionReference (line 547) | def testGetRegionReference(self):
    method testGetFillValueProp (line 565) | def testGetFillValueProp(self):
    method testGetCreationProps (line 579) | def testGetCreationProps(self):
    method testGetFilters (line 700) | def testGetFilters(self):
    method testPost (line 746) | def testPost(self):
    method testPostScalar (line 782) | def testPostScalar(self):
    method testPostNullSpace (line 821) | def testPostNullSpace(self):
    method testPostZeroDim (line 856) | def testPostZeroDim(self):
    method testPostTypes (line 892) | def testPostTypes(self):
    method testPostCompoundType (line 941) | def testPostCompoundType(self):
    method testPostCompoundArrayVLenStringType (line 969) | def testPostCompoundArrayVLenStringType(self):
    method testPostCompoundFillValue (line 1001) | def testPostCompoundFillValue(self):
    method testPostCompoundArray (line 1030) | def testPostCompoundArray(self):
    method testPostCommittedType (line 1061) | def testPostCommittedType(self):
    method testPostObjReference (line 1114) | def testPostObjReference(self):
    method testPostArray (line 1140) | def testPostArray(self):
    method testPostResizable (line 1166) | def testPostResizable(self):
    method testPostInvalidType (line 1225) | def testPostInvalidType(self):
    method testPostInvalidShape (line 1234) | def testPostInvalidShape(self):
    method testPostNoBody (line 1243) | def testPostNoBody(self):
    method testPostWithLink (line 1251) | def testPostWithLink(self):
    method testPostCreationProps (line 1273) | def testPostCreationProps(self):
    method testInvalidCreationProps (line 1321) | def testInvalidCreationProps(self):
    method testPostDeflateFilter (line 1337) | def testPostDeflateFilter(self):
    method testPostLZFFilter (line 1390) | def testPostLZFFilter(self):
    method testPostSZIPFilter (line 1443) | def testPostSZIPFilter(self):
    method testDelete (line 1503) | def testDelete(self):
    method testDeleteRootChild (line 1524) | def testDeleteRootChild(self):
    method testDeleteAnonymous (line 1547) | def testDeleteAnonymous(self):
    method testDeleteBadUUID (line 1581) | def testDeleteBadUUID(self):
    method testGetCollection (line 1588) | def testGetCollection(self):
    method testGetCollectionBatch (line 1602) | def testGetCollectionBatch(self):

FILE: test/integ/datasettypetest.py
  class DatasetTypeTest (line 18) | class DatasetTypeTest(unittest.TestCase):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method testGet (line 23) | def testGet(self):
    method testGetScalar (line 39) | def testGetScalar(self):
    method testGetCompound (line 53) | def testGetCompound(self):

FILE: test/integ/datatypetest.py
  class DatatypeTest (line 18) | class DatatypeTest(unittest.TestCase):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method testGet (line 23) | def testGet(self):
    method testGetCompound (line 40) | def testGetCompound(self):
    method testPost (line 65) | def testPost(self):
    method testPostWithLink (line 89) | def testPostWithLink(self):
    method testPostTypes (line 114) | def testPostTypes(self):
    method testPostCompoundType (line 148) | def testPostCompoundType(self):
    method testPostInvalidType (line 209) | def testPostInvalidType(self):
    method testDelete (line 218) | def testDelete(self):
    method testGetCollection (line 235) | def testGetCollection(self):
    method testGetCollectionBatch (line 248) | def testGetCollectionBatch(self):

FILE: test/integ/dirtest.py
  class DirTest (line 22) | class DirTest(unittest.TestCase):
    method __init__ (line 23) | def __init__(self, *args, **kwargs):
    method testGetToc (line 29) | def testGetToc(self):
    method testGetUserToc (line 148) | def testGetUserToc(self):
    method testPutUserDomain (line 197) | def testPutUserDomain(self):
    method testDeleteUserDomain (line 249) | def testDeleteUserDomain(self):
    method testNoHostHeader (line 295) | def testNoHostHeader(self):
    method testPutDomain (line 304) | def testPutDomain(self):
    method testWatchdog (line 359) | def testWatchdog(self):
    method testDeleteToc (line 412) | def testDeleteToc(self):
    method testPutToc (line 418) | def testPutToc(self):
    method testDeleteRoot (line 426) | def testDeleteRoot(self):
    method testPutLink (line 437) | def testPutLink(self):
    method testDeleteLink (line 454) | def testDeleteLink(self):

FILE: test/integ/grouptest.py
  class GroupTest (line 18) | class GroupTest(unittest.TestCase):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method testGet (line 23) | def testGet(self):
    method testGetInvalidUUID (line 44) | def testGetInvalidUUID(self):
    method testGetWithHostQuery (line 58) | def testGetWithHostQuery(self):
    method testGetWithLinks (line 76) | def testGetWithLinks(self):
    method testPost (line 109) | def testPost(self):
    method testPostWithLink (line 127) | def testPostWithLink(self):
    method testBadPost (line 152) | def testBadPost(self):
    method testDelete (line 160) | def testDelete(self):
    method testDeleteAnonymous (line 177) | def testDeleteAnonymous(self):
    method testDeleteBadUUID (line 203) | def testDeleteBadUUID(self):
    method testDeleteRoot (line 210) | def testDeleteRoot(self):
    method testGetCollection (line 222) | def testGetCollection(self):
    method testGetCollectionBatch (line 236) | def testGetCollectionBatch(self):

FILE: test/integ/helper.py
  function getEndpoint (line 27) | def getEndpoint():
  function validateId (line 34) | def validateId(id):
  function getAuthString (line 46) | def getAuthString(user, password):
  function getRootUUID (line 57) | def getRootUUID(domain, user=None, password=None):
  function getUUID (line 73) | def getUUID(domain, parentUuid, name):
  function getUUIDByPath (line 92) | def getUUIDByPath(domain, path, user=None, password=None):
  function createGroup (line 139) | def createGroup(domain):
  function linkObject (line 154) | def linkObject(domain, objUuid, name, parentUuid=None):
  function readDataset (line 170) | def readDataset(domain, dsetUuid):
  function nameEncode (line 184) | def nameEncode(name):

FILE: test/integ/linktest.py
  class LinkTest (line 19) | class LinkTest(unittest.TestCase):
    method __init__ (line 20) | def __init__(self, *args, **kwargs):
    method testGetHard (line 24) | def testGetHard(self):
    method testGetMising (line 44) | def testGetMising(self):
    method testGetSoft (line 56) | def testGetSoft(self):
    method testGetExternal (line 78) | def testGetExternal(self):
    method testGetExternalLinkDomain (line 102) | def testGetExternalLinkDomain(self):
    method testGetUDLink (line 163) | def testGetUDLink(self):
    method testGetLinks (line 180) | def testGetLinks(self):
    method testGetBatch (line 201) | def testGetBatch(self):
    method testGetBadParam (line 269) | def testGetBadParam(self):
    method testPut (line 280) | def testPut(self):
    method testPutNameWithSpaces (line 305) | def testPutNameWithSpaces(self):
    method testPutBadReqId (line 328) | def testPutBadReqId(self):
    method testPutBadLinkId (line 340) | def testPutBadLinkId(self):
    method testPutNoName (line 353) | def testPutNoName(self):
    method testPutBadName (line 364) | def testPutBadName(self):
    method testPutSoftLink (line 376) | def testPutSoftLink(self):
    method testPutExternalLink (line 398) | def testPutExternalLink(self):
    method testPutExternalMissingPath (line 427) | def testPutExternalMissingPath(self):
    method testDelete (line 445) | def testDelete(self):

FILE: test/integ/roottest.py
  class RootTest (line 19) | class RootTest(unittest.TestCase):
    method __init__ (line 20) | def __init__(self, *args, **kwargs):
    method testGetInfo (line 24) | def testGetInfo(self):
    method testGetDomain (line 33) | def testGetDomain(self):
    method testGetReadOnly (line 53) | def testGetReadOnly(self):
    method testGetToc (line 62) | def testGetToc(self):
    method testGetNotFound (line 74) | def testGetNotFound(self):
    method testWrongTopLevelDomain (line 81) | def testWrongTopLevelDomain(self):
    method testInvalidDomain (line 88) | def testInvalidDomain(self):
    method testDomainWithSpaces (line 127) | def testDomainWithSpaces(self):
    method testGetSubdomain (line 135) | def testGetSubdomain(self):
    method testPutSubdomain (line 143) | def testPutSubdomain(self):
    method testPutSubSubdomain (line 151) | def testPutSubSubdomain(self):
    method testDelete (line 161) | def testDelete(self):
    method testDeleteReadonly (line 169) | def testDeleteReadonly(self):
    method testDeleteNotFound (line 177) | def testDeleteNotFound(self):
    method testDeleteSubSubdomain (line 184) | def testDeleteSubSubdomain(self):
    method testPut (line 191) | def testPut(self):
    method testGetDomainWithDot (line 205) | def testGetDomainWithDot(self):
    method testPutNameWithDot (line 225) | def testPutNameWithDot(self):

FILE: test/integ/setupdata.py
  function addTestAccount (line 103) | def addTestAccount(user_id):
  function addTestAccounts (line 146) | def addTestAccounts():
  function makeGroup1k (line 155) | def makeGroup1k():
  function makeAttr1k (line 169) | def makeAttr1k():
  function makeType1k (line 183) | def makeType1k():
  function makeDataset1k (line 196) | def makeDataset1k():
  function makeExternalLinks (line 210) | def makeExternalLinks():
  function removeFilesFromDir (line 233) | def removeFilesFromDir(dir_name):

FILE: test/integ/shapetest.py
  class ShapeTest (line 18) | class ShapeTest(unittest.TestCase):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method testGet (line 23) | def testGet(self):
    method testGetResizable (line 40) | def testGetResizable(self):
    method testPutResizable (line 95) | def testPutResizable(self):
    method testPutInvalidShape (line 198) | def testPutInvalidShape(self):

FILE: test/integ/spidertest.py
  class SpiderTest (line 18) | class SpiderTest(unittest.TestCase):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method validateHrefs (line 26) | def validateHrefs(self, href):
    method testHateoas (line 62) | def testHateoas(self):

FILE: test/integ/valuetest.py
  class ValueTest (line 22) | class ValueTest(unittest.TestCase):
    method __init__ (line 23) | def __init__(self, *args, **kwargs):
    method compareWord32 (line 31) | def compareWord32(self, value, offset, expected):
    method testGet (line 44) | def testGet(self):
    method testGetBinary (line 104) | def testGetBinary(self):
    method testGetSelection (line 170) | def testGetSelection(self):
    method testGetSelectionBinary (line 251) | def testGetSelectionBinary(self):
    method testGetSelectionBadQuery (line 345) | def testGetSelectionBadQuery(self):
    method testGetScalar (line 385) | def testGetScalar(self):
    method testGetNullSpace (line 399) | def testGetNullSpace(self):
    method testGetScalarString (line 414) | def testGetScalarString(self):
    method testGetScalarStringBinary (line 428) | def testGetScalarStringBinary(self):
    method testGetSimpleOneElement (line 444) | def testGetSimpleOneElement(self):
    method testGetSimpleOneElementString (line 458) | def testGetSimpleOneElementString(self):
    method testGetCompound (line 472) | def testGetCompound(self):
    method testGetCompoundBinary (line 502) | def testGetCompoundBinary(self):
    method testGetCommitted (line 532) | def testGetCommitted(self):
    method testGetArray (line 546) | def testGetArray(self):
    method testGetVLenString (line 563) | def testGetVLenString(self):
    method testGetFixedString (line 580) | def testGetFixedString(self):
    method testGetFixedStringBinary (line 599) | def testGetFixedStringBinary(self):
    method testGetEnum (line 613) | def testGetEnum(self):
    method testGetVlen (line 628) | def testGetVlen(self):
    method testGetOpaque (line 644) | def testGetOpaque(self):
    method testGetObjectReference (line 655) | def testGetObjectReference(self):
    method testGetNullObjReference (line 674) | def testGetNullObjReference(self):
    method testGetRegionReference (line 689) | def testGetRegionReference(self):
    method testGetFillValue (line 727) | def testGetFillValue(self):
    method testQuery (line 764) | def testQuery(self):
    method testQueries (line 804) | def testQueries(self):
    method testQuerySelection (line 833) | def testQuerySelection(self):
    method testQueryBatch (line 856) | def testQueryBatch(self):
    method testBadQuery (line 891) | def testBadQuery(self):
    method testPost (line 908) | def testPost(self):
    method testPut (line 948) | def testPut(self):
    method testPutBinary (line 1062) | def testPutBinary(self):
    method testPutSelection (line 1161) | def testPutSelection(self):
    method testPutSelectionValueMismatch (line 1201) | def testPutSelectionValueMismatch(self):
    method testPutSelectionBinaryValueMismatch (line 1246) | def testPutSelectionBinaryValueMismatch(self):
    method testPutSelectionBinary (line 1307) | def testPutSelectionBinary(self):
    method testPutPointSelection (line 1353) | def testPutPointSelection(self):
    method testPutPointSelectionBinary (line 1388) | def testPutPointSelectionBinary(self):
    method testPutCompound (line 1429) | def testPutCompound(self):
    method testPutObjectReference (line 1543) | def testPutObjectReference(self):
    method testPutRegionReference (line 1562) | def testPutRegionReference(self):

FILE: test/unit/fileUtilTest.py
  class FileUtilTest (line 20) | class FileUtilTest(unittest.TestCase):
    method __init__ (line 21) | def __init__(self, *args, **kwargs):
    method testPosixPath (line 25) | def testPosixPath(self):
    method testJoin (line 33) | def testJoin(self):
    method testDomaintoFilePath (line 42) | def testDomaintoFilePath(self):
    method testGetDomain (line 56) | def testGetDomain(self):

FILE: test/unit/timeUtilTest.py
  class TimeUtilTest (line 19) | class TimeUtilTest(unittest.TestCase):
    method __init__ (line 20) | def __init__(self, *args, **kwargs):
    method testConvertUnixTimetoUTC (line 24) | def testConvertUnixTimetoUTC(self):

FILE: util/admin/add_user.py
  function encrypt_pwd (line 13) | def encrypt_pwd(passwd):
  function print_time (line 18) | def print_time(timestamp):
  function generate_temp_password (line 22) | def generate_temp_password(length=6):
  function main (line 29) | def main():

FILE: util/admin/config.py
  function get (line 25) | def get(x):

FILE: util/admin/getacl.py
  function printUsage (line 24) | def printUsage():
  function getNextArg (line 40) | def getNextArg(argn):
  function main (line 46) | def main():

FILE: util/admin/import_file.py
  function makeDirs (line 16) | def makeDirs(filePath):
  function getUserId (line 32) | def getUserId(user_name, password_file):
  function getSubgroupId (line 58) | def getSubgroupId(db, group_uuid, link_name):
  function addTocEntry (line 78) | def addTocEntry(toc_file, domain, base_domain):
  function main (line 118) | def main():

FILE: util/admin/remove_db.py
  function main (line 8) | def main():

FILE: util/admin/setacl.py
  function printUsage (line 24) | def printUsage():
  function getNextArg (line 41) | def getNextArg(argn):
  function main (line 48) | def main():

FILE: util/admin/update_pwd.py
  function encrypt_pwd (line 12) | def encrypt_pwd(passwd):
  function print_time (line 17) | def print_time(timestamp):
  function main (line 21) | def main():

FILE: util/dumpobjdb.py
  function dumpAttr (line 15) | def dumpAttr(col):
  function dumpCol (line 25) | def dumpCol(col):
  function dumpFile (line 37) | def dumpFile(filePath):
  function main (line 56) | def main():

FILE: util/exporth5.py
  class Dumph5 (line 31) | class Dumph5:
    method __init__ (line 32) | def __init__(self):
    method makeRequest (line 41) | def makeRequest(self, uri):
    method createLink (line 67) | def createLink(self, link_obj, parent_uuid):
    method createDataset (line 86) | def createDataset(self, uuid):
    method createDatasets (line 134) | def createDatasets(self):
    method createAttribute (line 142) | def createAttribute(self, attr_name, col_name, uuid):
    method createDatatype (line 166) | def createDatatype(self, uuid):
    method createDatatypes (line 175) | def createDatatypes(self):
    method createGroup (line 186) | def createGroup(self, uuid):
    method createGroups (line 195) | def createGroups(self):
    method createObjects (line 206) | def createObjects(self):
    method createAttributes (line 223) | def createAttributes(self):
    method createLinks (line 251) | def createLinks(self):
    method writeFile (line 259) | def writeFile(self, db):
  function printUsage (line 275) | def printUsage():
  function main (line 288) | def main():

FILE: util/exportjson.py
  class DumpJson (line 21) | class DumpJson:
    method __init__ (line 22) | def __init__(self):
    method makeRequest (line 29) | def makeRequest(self, uri):
    method dumpAttribute (line 52) | def dumpAttribute(self, obj_uri):
    method dumpAttributes (line 62) | def dumpAttributes(self, uri, jsonOut):
    method dumpLinks (line 82) | def dumpLinks(self, uri, jsonOut):
    method dumpGroup (line 90) | def dumpGroup(self, uri, jsonOut):
    method dumpGroups (line 97) | def dumpGroups(self):
    method dumpDataset (line 110) | def dumpDataset(self, uri, jsonOut):
    method dumpDatasets (line 131) | def dumpDatasets(self):
    method dumpDatatype (line 143) | def dumpDatatype(self, uri, jsonOut):
    method dumpDatatypes (line 155) | def dumpDatatypes(self):
    method dumpDomain (line 168) | def dumpDomain(self):
  function printUsage (line 187) | def printUsage():
  function main (line 205) | def main():
Condensed preview — 208 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (913K chars).
[
  {
    "path": ".gitignore",
    "chars": 102,
    "preview": ".DS_Store\n*.pyc\ndata/*.h5\ndata/*.db\ntest/unit/*.h5\ntest/unit/*.db\n\n# jetbrains IDE stuff\n.idea\n*.iml\n\n"
  },
  {
    "path": ".gitmodules",
    "chars": 133,
    "preview": "[submodule \"hdf5-json\"]\n\tpath = hdf5-json\n\turl = https://github.com/HDFGroup/hdf5-json.git\n[submodules \"hdf5-json\"]\n\tbra"
  },
  {
    "path": ".travis.yml",
    "chars": 734,
    "preview": "language: python\n\nnotifications:\n  email: false\n\npython:\n  - \"2.7\"\n  - \"3.4\"\n  - \"3.5\"\n  - \"3.6\"\n  - \"3.7\"\n  - \"3.8\"\n\n\ni"
  },
  {
    "path": "COPYING",
    "chars": 1815,
    "preview": "\nCopyright Notice and License Terms for \nh5serv Software Service, Libraries and Utilities\n------------------------------"
  },
  {
    "path": "Dockerfile",
    "chars": 1308,
    "preview": "FROM python:3.6\nMAINTAINER John Readey <jreadey@hdfgroup.org>\nRUN cd /usr/local/src                                    ;"
  },
  {
    "path": "README.rst",
    "chars": 3572,
    "preview": "h5serv - REST-based service for HDF5 data\n===========================================\n\n.. image:: https://travis-ci.org/"
  },
  {
    "path": "data/readme.txt",
    "chars": 74,
    "preview": "This is the default location for HDF5 data files to be visible in h5serv.\n"
  },
  {
    "path": "docs/AclOps/GET_ACL.rst",
    "chars": 4187,
    "preview": "**********************************************\nGET ACL\n**********************************************\n\nDescription\n====="
  },
  {
    "path": "docs/AclOps/GET_ACLs.rst",
    "chars": 4601,
    "preview": "**********************************************\nGET ACLs\n**********************************************\n\nDescription\n===="
  },
  {
    "path": "docs/AclOps/PUT_ACL.rst",
    "chars": 3793,
    "preview": "**********************************************\nPUT ACL\n**********************************************\n\nDescription\n====="
  },
  {
    "path": "docs/AclOps/index.rst",
    "chars": 4933,
    "preview": "####################\nAccess Control List\n####################\n\nAccess Control List (ACL) are key-value stores that can b"
  },
  {
    "path": "docs/AdminTools.rst",
    "chars": 3614,
    "preview": "###################\nAdmin Tools\n###################\n\nThe scripts described here are intended to be run on the server by "
  },
  {
    "path": "docs/AttrOps/DELETE_Attribute.rst",
    "chars": 2695,
    "preview": "**********************************************\nDELETE Attribute\n**********************************************\n\nDescript"
  },
  {
    "path": "docs/AttrOps/GET_Attribute.rst",
    "chars": 4265,
    "preview": "**********************************************\nGET Attribute\n**********************************************\n\nDescription"
  },
  {
    "path": "docs/AttrOps/GET_Attributes.rst",
    "chars": 7216,
    "preview": "**********************************************\nGET Attributes\n**********************************************\n\nDescriptio"
  },
  {
    "path": "docs/AttrOps/PUT_Attribute.rst",
    "chars": 7384,
    "preview": "**********************************************\nPUT Attribute\n**********************************************\n\nDescription"
  },
  {
    "path": "docs/AttrOps/index.rst",
    "chars": 1424,
    "preview": "########################\nAttributes\n########################\n\nLike datasets (see :doc:`../DatasetOps/index`), attributes"
  },
  {
    "path": "docs/Authorization.rst",
    "chars": 2474,
    "preview": "*********************************\nAuthorization and Authentication\n*********************************\n\nRequest Authentica"
  },
  {
    "path": "docs/CommonErrorResponses.rst",
    "chars": 1563,
    "preview": "***************************\nCommon Error Responses\n***************************\n\nFor each request, h5serv returns a stand"
  },
  {
    "path": "docs/CommonRequestHeaders.rst",
    "chars": 989,
    "preview": "***********************\nCommon Request Headers\n***********************\n\nThe following describe common HTTP request heade"
  },
  {
    "path": "docs/CommonResponseHeaders.rst",
    "chars": 778,
    "preview": "***************************\nCommon Response Headers\n***************************\n\nThe following describes some of the com"
  },
  {
    "path": "docs/DatasetOps/DELETE_Dataset.rst",
    "chars": 2443,
    "preview": "**********************************************\nDELETE Dataset\n**********************************************\n\nDescriptio"
  },
  {
    "path": "docs/DatasetOps/GET_Dataset.rst",
    "chars": 4086,
    "preview": "**********************************************\nGET Dataset\n**********************************************\n\nDescription\n="
  },
  {
    "path": "docs/DatasetOps/GET_DatasetShape.rst",
    "chars": 5115,
    "preview": "**********************************************\nGET Shape\n**********************************************\n\nDescription\n==="
  },
  {
    "path": "docs/DatasetOps/GET_DatasetType.rst",
    "chars": 5320,
    "preview": "**********************************************\nGET Type\n**********************************************\n\nDescription\n===="
  },
  {
    "path": "docs/DatasetOps/GET_Datasets.rst",
    "chars": 4097,
    "preview": "**********************************************\nGET Datasets\n**********************************************\n\nDescription\n"
  },
  {
    "path": "docs/DatasetOps/GET_Value.rst",
    "chars": 9785,
    "preview": "**********************************************\nGET Value\n**********************************************\n\nDescription\n==="
  },
  {
    "path": "docs/DatasetOps/POST_Dataset.rst",
    "chars": 11647,
    "preview": "**********************************************\nPOST Dataset\n**********************************************\n\nDescription\n"
  },
  {
    "path": "docs/DatasetOps/POST_Value.rst",
    "chars": 2553,
    "preview": "**********************************************\nPOST Value\n**********************************************\n\nDescription\n=="
  },
  {
    "path": "docs/DatasetOps/PUT_DatasetShape.rst",
    "chars": 2877,
    "preview": "**********************************************\nPUT Shape\n**********************************************\n\nDescription\n==="
  },
  {
    "path": "docs/DatasetOps/PUT_Value.rst",
    "chars": 5311,
    "preview": "**********************************************\nPUT Value\n**********************************************\n\nDescription\n==="
  },
  {
    "path": "docs/DatasetOps/index.rst",
    "chars": 3480,
    "preview": "######################\nDatasets\n######################\n\nDatasets are objects that a composed of a homogenous collection "
  },
  {
    "path": "docs/DatatypeOps/DELETE_Datatype.rst",
    "chars": 2455,
    "preview": "**********************************************\nDELETE Datatype\n**********************************************\n\nDescripti"
  },
  {
    "path": "docs/DatatypeOps/GET_Datatype.rst",
    "chars": 3265,
    "preview": "**********************************************\nGET Datatype\n**********************************************\n\nDescription\n"
  },
  {
    "path": "docs/DatatypeOps/GET_Datatypes.rst",
    "chars": 4033,
    "preview": "**********************************************\nGET Datatypes\n**********************************************\n\nDescription"
  },
  {
    "path": "docs/DatatypeOps/POST_Datatype.rst",
    "chars": 5185,
    "preview": "**********************************************\nPOST Datatype\n**********************************************\n\nDescription"
  },
  {
    "path": "docs/DatatypeOps/index.rst",
    "chars": 1258,
    "preview": "#######################\nCommitted Datatypes\n#######################\n\nCommitted datatypes (also know as \"named types\"), a"
  },
  {
    "path": "docs/Diagram.rst",
    "chars": 171,
    "preview": "***************************\nDiagram of REST operations\n***************************\n\n \n.. image:: RESTful_HDF5.png\n   :wi"
  },
  {
    "path": "docs/DomainOps/DELETE_Domain.rst",
    "chars": 1698,
    "preview": "**********************************************\nDELETE Domain\n**********************************************\n\nDescription"
  },
  {
    "path": "docs/DomainOps/GET_Domain.rst",
    "chars": 3389,
    "preview": "**********************************************\nGET Domain\n**********************************************\n\nDescription\n=="
  },
  {
    "path": "docs/DomainOps/PUT_Domain.rst",
    "chars": 3015,
    "preview": "**********************************************\nPUT Domain\n**********************************************\n\nDescription\n=="
  },
  {
    "path": "docs/DomainOps/index.rst",
    "chars": 2524,
    "preview": "#######################\nDomains\n#######################\n\nIn h5serv, domains are containers for related collection of res"
  },
  {
    "path": "docs/FAQ/index.rst",
    "chars": 4093,
    "preview": "###################\nFAQ\n###################\n\n\nWhat datatypes are supported?\n-----------------------------\n\n============="
  },
  {
    "path": "docs/GroupOps/DELETE_Group.rst",
    "chars": 2454,
    "preview": "**********************************************\nDELETE Group\n**********************************************\n\nDescription\n"
  },
  {
    "path": "docs/GroupOps/DELETE_Link.rst",
    "chars": 2660,
    "preview": "**********************************************\nDELETE Link\n**********************************************\n\nDescription\n="
  },
  {
    "path": "docs/GroupOps/GET_Group.rst",
    "chars": 3235,
    "preview": "**********************************************\nGET Group\n**********************************************\n\nDescription\n==="
  },
  {
    "path": "docs/GroupOps/GET_Groups.rst",
    "chars": 4316,
    "preview": "**********************************************\nGET Groups\n**********************************************\n\nDescription\n=="
  },
  {
    "path": "docs/GroupOps/GET_Link.rst",
    "chars": 8514,
    "preview": "**********************************************\nGET Link\n**********************************************\n\nDescription\n===="
  },
  {
    "path": "docs/GroupOps/GET_Links.rst",
    "chars": 4908,
    "preview": "**********************************************\nGET Links\n**********************************************\n\nDescription\n==="
  },
  {
    "path": "docs/GroupOps/POST_Group.rst",
    "chars": 5705,
    "preview": "**********************************************\nPOST Group\n**********************************************\n\nDescription\n=="
  },
  {
    "path": "docs/GroupOps/PUT_Link.rst",
    "chars": 6227,
    "preview": "**********************************************\nPUT Link\n**********************************************\n\nDescription\n===="
  },
  {
    "path": "docs/GroupOps/index.rst",
    "chars": 2142,
    "preview": "####################\nGroups\n####################\n\nGroups are objects that can be used to organize objects within a domai"
  },
  {
    "path": "docs/Hypermedia.rst",
    "chars": 2087,
    "preview": "*************************\nHypermedia\n*************************\n\nh5serv supports the REST convention of **HATEOAS** or *H"
  },
  {
    "path": "docs/Installation/ServerSetup.rst",
    "chars": 9629,
    "preview": "###################\nInstalling h5serv\n###################\n\nYou should find h5serv quite easy to setup.  The server (base"
  },
  {
    "path": "docs/Installation/index.rst",
    "chars": 100,
    "preview": "###################\nInstallation \n###################\n\n.. toctree::\n   :maxdepth: 2\n\n   ServerSetup\n"
  },
  {
    "path": "docs/Introduction/index.rst",
    "chars": 452,
    "preview": "###################\nIntroduction\n###################\n\nh5serv is a web service that can be used to send and receive HDF5 "
  },
  {
    "path": "docs/License/index.rst",
    "chars": 1886,
    "preview": "#######################\nLicense and Legal Info\n#######################\n \nCopyright Notice and License Terms for h5serv S"
  },
  {
    "path": "docs/Makefile",
    "chars": 6762,
    "preview": "# Makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHINXBUILD "
  },
  {
    "path": "docs/Reference.rst",
    "chars": 236,
    "preview": "###################\nReference\n###################\n\n.. toctree::\n   :maxdepth: 2\n\n   Authorization\n   CommonRequestHeader"
  },
  {
    "path": "docs/Resources.rst",
    "chars": 2946,
    "preview": "**************\nResource List\n**************\n\nList of Resources\n=================\n\n+----------------+------+------+------"
  },
  {
    "path": "docs/Tutorials/IPython_samples.rst",
    "chars": 78,
    "preview": "###################\nSamples \n###################\nTBD: Some walkthroughs here.\n"
  },
  {
    "path": "docs/Tutorials/index.rst",
    "chars": 101,
    "preview": "###################\nTutorials \n###################\n\n.. toctree::\n   :maxdepth: 2\n\n   IPython_samples\n"
  },
  {
    "path": "docs/Types/index.rst",
    "chars": 12370,
    "preview": "####################\nTypes\n####################\n\nThe h5serv REST API supports the rich type capabilities provided by HDF"
  },
  {
    "path": "docs/UsingIteration.rst",
    "chars": 1743,
    "preview": "***************\nUsing Iteration\n***************\n\nThere are some operations that may return an arbitrary large list of re"
  },
  {
    "path": "docs/Utilities.rst",
    "chars": 2815,
    "preview": "###################\nUtilities\n###################\n\nThe h5serv distribution includes the following utility scripts.  Thes"
  },
  {
    "path": "docs/WhatsNew/index.rst",
    "chars": 808,
    "preview": "###################\nWhat's New \n###################\n\n\nh5serv 1.1\n-----------\nSignificant features:\n  * Support was added"
  },
  {
    "path": "docs/_static/README",
    "chars": 13,
    "preview": "static files\n"
  },
  {
    "path": "docs/build.sh",
    "chars": 30,
    "preview": "sphinx-build -b html . _build\n"
  },
  {
    "path": "docs/conf.py",
    "chars": 8382,
    "preview": "# -*- coding: utf-8 -*-\n#\n# h5serv documentation build configuration file, created by\n# sphinx-quickstart on Mon Nov  3 "
  },
  {
    "path": "docs/index.rst",
    "chars": 780,
    "preview": ".. h5serv documentation master file, created by\n   sphinx-quickstart on Fri Oct 24 14:51:58 2014.\n   You can adapt this "
  },
  {
    "path": "docs/make.bat",
    "chars": 6701,
    "preview": "@ECHO OFF\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sphinx-build\r\n)\r\n"
  },
  {
    "path": "entrypoint.sh",
    "chars": 113,
    "preview": "#!/bin/bash\n# entrypoint for Docker container\ncd /usr/local/src/h5serv\npython h5serv --datapath=/data --log_file="
  },
  {
    "path": "examples/h5pyd_ex1.ipynb",
    "chars": 3029,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \""
  },
  {
    "path": "examples/h5pyd_ex2.ipynb",
    "chars": 64290,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 18,\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"ou"
  },
  {
    "path": "examples/nodejs/gettoc.js",
    "chars": 520,
    "preview": "var http = require('http');\nvar options = {\n  host: 'data.hdfgroup.org',\n  port: 7253,\n  path: '/'\n};\nvar callback = fun"
  },
  {
    "path": "examples/pi_compute.ipynb",
    "chars": 3857,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 13,\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"ou"
  },
  {
    "path": "examples/rest_ex1.ipynb",
    "chars": 4990,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": 3,\n   \"metadata\": {\n    \"collapsed\": false\n   },\n   \"out"
  },
  {
    "path": "h5serv/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "h5serv/__main__.py",
    "chars": 183,
    "preview": "if __name__ == '__main__':\n    import os\n    import sys\n    sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.a"
  },
  {
    "path": "h5serv/app.py",
    "chars": 125005,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "h5serv/authFile.py",
    "chars": 6076,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "h5serv/authMongo.py",
    "chars": 5582,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "h5serv/config.py",
    "chars": 2950,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "h5serv/fileUtil.py",
    "chars": 10331,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "h5serv/h5watchdog.py",
    "chars": 1880,
    "preview": "import sys\nimport time\nimport os.path as op\nimport logging\n\nfrom watchdog.observers import Observer\nfrom watchdog.events"
  },
  {
    "path": "h5serv/httpErrorUtil.py",
    "chars": 813,
    "preview": "import errno\n\n\ndef errNoToHttpStatus(error_code):\n    \"\"\"Convert IOError error numbers to HTTP equivalent status codes.\""
  },
  {
    "path": "h5serv/passwordUtil.py",
    "chars": 2100,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "h5serv/timeUtil.py",
    "chars": 539,
    "preview": "from datetime import datetime\nimport pytz\n\n\ndef unixTimeToUTC(timestamp):\n    \"\"\"Convert unix timestamp (seconds since J"
  },
  {
    "path": "h5serv/tocUtil.py",
    "chars": 11512,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "setup.py",
    "chars": 4315,
    "preview": "\"\"\"A setuptools based setup module for h5serv.\n\nSee:\nhttps://packaging.python.org/en/latest/distributing.html\nhttps://gi"
  },
  {
    "path": "test/aws/config.py",
    "chars": 1053,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/aws/roottest.py",
    "chars": 2040,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/acltest.py",
    "chars": 21139,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/attributetest.py",
    "chars": 42986,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/config.py",
    "chars": 1090,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/datasettest.py",
    "chars": 74416,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/datasettypetest.py",
    "chars": 3743,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/datatypetest.py",
    "chars": 11901,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/dirtest.py",
    "chars": 18888,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/grouptest.py",
    "chars": 11232,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/helper.py",
    "chars": 6170,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/linktest.py",
    "chars": 21331,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/makeattr.py",
    "chars": 1034,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/makegroups.py",
    "chars": 1008,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/roottest.py",
    "chars": 9548,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/setupdata.py",
    "chars": 10184,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/shapetest.py",
    "chars": 10361,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/spidertest.py",
    "chars": 2987,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/integ/valuetest.py",
    "chars": 68526,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/test_files/notahdf5file.h5",
    "chars": 26,
    "preview": "This is not an HDF5 file!\n"
  },
  {
    "path": "test/testall.py",
    "chars": 2820,
    "preview": "#!/usr/local/env python\n\n##############################################################################\n# Copyright by T"
  },
  {
    "path": "test/unit/config.py",
    "chars": 1059,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/unit/fileUtilTest.py",
    "chars": 4188,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "test/unit/timeUtilTest.py",
    "chars": 1525,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "util/admin/add_user.py",
    "chars": 3464,
    "preview": "import h5py\nimport numpy as np\nimport sys\nimport argparse\nimport os.path as op\nimport os\nimport time\nimport datetime\nimp"
  },
  {
    "path": "util/admin/config.py",
    "chars": 1603,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "util/admin/getacl.py",
    "chars": 4147,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "util/admin/import_file.py",
    "chars": 6528,
    "preview": "import h5py\nimport numpy as np\nimport sys\nimport argparse\nimport os.path as op\nimport os\nimport shutil\nfrom tornado.esca"
  },
  {
    "path": "util/admin/makepwd_file.py",
    "chars": 408,
    "preview": "import h5py\nimport numpy as np\n\nfile_name = 'passwd.h5'\nf = h5py.File(file_name, 'x')\nfields = []\nfields.append(('pwd', "
  },
  {
    "path": "util/admin/remove_db.py",
    "chars": 545,
    "preview": "import h5py\nimport sys\n \n            \n\"\"\"\nmain method\n\"\"\"\ndef main():\n    if len(sys.argv) < 2 or sys.argv[1] in (\"-h\", "
  },
  {
    "path": "util/admin/setacl.py",
    "chars": 5106,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "util/admin/update_pwd.py",
    "chars": 4904,
    "preview": "import h5py\nimport numpy as np\nimport sys\nimport argparse\nimport os.path as op\nimport os\nimport time\nimport datetime\nimp"
  },
  {
    "path": "util/dumpobjdb.py",
    "chars": 2173,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "util/dumptojson.sh",
    "chars": 114,
    "preview": "for f in testfiles/*.h5\ndo\n  echo \"$f\"\n  s=${f##*/}\n  b=${s%.h5}\n  python h5tojson.py $f  >json_dump/$b.json\ndone\n"
  },
  {
    "path": "util/exporth5.py",
    "chars": 12260,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "util/exportjson.py",
    "chars": 8248,
    "preview": "##############################################################################\n# Copyright by The HDF Group.            "
  },
  {
    "path": "util/rebuildIndex.py",
    "chars": 1029,
    "preview": "import sys\nimport h5py\nimport logging\nfrom h5json import Hdf5db\n\n\ndbname = \"__db__\"\nif len(sys.argv) < 2 or sys.argv[1] "
  }
]

// ... and 81 more files (download for full content)

About this extraction

This page contains the full source code of the HDFGroup/h5serv GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 208 files (851.0 KB), approximately 246.3k tokens, and a symbol index with 465 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!