# rainbow_application_portal

RainbowApplicationPortal - JavaScript client for rainbow_application_portal
# Rainbow application portal API guide  ## Preamble  ### Introduction  This guide describes list of API services that are provided by OT Rainbow Application portal. This portal is dedicated to app features.  ### Protocol  REST interface is used for sending/receiving OT rainbow API messages. HTTP requests GET, DELETE, POST, UPDATE are used. Standard HTTP responses are used to provide requested information or error status. There is no session notion in OT Rainbow system, so requests could be issued according stateless model, without transport conservation between them. Additional data could be provided in message body. JSON is used as a main format for data encoding in message body part. Each request is started with the following pattern /{module}/{version}/ where {module} is a portal module name to address and {version} is a version of used API, par example, “v1.0”.  ### Security considerations  Each request should contain some credential information to authenticate itself. Standard HTTP authentication with basic/bearer modes is used. JSON Web Token mechanism is used to provide authentication information. JWT has a expire timeout that is controlled by OT Rainbow portal to prevent very long token usage. Also authentication with application token is used. The token must be provided in the request HTTP header, using a custom header: APIKey. At server side, token is verified, and if it doesn’t match, 403 Not Allowed response is sent. TLS is used as a transport protocol to support message exchanges between OT Rainbow portal and an application.  
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.78.0
- Package version: 1.78.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install rainbow_application_portal --save
```

##### Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:

```shell
npm install
```

Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:

```shell
npm link
```

Finally, switch to the directory you want to use your rainbow_application_portal from, and run:

```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```

You should now be able to `require('rainbow_application_portal')` in javascript files from the directory you ran the last command above from.

### 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:

```shell
    npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). 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, that's to say your javascript file where you actually use this library):

```shell
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:

```javascript
module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var RainbowApplicationPortal = require('rainbow_application_portal');

var defaultClient = RainbowApplicationPortal.ApiClient.instance;
// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix['Authorization'] = "Token"

var api = new RainbowApplicationPortal.ApplicationsApi()
var appId = "appId_example"; // {String} Application unique identifier (like 578bb08dc0d8c107725ef8c4)
var accept = "accept_example"; // {String} application/json
api.applicationsApplicationsDeleteApps(appId, accept).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});


```

## Documentation for API Endpoints

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*RainbowApplicationPortal.ApplicationsApi* | [**applicationsApplicationsDeleteApps**](docs/ApplicationsApi.md#applicationsApplicationsDeleteApps) | **DELETE** /api/rainbow/applications/v1.0/applications/{appId} | Delete an application.
*RainbowApplicationPortal.ApplicationsApi* | [**applicationsApplicationsGetApps**](docs/ApplicationsApi.md#applicationsApplicationsGetApps) | **GET** /api/rainbow/applications/v1.0/applications | Get all applications created by the user.
*RainbowApplicationPortal.ApplicationsApi* | [**applicationsApplicationsGetApps_0**](docs/ApplicationsApi.md#applicationsApplicationsGetApps_0) | **GET** /api/rainbow/applications/v1.0/applications/{appId} | Get an application data.
*RainbowApplicationPortal.ApplicationsApi* | [**applicationsApplicationsPostApps**](docs/ApplicationsApi.md#applicationsApplicationsPostApps) | **POST** /api/rainbow/applications/v1.0/applications | Create an application.
*RainbowApplicationPortal.ApplicationsApi* | [**applicationsApplicationsPutApps**](docs/ApplicationsApi.md#applicationsApplicationsPutApps) | **PUT** /api/rainbow/applications/v1.0/applications/{appId} | Update an application.
*RainbowApplicationPortal.ApplicationsApi* | [**applicationsApplicationsRequestDeployApp**](docs/ApplicationsApi.md#applicationsApplicationsRequestDeployApp) | **PUT** /api/rainbow/applications/v1.0/applications/{appId}/request-deploy | Request the deployment of an application.
*RainbowApplicationPortal.ApplicationsApi* | [**applicationsApplicationsRestartApp**](docs/ApplicationsApi.md#applicationsApplicationsRestartApp) | **PUT** /api/rainbow/applications/v1.0/applications/{appId}/restart | Restart an application.
*RainbowApplicationPortal.ApplicationsApi* | [**applicationsApplicationsStopApp**](docs/ApplicationsApi.md#applicationsApplicationsStopApp) | **PUT** /api/rainbow/applications/v1.0/applications/{appId}/stop | Stop an application.
*RainbowApplicationPortal.ApplicationsDevelopersApi* | [**applicationsDevelopersPostConfirm**](docs/ApplicationsDevelopersApi.md#applicationsDevelopersPostConfirm) | **POST** /api/rainbow/applications/v1.0/developers/confirm | Confirm that a user has requested a developer account creation.


## Documentation for Models

 - [RainbowApplicationPortal.ApplicationsApplicationsDeleteAppsSuccess](docs/ApplicationsApplicationsDeleteAppsSuccess.md)
 - [RainbowApplicationPortal.ApplicationsApplicationsGetAppsSuccess](docs/ApplicationsApplicationsGetAppsSuccess.md)
 - [RainbowApplicationPortal.ApplicationsApplicationsPostApps](docs/ApplicationsApplicationsPostApps.md)
 - [RainbowApplicationPortal.ApplicationsApplicationsPostAppsSuccess](docs/ApplicationsApplicationsPostAppsSuccess.md)
 - [RainbowApplicationPortal.ApplicationsApplicationsPutApps](docs/ApplicationsApplicationsPutApps.md)
 - [RainbowApplicationPortal.ApplicationsApplicationsPutAppsSuccess](docs/ApplicationsApplicationsPutAppsSuccess.md)
 - [RainbowApplicationPortal.ApplicationsApplicationsRequestDeployAppSuccess](docs/ApplicationsApplicationsRequestDeployAppSuccess.md)
 - [RainbowApplicationPortal.ApplicationsApplicationsRestartAppSuccess](docs/ApplicationsApplicationsRestartAppSuccess.md)
 - [RainbowApplicationPortal.ApplicationsApplicationsStopAppSuccess](docs/ApplicationsApplicationsStopAppSuccess.md)
 - [RainbowApplicationPortal.ApplicationsDevelopersPostConfirm](docs/ApplicationsDevelopersPostConfirm.md)
 - [RainbowApplicationPortal.ApplicationsDevelopersPostConfirmSuccess](docs/ApplicationsDevelopersPostConfirmSuccess.md)
 - [RainbowApplicationPortal.ApplicationsDevelopersPostConfirmSuccessData](docs/ApplicationsDevelopersPostConfirmSuccessData.md)


## Documentation for Authorization



### Bearer


- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header

