cbrain_api v4.5.1
cbrain_api
CbrainApi - JavaScript client for cbrain_api Interface to control CBRAIN operations This SDK is automatically generated by the Swagger Codegen project:
- API version: 4.5.1
- Package version: 4.5.1
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install cbrain_api --save
git
If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
For browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Getting Started
Please follow the installation instruction and execute the following JS code:
var CbrainApi = require('cbrain_api');
var defaultClient = CbrainApi.ApiClient.instance;
// Configure API key authorization: BrainPortalSession
var BrainPortalSession = defaultClient.authentications['BrainPortalSession'];
BrainPortalSession.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//BrainPortalSession.apiKeyPrefix['BrainPortalSession'] = "Token"
var api = new CbrainApi.BourreauApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.bourreauxGet(callback);
Documentation for API Endpoints
All URIs are relative to https://portal.cbrain.mcgill.ca
Class | Method | HTTP request | Description |
---|---|---|---|
CbrainApi.BourreauApi | bourreauxGet | GET /bourreaux | Get a list of the Bourreaux available to be used by the current user. |
CbrainApi.BourreauApi | bourreauxIdGet | GET /bourreaux/{id} | Get information about a Bourreau. |
CbrainApi.DataProvidersApi | dataProvidersGet | GET /data_providers | Get a list of the Data Providers available to the current user. |
CbrainApi.DataProvidersApi | dataProvidersIdBrowseGet | GET /data_providers/{id}/browse | List the files on a Data Provider. |
CbrainApi.DataProvidersApi | dataProvidersIdDeletePost | POST /data_providers/{id}/delete | Deletes unregistered files from a CBRAIN Data provider. |
CbrainApi.DataProvidersApi | dataProvidersIdGet | GET /data_providers/{id} | Get information on a particular Data Provider. |
CbrainApi.DataProvidersApi | dataProvidersIdIsAliveGet | GET /data_providers/{id}/is_alive | Pings a Data Provider to check if it's running. |
CbrainApi.DataProvidersApi | dataProvidersIdRegisterPost | POST /data_providers/{id}/register | Registers a file as a Userfile in CBRAIN. |
CbrainApi.DataProvidersApi | dataProvidersIdUnregisterPost | POST /data_providers/{id}/unregister | Unregisters files as Userfile in CBRAIN. |
CbrainApi.GroupsApi | groupsGet | GET /groups | Get a list of the Groups (projects) available to the current user. |
CbrainApi.GroupsApi | groupsIdDelete | DELETE /groups/{id} | Deletes a Group (project). |
CbrainApi.GroupsApi | groupsIdGet | GET /groups/{id} | Get information on a Group (project). |
CbrainApi.GroupsApi | groupsIdPut | PUT /groups/{id} | Update the properties of a Group (project). |
CbrainApi.GroupsApi | groupsPost | POST /groups | Creates a new Group. |
CbrainApi.GroupsApi | groupsSwitchPost | POST /groups/switch | Switches the active group. |
CbrainApi.SessionsApi | sessionDelete | DELETE /session | Destroy the session |
CbrainApi.SessionsApi | sessionGet | GET /session | Get session information |
CbrainApi.SessionsApi | sessionNewGet | GET /session/new | New session initiator |
CbrainApi.SessionsApi | sessionPost | POST /session | Create a new session |
CbrainApi.TagsApi | tagsGet | GET /tags | Get a list of the tags currently in CBRAIN. |
CbrainApi.TagsApi | tagsIdDelete | DELETE /tags/{id} | Delete a tag. |
CbrainApi.TagsApi | tagsIdGet | GET /tags/{id} | Get one tag. |
CbrainApi.TagsApi | tagsIdPut | PUT /tags/{id} | Update a tag. |
CbrainApi.TagsApi | tagsPost | POST /tags | Create a tag. |
CbrainApi.TasksApi | tasksGet | GET /tasks | Get the list of Tasks. |
CbrainApi.TasksApi | tasksIdDelete | DELETE /tasks/{id} | Deletes a Task |
CbrainApi.TasksApi | tasksIdGet | GET /tasks/{id} | Get information on a Task. |
CbrainApi.TasksApi | tasksIdPut | PUT /tasks/{id} | Update information on a Task. |
CbrainApi.TasksApi | tasksPost | POST /tasks | Create a new Task. |
CbrainApi.ToolConfigsApi | toolConfigsGet | GET /tool_configs | Get a list of tool versions installed. |
CbrainApi.ToolConfigsApi | toolConfigsIdGet | GET /tool_configs/{id} | Get information about a particular tool configuration |
CbrainApi.ToolsApi | toolsGet | GET /tools | Get the list of Tools. |
CbrainApi.UserfilesApi | userfilesChangeProviderPost | POST /userfiles/change_provider | Moves the Userfiles from their current Data Provider to a new one. |
CbrainApi.UserfilesApi | userfilesCompressPost | POST /userfiles/compress | Compresses many Userfiles each into their own GZIP archive. |
CbrainApi.UserfilesApi | userfilesDeleteFilesPost | POST /userfiles/delete_files | Delete several files that have been registered as Userfiles |
CbrainApi.UserfilesApi | userfilesDownloadPost | POST /userfiles/download | Download several files |
CbrainApi.UserfilesApi | userfilesGet | GET /userfiles | List of the Userfiles accessible to the current user. |
CbrainApi.UserfilesApi | userfilesIdContentGet | GET /userfiles/{id}/content | Get the content of a Userfile |
CbrainApi.UserfilesApi | userfilesIdDelete | DELETE /userfiles/{id} | Delete a Userfile. |
CbrainApi.UserfilesApi | userfilesIdGet | GET /userfiles/{id} | Get information on a Userfile. |
CbrainApi.UserfilesApi | userfilesIdPut | PUT /userfiles/{id} | Update information on a Userfile. |
CbrainApi.UserfilesApi | userfilesPost | POST /userfiles | Creates a new Userfile. |
CbrainApi.UserfilesApi | userfilesSyncMultiplePost | POST /userfiles/sync_multiple | Syncs Userfiles to their Data Providers' cache. |
CbrainApi.UserfilesApi | userfilesUncompressPost | POST /userfiles/uncompress | Uncompresses many Userfiles. |
CbrainApi.UsersApi | usersGet | GET /users | Returns all of the users in CBRAIN. |
CbrainApi.UsersApi | usersIdGet | GET /users/{id} | Returns information about a user |
CbrainApi.UsersApi | usersPost | POST /users | Create a new user in CBRAIN. |
Documentation for Models
- CbrainApi.Bourreau
- CbrainApi.CbrainTask
- CbrainApi.DataProvider
- CbrainApi.Group
- CbrainApi.InlineResponse200
- CbrainApi.InlineResponse2001
- CbrainApi.InlineResponse2002
- CbrainApi.Parameters
- CbrainApi.Params
- CbrainApi.Params1
- CbrainApi.Tag
- CbrainApi.Tool
- CbrainApi.ToolConfig
- CbrainApi.User
- CbrainApi.Userfile
Documentation for Authorization
BrainPortalSession
- Type: API key
- API key parameter name: BrainPortalSession
- Location: HTTP header
8 years ago