Skip to content

onedata/oneprovider-swagger

Folders and files

NameName
Last commit message
Last commit date
Jul 3, 2020
Jul 3, 2020
Jun 4, 2020
Jun 30, 2020
Oct 24, 2016
Jul 16, 2019
Jul 3, 2020
Jun 15, 2016
Jul 3, 2020
Feb 7, 2017
Oct 16, 2016
Mar 5, 2020
Jun 15, 2016
May 29, 2020
Jun 4, 2020
Sep 21, 2016
May 30, 2016
Mar 5, 2020
Aug 3, 2016
Apr 21, 2017

Repository files navigation

Oneprovider REST API defined using Swagger (http://swagger.io)

This repo contains Swagger specification of Oneprovider REST API.

Oneprovider is part of Onedata, a distributed data management platform. Oneproviders manages local storage resources at a single site, communicates with other Oneprovider instance in other sites and provides the users transparent access to their distributed data.

For more details about Oneprovider service please check (http://github.com/onedata/oneprovider).

Compiling (Using Onedata docker repository):

./build.sh

Compiling from scratch:

# Install Node.js dependencies
npm install

# Aggregate Yaml specification files into a single swagger.json file
node resolve.js > swagger.json

After any of these steps you should have a complete swagger.json file, with specification of Oneprovider REST API. The file can be used by Swagger code generator to produce example code for clients in various languages or viewed online using for instance Swagger Online Editor.

Using generated Bash client

Below are command line examples for generated bash client.

export ONEPROVIDER_HOST=https://PROVIDER_IP:8443
export ONEPROVIDER_BASIC_AUTH="username:password"

./oneprovider-rest-cli -h

./oneprovider-rest-cli getAllSpaces -h

./oneprovider-rest-cli getAllSpaces


./oneprovider-rest-cli getFileAttributes path="/OxfordFlowerDataset/FlowerSet1/image_0800.jpg" attribute=mode


./oneprovider-rest-cli getFileAttributes path="/OxfordFlowerDataset/FlowerSet1/image_0800.jpg" attribute=license extended=true


./oneprovider-rest-cli getFileMetadata -ac json path="/OxfordFlowerDataset/FlowerSet1/image_0800.jpg"


./oneprovider-rest-cli listFiles path="/OxfordFlowerDataset"

./oneprovider-rest-cli listFiles path="/OxfordFlowerDataset/FlowerSet1/image_0800.jpg"

./oneprovider-rest-cli -ac json getFileMetadataById id=0000000000917733836803640004677569646D0000005254576F796132686E575530775331424F516B5534646B5A4963565678644545795746684F616E646B5157466A615531484D565A33516E42785A794D6A6E7A69434565634B2D494A4679387770456E6E3850776D0000002B6136552D334675766A6A6C465A7251576D7639584256304E454448594A615A4C4D6132725A566F704F746B

echo '{"name":"Flower2","genus":"Astragalus"}' | ./oneprovider-rest-cli -ct json setFileMetadata path="/OxfordFlowerDataset/FlowerSet1/image_0801.jpg -"

./oneprovider-rest-cli getAllTransfers

./oneprovider-rest-cli getFileReplicas path="/OxfordFlowerDataset/FlowerSet1/image_0800.jpg"