Skip to content

Latest commit

 

History

History
165 lines (130 loc) · 9.59 KB

README.md

File metadata and controls

165 lines (130 loc) · 9.59 KB

CBRAIN Python API Client

API for interacting with the CBRAIN Platform

This Python package is automatically generated by the Swagger Codegen project:

For more information, please visit https://github.com/aces/cbrain

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/aces/cbrain-python-client.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/aces/cbrain-python-client.git)

Then import the package:

import cbrain_api 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import cbrain_api

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import cbrain_api
from cbrain_api.rest import ApiException
from pprint import pprint

# Configure API key authorization: BrainPortalSession
configuration = cbrain_api.Configuration()
configuration.api_key['cbrain_api_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cbrain_api_token'] = 'Bearer'

# create an instance of the API class
api_instance = cbrain_api.BourreauxApi(cbrain_api.ApiClient(configuration))
page = 56 # int | Page number when paginating. See also the per_page parameter (optional)
per_page = 56 # int | Size of each page when paginating. See also the page parameter (optional)

try:
    # Get a list of the Bourreaux available to be used by the current user.
    api_response = api_instance.bourreaux_get(page=page, per_page=per_page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BourreauxApi->bourreaux_get: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://localhost:3000

Class Method HTTP request Description
BourreauxApi bourreaux_get GET /bourreaux Get a list of the Bourreaux available to be used by the current user.
BourreauxApi bourreaux_id_get GET /bourreaux/{id} Get information about a Bourreau.
DataProvidersApi data_providers_get GET /data_providers Get a list of the Data Providers available to the current user.
DataProvidersApi data_providers_id_browse_get GET /data_providers/{id}/browse List the files on a Data Provider.
DataProvidersApi data_providers_id_delete_post POST /data_providers/{id}/delete Deletes unregistered files from a CBRAIN Data provider.
DataProvidersApi data_providers_id_get GET /data_providers/{id} Get information on a particular Data Provider.
DataProvidersApi data_providers_id_is_alive_get GET /data_providers/{id}/is_alive Pings a Data Provider to check if it is running.
DataProvidersApi data_providers_id_register_post POST /data_providers/{id}/register Registers a file as a Userfile in CBRAIN.
DataProvidersApi data_providers_id_unregister_post POST /data_providers/{id}/unregister Unregisters files as Userfile in CBRAIN.
GroupsApi groups_get GET /groups Get a list of the Groups (projects) available to the current user.
GroupsApi groups_id_delete DELETE /groups/{id} Deletes a Group (project).
GroupsApi groups_id_get GET /groups/{id} Get information on a Group (project).
GroupsApi groups_id_put PUT /groups/{id} Update the properties of a Group (project).
GroupsApi groups_post POST /groups Creates a new Group.
SessionsApi session_delete DELETE /session Destroy the current session
SessionsApi session_get GET /session Get session information
SessionsApi session_post POST /session Create a new session
TagsApi tags_get GET /tags Get a list of the tags currently in CBRAIN.
TagsApi tags_id_delete DELETE /tags/{id} Delete a tag.
TagsApi tags_id_get GET /tags/{id} Get one tag.
TagsApi tags_id_put PUT /tags/{id} Update a tag.
TagsApi tags_post POST /tags Create a new tag.
TasksApi tasks_get GET /tasks Get the list of Tasks.
TasksApi tasks_id_get GET /tasks/{id} Get information on a Task.
TasksApi tasks_post POST /tasks Create a new Task.
ToolConfigsApi tool_configs_get GET /tool_configs Get a list of tool versions installed.
ToolConfigsApi tool_configs_id_get GET /tool_configs/{id} Get information about a particular tool configuration
ToolsApi tools_get GET /tools Get the list of Tools.
UserfilesApi userfiles_change_provider_post POST /userfiles/change_provider Moves the Userfiles from their current Data Provider to a new one.
UserfilesApi userfiles_compress_post POST /userfiles/compress Compresses many Userfiles each into their own GZIP archive.
UserfilesApi userfiles_delete_files_delete DELETE /userfiles/delete_files Delete several files that have been registered as Userfiles
UserfilesApi userfiles_download_post POST /userfiles/download Download several files
UserfilesApi userfiles_get GET /userfiles List of the Userfiles accessible to the current user.
UserfilesApi userfiles_id_content_get GET /userfiles/{id}/content Get the content of a Userfile
UserfilesApi userfiles_id_get GET /userfiles/{id} Get information on a Userfile.
UserfilesApi userfiles_id_put PUT /userfiles/{id} Update information on a Userfile.
UserfilesApi userfiles_post POST /userfiles Creates a new Userfile and upload its content.
UserfilesApi userfiles_sync_multiple_post POST /userfiles/sync_multiple Syncs Userfiles to the local Data Providers cache.
UserfilesApi userfiles_uncompress_post POST /userfiles/uncompress Uncompresses many Userfiles.
UsersApi users_get GET /users Returns all of the users in CBRAIN. Only available to admins.
UsersApi users_id_delete DELETE /users/{id} Deletes a CBRAIN user
UsersApi users_id_get GET /users/{id} Returns information about a user
UsersApi users_id_patch PATCH /users/{id} Update information about a user
UsersApi users_post POST /users Create a new user in CBRAIN. Only available to admins.

Documentation For Models

Documentation For Authorization

BrainPortalSession

  • Type: API key
  • API key parameter name: cbrain_api_token
  • Location: URL query string

Author

The CBRAIN team