4.5.1 • Published 8 years ago

cbrain_api v4.5.1

Weekly downloads
-
License
Unlicense
Repository
-
Last release
8 years ago

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

ClassMethodHTTP requestDescription
CbrainApi.BourreauApibourreauxGetGET /bourreauxGet a list of the Bourreaux available to be used by the current user.
CbrainApi.BourreauApibourreauxIdGetGET /bourreaux/{id}Get information about a Bourreau.
CbrainApi.DataProvidersApidataProvidersGetGET /data_providersGet a list of the Data Providers available to the current user.
CbrainApi.DataProvidersApidataProvidersIdBrowseGetGET /data_providers/{id}/browseList the files on a Data Provider.
CbrainApi.DataProvidersApidataProvidersIdDeletePostPOST /data_providers/{id}/deleteDeletes unregistered files from a CBRAIN Data provider.
CbrainApi.DataProvidersApidataProvidersIdGetGET /data_providers/{id}Get information on a particular Data Provider.
CbrainApi.DataProvidersApidataProvidersIdIsAliveGetGET /data_providers/{id}/is_alivePings a Data Provider to check if it's running.
CbrainApi.DataProvidersApidataProvidersIdRegisterPostPOST /data_providers/{id}/registerRegisters a file as a Userfile in CBRAIN.
CbrainApi.DataProvidersApidataProvidersIdUnregisterPostPOST /data_providers/{id}/unregisterUnregisters files as Userfile in CBRAIN.
CbrainApi.GroupsApigroupsGetGET /groupsGet a list of the Groups (projects) available to the current user.
CbrainApi.GroupsApigroupsIdDeleteDELETE /groups/{id}Deletes a Group (project).
CbrainApi.GroupsApigroupsIdGetGET /groups/{id}Get information on a Group (project).
CbrainApi.GroupsApigroupsIdPutPUT /groups/{id}Update the properties of a Group (project).
CbrainApi.GroupsApigroupsPostPOST /groupsCreates a new Group.
CbrainApi.GroupsApigroupsSwitchPostPOST /groups/switchSwitches the active group.
CbrainApi.SessionsApisessionDeleteDELETE /sessionDestroy the session
CbrainApi.SessionsApisessionGetGET /sessionGet session information
CbrainApi.SessionsApisessionNewGetGET /session/newNew session initiator
CbrainApi.SessionsApisessionPostPOST /sessionCreate a new session
CbrainApi.TagsApitagsGetGET /tagsGet a list of the tags currently in CBRAIN.
CbrainApi.TagsApitagsIdDeleteDELETE /tags/{id}Delete a tag.
CbrainApi.TagsApitagsIdGetGET /tags/{id}Get one tag.
CbrainApi.TagsApitagsIdPutPUT /tags/{id}Update a tag.
CbrainApi.TagsApitagsPostPOST /tagsCreate a tag.
CbrainApi.TasksApitasksGetGET /tasksGet the list of Tasks.
CbrainApi.TasksApitasksIdDeleteDELETE /tasks/{id}Deletes a Task
CbrainApi.TasksApitasksIdGetGET /tasks/{id}Get information on a Task.
CbrainApi.TasksApitasksIdPutPUT /tasks/{id}Update information on a Task.
CbrainApi.TasksApitasksPostPOST /tasksCreate a new Task.
CbrainApi.ToolConfigsApitoolConfigsGetGET /tool_configsGet a list of tool versions installed.
CbrainApi.ToolConfigsApitoolConfigsIdGetGET /tool_configs/{id}Get information about a particular tool configuration
CbrainApi.ToolsApitoolsGetGET /toolsGet the list of Tools.
CbrainApi.UserfilesApiuserfilesChangeProviderPostPOST /userfiles/change_providerMoves the Userfiles from their current Data Provider to a new one.
CbrainApi.UserfilesApiuserfilesCompressPostPOST /userfiles/compressCompresses many Userfiles each into their own GZIP archive.
CbrainApi.UserfilesApiuserfilesDeleteFilesPostPOST /userfiles/delete_filesDelete several files that have been registered as Userfiles
CbrainApi.UserfilesApiuserfilesDownloadPostPOST /userfiles/downloadDownload several files
CbrainApi.UserfilesApiuserfilesGetGET /userfilesList of the Userfiles accessible to the current user.
CbrainApi.UserfilesApiuserfilesIdContentGetGET /userfiles/{id}/contentGet the content of a Userfile
CbrainApi.UserfilesApiuserfilesIdDeleteDELETE /userfiles/{id}Delete a Userfile.
CbrainApi.UserfilesApiuserfilesIdGetGET /userfiles/{id}Get information on a Userfile.
CbrainApi.UserfilesApiuserfilesIdPutPUT /userfiles/{id}Update information on a Userfile.
CbrainApi.UserfilesApiuserfilesPostPOST /userfilesCreates a new Userfile.
CbrainApi.UserfilesApiuserfilesSyncMultiplePostPOST /userfiles/sync_multipleSyncs Userfiles to their Data Providers' cache.
CbrainApi.UserfilesApiuserfilesUncompressPostPOST /userfiles/uncompressUncompresses many Userfiles.
CbrainApi.UsersApiusersGetGET /usersReturns all of the users in CBRAIN.
CbrainApi.UsersApiusersIdGetGET /users/{id}Returns information about a user
CbrainApi.UsersApiusersPostPOST /usersCreate a new user in CBRAIN.

Documentation for Models

Documentation for Authorization

BrainPortalSession

  • Type: API key
  • API key parameter name: BrainPortalSession
  • Location: HTTP header