# azure-arm-rediscache

> RedisManagementClient Library with typescript type definitions for node

Latest version **3.0.0** (published 2019-01-14) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install azure-arm-rediscache
pnpm add azure-arm-rediscache
yarn add azure-arm-rediscache
bun add azure-arm-rediscache
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2019-01-14 |
| First published | 2015-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 581.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1174 |
| Author | Microsoft Corporation |
| Maintainers | windowsazure |
| Keywords | node, azure |

## Links

- npm: https://www.npmjs.com/package/azure-arm-rediscache
- Repository: https://github.com/azure/azure-sdk-for-node
- Homepage: https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/rediscachemanagement
- Issues: https://github.com/azure/azure-sdk-for-node/issues
- npm.io page: https://npm.io/package/azure-arm-rediscache

## Dependencies (2)

- [ms-rest](https://npm.io/package/ms-rest.md) ^2.3.3
- [ms-rest-azure](https://npm.io/package/ms-rest-azure.md) ^2.5.5

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2019-01-14
- 2.1.0-preview — 2018-11-07
- 2.0.0-preview — 2017-09-28
- 1.0.0-preview — 2017-04-03
- 0.2.3 — 2016-09-02
- 0.2.2 — 2016-09-02
- 0.2.1 — 2016-02-03
- 0.2.0 — 2016-01-20
- 0.1.0 — 2015-11-06
- 0.0.2 — 2015-08-13
- 0.0.1 — 2015-07-13

## README

# Microsoft Azure SDK for Node.js - Redis

This project provides a Node.js package for accessing the Azure Redis Cache Client. Right now it supports:
- **Node.js version: 6.x.x or higher**
- **API version: 2016-04-01**

## Features
- Manage Redis Cache: create, update, delete, list, get, regenerate key and get-key.

## How to Install

```bash
npm install azure-arm-rediscache
```

## How to Use

### Authentication, client creation and listing redis caches in a resource group as an example

 ```javascript
 var msRestAzure = require('ms-rest-azure');
 var AzureMgmtRedisCache = require('azure-arm-rediscache');

 // Interactive Login
 // It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, 
 // the user will get a DeviceTokenCredentials object.
 msRestAzure.interactiveLogin(function(err, credentials) {
  var client = new AzureMgmtRedisCache(credentials, subscriptionId);
  client.redis.listByResourceGroup(resourceGroup, workspaceCollectionName, function(err, result, request, response) {
    if (err) console.log(err);
    console.log(result);
  });
 });
 ```

#### Managing a RedisCache
```javascript
var client = new AzureMgmtRedisCache(credentials, 'your-subscription-id');

var resourceGroup = 'myResourceGroup';
var cacheName = 'myNewCache';

//Create an Azure Redis Cache

var skuProperties = {
    capacity : 1,
    family : C,
    name : 'Standard'
  };
    
var parameters = {
    location:'West US',
    redisVersion : '3.0',
    enableNonSslPort : false,
    sku : skuProperties
  };

console.info('Creating cache...');
client.redis.createOrUpdate(resourceGroup, cacheName, parameters, function (err, result) {
  if (err) throw err;
  console.info('Cache created: ' + JSON.stringify(result, null, ' '));
});


//Show properties of an existing Azure Redis Cache

console.info('Getting cache properties...');
client.redis.get(resourceGroup, cacheName, function (err, result) {
  if (err) throw err;
  console.info('Cache properties: ' + JSON.stringify(result, null, ' '));
});


//list all caches within a resource group

console.info('Getting caches within a resource group...');
client.redis.listByResourceGroup(resourceGroup, function (err, result) {
  if (err) throw err;
  console.info('Caches: ' + JSON.stringify(result, null, ' '));
});

//list all caches within your subscription

console.info('Getting caches within a subscription...');
client.redis.list(function (err, result) {
  if (err) throw err;
  console.info('Caches: ' + JSON.stringify(result, null, ' '));
});

//show primary and secondary keys of the cache

console.info('Getting cache keys...');
client.redis.listKeys(resourceGroup, cacheName, function (err, result) {
  if (err) throw err;
  console.info('Cache keys: ' + JSON.stringify(result, null, ' '));
});


//regenerate  keys of the cache

var keytype = 'Primary';
console.info('Getting cache keys...');
client.redis.regenerateKey(resourceGroup, cacheName, keytype, function (err, result) {
  if (err) throw err;
  console.info('Cache primary key regenerated');
  console.info('Regenerated Cache keys: ' + JSON.stringify(result, null, ' '));
});
```

## Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
- [AutoRest](https://github.com/Azure/autorest)

---
_Source: https://npm.io/package/azure-arm-rediscache · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
