Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

azure-arm-rediscache

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-arm-rediscache

Microsoft Azure Redis Cache Client Library for node

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
increased by1.17%
Maintainers
1
Weekly downloads
 
Created
Source

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: 0.10.0 or higher
  • **API version: **

Features

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

How to Install

npm install azure-arm-rediscache

How to Use

Initialise the client and managing Redis Cache

var msRestAzure = require('ms-rest-azure');
var AzureMgmtRedisCache = require('azure-arm-rediscache');
  
// Create an Azure Redis Cache Management client.
  var credentials = new msRestAzure.UserTokenCredentials('your-client-id', 'your-domain', 'your-username', 'your-password', 'your-redirect-uri');
  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, ' '));
  });
  • Microsoft Azure SDK for Node.js
  • AutoRest

Keywords

FAQs

Package last updated on 20 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc