Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
azure-arm-rediscache
Advanced tools
This project provides a Node.js package for accessing the Azure Redis Cache Client. Right now it supports:
npm install azure-arm-rediscache
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);
});
});
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, ' '));
});
FAQs
RedisManagementClient Library with typescript type definitions for node
We found that azure-arm-rediscache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.