# rl-cloud-api-sdk

> This is a client for the Redislabs Cloud API

Latest version **1.4.6** (published 2021-10-18) · BSD-3-Clause license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install rl-cloud-api-sdk
pnpm add rl-cloud-api-sdk
yarn add rl-cloud-api-sdk
bun add rl-cloud-api-sdk
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.4.6 |
| Published | 2021-10-18 |
| First published | 2020-02-12 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 117 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Dani Tseitlin |
| Maintainers | danitseitlin |
| Keywords | Redis, Redis Cloud API, Redis Cloud API SDK, Cloud API SDK, Cloud API, Cloud |

## Links

- npm: https://www.npmjs.com/package/rl-cloud-api-sdk
- Repository: https://github.com/danitseitlin/redis-cloud-api-sdk
- Homepage: https://github.com/danitseitlin/redis-cloud-api-sdk#readme
- Issues: https://github.com/danitseitlin/redis-cloud-api-sdk/issues
- npm.io page: https://npm.io/package/rl-cloud-api-sdk

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) 0.21.1

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.4.6 (latest) — 2021-10-18
- 1.4.5 — 2021-10-18
- 1.4.4 — 2021-10-14
- 1.4.3 — 2021-10-14
- 1.4.2 — 2021-10-13
- 1.4.1 — 2021-10-13
- 1.4.0 — 2021-10-12
- 1.3.9 — 2021-10-12
- 1.3.8 — 2021-10-06
- 1.3.7 — 2021-09-02
- 1.3.6 — 2021-09-02
- 1.3.5 — 2021-09-02
- 1.3.4 — 2021-08-31
- 1.3.3 — 2021-08-14
- 1.3.2 — 2021-08-14
- … 38 more at https://npm.io/package/rl-cloud-api-sdk/versions

## README

<p align='center'>
  <a href='https://www.npmjs.com/package/rl-cloud-api-sdk'>
    <img src='https://img.shields.io/npm/v/rl-cloud-api-sdk/latest?style=plastic' target='_blank' />
  </a>
  <a href='https://npmjs.org/package/rl-cloud-api-sdk' style='width:25px;height:20px;'>
    <img src='https://img.shields.io/npm/dm/rl-cloud-api-sdk.svg?color=blue&style=plastic' target='_blank' />
  </a>
  <a href='https://github.com/RedisLabs/rl-cloud-api-sdk/issues' style='width:25px;height:20px;'>
    <img src='https://img.shields.io/github/issues/RedisLabs/rl-cloud-api-sdk?style=plastic' target='_blank' />
  </a>
  <a href='https://npmjs.org/package/rl-cloud-api-sdk' style='width:25px;height:20px;'>
    <img src='https://img.shields.io/bundlephobia/min/rl-cloud-api-sdk/latest?style=plastic' target='_blank' />
  </a>
  <a href='https://github.com/RedisLabs/rl-cloud-api-sdk/commits/master'>
    <img src='https://img.shields.io/github/last-commit/RedisLabs/rl-cloud-api-sdk?style=plastic' />
  </a>
  <a href='https://github.com/RedisLabs/rl-cloud-api-sdk/blob/master/LICENSE'>
    <img src='https://img.shields.io/badge/license-BSD%203%20Clause-blue.svg?style=plastic' target='_blank' />
  </a>
</p></p>

