<commit_before># brylie:api-umbrella
[API Umbrella](http://apiumbrella.io) is a proxy that sits in front of your APIs. It can seamlessly add common functionality like api keys, rate limiting, and analytics to any API. The API Umbrella platform has a REST API for managing users, API Endpoints, etc.

This package provides helper methods to interact with the [API Umbrella Admin API](http://apiumbrella.io/docs/admin-api/).

# Installation
Install the package in your project with the following command:
```
meteor add brylie:api-umbrella
```

# Configuration
Once you have added the package, you will need to extend the [Meteor.settings](http://docs.meteor.com/#/full/meteor_settings) object with the following (e.g. in `settings.json` in your project root directory):

```
{
  "apiUmbrella": {
    "apiKey": "...",
    "authToken": "...",
    "baseUrl": "..."
  }
}
```
## Configuration values
The Meteor settings object should contain a sub-object called `api_umbrella`. Within the `api_umbrella` object, define three properties:

* `api_key` - API key for administrative user
* `auth_token` - Authentication token for administrative user
* `base_url` - Base URL for Admin API (without version number, and with trailing slash). E.g. http://example.com/api-umbrella/

**Note:** The `api_key` and `auth_token` values only need to be available on the server, and *should not be public*.

### Obtaining API Key and Authentication token

You can obtain the *Authentication Token* and *API Key* from the API Umbrella platform by following instructions in the [Getting Started](http://apiumbrella.io/docs/getting-started/) and [API Umbrella Admin API](http://apiumbrella.io/docs/admin-api/) documentation.

# Start Meteor
Once you have created a Meteor.settings file (following the [Meteor.settings documentation](http://docs.meteor.com/#/full/meteor_settings), if needed), run your project with the `--settings` flag followed by your config file (e.g. `settings.json`):

```
meteor --settings settings.json
```

# Usage
## Structure
This package exports an object called `apiUmbrellaWeb`. `apiUmbrellaWeb` has the following structure:

* adminApi
  * v1
    * apiUsers
      * getUser
      * getUsers
      * createUser
    * apiBackends
      * getApiBackend
      * getApiBackends
      * createApiBackend
    * adminUsers
      * getAdmin
      * getAdmins
      * createAdmin

This structure conforms with the basic organization of the [API Umbrella Web](https://github.com/NREL/api-umbrella-web) project, and allows the package to mirror the versioning of the [API Umbrella Admin API](http://apiumbrella.io/docs/admin-api/).

## Methods

### API Users
* getUser (id) - gets a specific user by ID
* createUser (object) - create a new user given a user object
* getUsers - gets all users

### API Backends
* getApiBackend (id) - gets a specific API backend by ID
* getApiBackends - gets all API backends
* createApiBackend (object) - create a new API Backend given an API Backend object
<commit_msg>Updated instructions; use camel case<commit_after># brylie:api-umbrella
[API Umbrella](http://apiumbrella.io) is a proxy that sits in front of your APIs. It can seamlessly add common functionality like api keys, rate limiting, and analytics to any API. The API Umbrella platform has a REST API for managing users, API Endpoints, etc.

This package provides helper methods to interact with the [API Umbrella Admin API](http://apiumbrella.io/docs/admin-api/).

# Installation
Install the package in your project with the following command:
```
meteor add brylie:api-umbrella
```

# Configuration
Once you have added the package, you will need to extend the [Meteor.settings](http://docs.meteor.com/#/full/meteor_settings) object with the following (e.g. in `settings.json` in your project root directory):

```
{
  "apiUmbrella": {
    "apiKey": "...",
    "authToken": "...",
    "baseUrl": "..."
  }
}
```
## Configuration values
The Meteor settings object should contain a sub-object called `api_umbrella`. Within the `api_umbrella` object, define three properties:

* `apiKey` - API key for administrative user
* `authToken` - Authentication token for administrative user
* `baseUrl` - Base URL for Admin API (without version number, and with trailing slash). E.g. http://example.com/api-umbrella/

**Note:** The `apiKey` and `authToken` values only need to be available on the server, and *should not be public*.

### Obtaining API Key and Authentication token

You can obtain the *Authentication Token* and *API Key* from the API Umbrella platform by following instructions in the [Getting Started](http://apiumbrella.io/docs/getting-started/) and [API Umbrella Admin API](http://apiumbrella.io/docs/admin-api/) documentation.

# Start Meteor
Once you have created a Meteor.settings file (following the [Meteor.settings documentation](http://docs.meteor.com/#/full/meteor_settings), if needed), run your project with the `--settings` flag followed by your config file (e.g. `settings.json`):

```
meteor --settings settings.json
```

# Usage
## Structure
This package exports an object called `ApiUmbrellaWeb`. You can create a new instance of `ApiUmbrellaWeb` as follows, where `config` contains:

```
var config = {
  apiKey: 'Meteor.settings.apiUmbrella.apiKey',
  authToken: 'Meteor.settings.apiUmbrella.authToken',
  baseUrl: 'Meteor.settings.apiUmbrella.baseUrl'
};

var apiUmbrellaWeb = new ApiUmbrellaWeb(config);
```


`ApiUmbrellaWeb` has the following structure:

* adminApi
  * v1
    * apiUsers
      * getUser
      * getUsers
      * createUser
    * apiBackends
      * getApiBackend
      * getApiBackends
      * createApiBackend
    * adminUsers
      * getAdmin
      * getAdmins
      * createAdmin

This structure conforms with the basic organization of the [API Umbrella Web](https://github.com/NREL/api-umbrella-web) project, and allows the package to mirror the versioning of the [API Umbrella Admin API](http://apiumbrella.io/docs/admin-api/).

## Methods

### API Users
* getUser (id) - gets a specific user by ID
* createUser (object) - create a new user given a user object
* getUsers - gets all users

### API Backends
* getApiBackend (id) - gets a specific API backend by ID
* getApiBackends - gets all API backends
* createApiBackend (object) - create a new API Backend given an API Backend object

{'fraction_non_alphanumeric': 0.10279488394126006, 'fraction_numerical': 0.00031580609505763463, 'mean_word_length': 4.055067837190742, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5023888', 'n_tokens_mistral': 1894, 'n_tokens_neox': 1841, 'n_words': 707}