Skip to content
master
Switch branches/tags
Code
This branch is 2 commits ahead, 1 commit behind friedrichknuth:master.
Contribute

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

OOI Machine to Machine (M2M) Demo

Basic instructions for using the OOI M2M Web Services. See ipython notebooks for examples using python's requests module.

Getting Started

  • Create a user account on ooinet.oceanobservatories.org or use the CILogon button with an academic or Google account.
  • Log in
  • Navigate to the drop down menu screen in the top-right corner menu
  • Click on the "User Profile" element of the drop down.
  • Copy and save the following data from the user profile: API Username and API Token. The API Username is similar to “OOIAPI-QTULEV9STCAS55”. The API Token is similar to “YXP2Q2W4SOP”.

Tools to access OOI M2M Web Services

python requests

requests.get('https://ooinet.oceanobservatories.org/api/m2m/...', auth=(API USERNAME, API TOKEN))

curl

curl –k https://API USERNAME:API TOKEN@ooinet.oceanobservatories.org/api/m2m/...

httpie

http --auth API USERNAME:API TOKEN https://ooinet.oceanobservatories.org/api/m2m/...

Running the Notebooks

  • create a python virtual environment and start the notebook from inside
conda create -n m2m_demo python=2.7 anaconda

source activate m2m_demo

pip install xarray==0.9.0

pip install netcdf-python

pip install thredds-crawler

jupyter notebook

source deactivate

(The latest xarray gives an error, seems a known issue which was fixed in future versions, but for now downgrading to 0.9.0 https://github.com/pydata/xarray/issues/1775)

Additional Resources

Example Applications Built on Top of M2M Web Services

About

Basic OOI M2M API examples.

Resources

Releases

No releases published

Packages

No packages published