## About
This NodeJS module is an SDK for the [Redis Cloud REST API](https://docs.redislabs.com/latest/rc/api/).
You can use [this module](https://www.npmjs.com/package/rl-cloud-api-sdk) to develop againts Redis Cloud REST API.

## Quick Start

### Install the module
Run the following command in your terminal:

`npm i rl-cloud-api-sdk`

### Initialize the module
To start using to API you first need to enable it and generate your API keys. You can follow the instructions [here](https://docs.redislabs.com/latest/rc/api/how-to/create-api-keys-for-your-team/). 

It is recommended not to save your API secrets inside your code.

This is how you create a client:
```
const client = new CloudAPISDK({
    accessKey: 'API access key',
    secretKey: 'API secret key',
});
```

This is how you call a specific API:
```
//basic usage
const accountInformation = await client.getAccountInformation();
```
# Existing functions vs API Endpoints
| Section        | Function                         | API endpoint                          | Usage                                                                     |
|--------------- | -------------------------------- | ------------------------------------- | ------------------------------------------------------------------------- |
| Account        | getAccountInformation            | `/`                                   | `await client.getAccountInformation()`                                    |
| Account        | getDataPersistences              | `/data-persistence`                   | `await client.getDataPersistence()`                                       |
| Account        | getDatabaseModules               | `/database-modules`                   | `await client.getDatabasesModules()`                                      |
| Account        | getSystemLogs                    | `/logs?limit=1&offset=3`              | `await client.getSystemLogs(1, 3)`                                        |
| Account        | getPaymentMethods                | `/payment-methods`                    | `await client.getPaymentMethods()`                                        |
| Account        | getPlans                         | `/plans?provider=AWS`                 | `await client.getPlans('AWS')`                                            |
| Account        | getRegions                       | `/regions?provider=AWS`               | `await client.getRegions('AWS')`                                          |
| Susbscriptions | getSubscriptions                 | `/subscriptions`                      | `await client.getSubscriptions()`                                         |
| Susbscriptions | createSubscription               | `/subscriptions`                      | `await client.createSubscription({name: 'sub1', ....})`                   |
| Susbscriptions | getSubscription                  | `/subscriptions/1`                    | `await client.updateSubscription(1, {name: 'sub1'...})`                   |
| Susbscriptions | updateSubscription               | `/subscriptions/1`                    | `await client.updateSubscription(1, {name: 'sub1'...})`                   |
| Susbscriptions | deleteSubscription               | `/subscriptions/1`                    | `await client.deleteSubscription(1)`                                      |
| Susbscriptions | getSubscriptionCidrWhitelist     | `/subscriptions/1/cidr`               | `await client.getSubscriptionCidrWhitelist(1)`                            |
| Susbscriptions | updateSubscriptionCidrWhitelists | `/subscriptions/1/cidr`               | `await client.updateSubscriptionCidrWhitelists(1, {cidrIps: [...], ..})`  |
| Susbscriptions | getVpcPeerings                   | `/subscriptions/1/peerings`           | `await client.getVpcPeerings(1)`                                          |
| Susbscriptions | createSubscriptionVpcPeering     | `/subscriptions/1/peerings`           | `await client.createSubscriptionVpcPeering(1, {region: 'us-east-1',...})` |
| Susbscriptions | deleteSubscriptionVpcPeering     | `/subscriptions/1/peerings/1`         | `await client.deleteSubscriptionVpcPeering(1, 1)`                         |
| Databases      | getDatabases                     | `/subscriptions/1/databases`          | `await client.getDatabases()`                                             |
| Databases      | createDatabase                   | `/subscriptions/1/databases`          | `await client.createDatabase(1, {name: 'db1', ..})`                       |
| Databases      | getDatabase                      | `/subscriptions/1/databases/1`        | `await client.getDatabase(1, 1)`                                          |
| Databases      | updateDatabase                   | `/subscriptions/1/databases/1`        | `await client.updateDatabase(1, 1, {name: 'db2', ..})`                    |
| Databases      | deleteDatabase                   | `/subscriptions/1/databases/1`        | `await client.deleteDatabase(1, 1)`                                       |
| Databases      | backupDatabase                   | `/subscriptions/1/databases/1/backup` | `await client.backupDatabase(1, 1)`                                       |
| Databases      | importIntoDatabase               | `/subscriptions/1/databases/1/import` | `await client.importIntoDatabase(1, 1, {importFromUri: 's3://...'})`      |
| Cloud Accounts | getCloudAccounts                 | `/cloud-accounts`                     | `await client.getCloudAccounts()`                                         |
| Cloud Accounts | createCloudAccount               | `/cloud-accouts`                      | `await client.createCloudAccount({name: 'c1'...})`                        |
| Cloud Accounts | getCloudAccount                  | `/cloud-accounts/1`                   | `await client.getCloudAccount(1)`                                         |
| Cloud Accounts | updateCloudAccount               | `/cloud-accounts/1`                   | `await client.updateCloudAccount(1)`                                      |
| Cloud Accounts | deleteCloudAccount               | `/cloud-accounts/1`                   | `await client.deleteCloudAccount(1)`                                      |
| Tasks          | getTasks                         | `/tasks`                              | `await client.getTasks()`                                                 |
| Tasks          | getTask                          | `/tasks/1`                            | `await client.getTask()`                                                  |

You can find the API documentation [here](https://api.redislabs.com/v1/swagger-ui.html)

![Unit testing](https://github.com/RedisLabs/rl-cloud-api-sdk/workflows/Unit%20testing/badge.svg)

---
_Source: https://npm.io/package/rl-cloud-api-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
