diff --git a/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js b/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js index 30b8170518..814a6a22c5 100644 --- a/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js +++ b/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js @@ -14,11 +14,11 @@ * @class * Initializes a new instance of the ExportRDBParameters class. * @constructor - * Parameters for redis export operation. + * Parameters for Redis export operation. * * @member {string} [format] File format. * - * @member {string} prefix Prifix to use for exported files. + * @member {string} prefix Prefix to use for exported files. * * @member {string} container Container name to export to. * diff --git a/lib/services/rediscachemanagement/lib/models/importRDBParameters.js b/lib/services/rediscachemanagement/lib/models/importRDBParameters.js index 529f4ab8ea..4136ca7d0b 100644 --- a/lib/services/rediscachemanagement/lib/models/importRDBParameters.js +++ b/lib/services/rediscachemanagement/lib/models/importRDBParameters.js @@ -16,11 +16,11 @@ var util = require('util'); * @class * Initializes a new instance of the ImportRDBParameters class. * @constructor - * Parameters for redis import operation. + * Parameters for Redis import operation. * * @member {string} [format] File format. * - * @member {array} files files to import + * @member {array} files files to import. * */ function ImportRDBParameters() { diff --git a/lib/services/rediscachemanagement/lib/models/index.d.ts b/lib/services/rediscachemanagement/lib/models/index.d.ts index 9b53ce9c39..6221a7d57b 100644 --- a/lib/services/rediscachemanagement/lib/models/index.d.ts +++ b/lib/services/rediscachemanagement/lib/models/index.d.ts @@ -8,22 +8,26 @@ * regenerated. */ +import * as msRestAzure from 'ms-rest-azure'; +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; /** * @class * Initializes a new instance of the Sku class. * @constructor - * Sku parameters supplied to the create redis operation. + * SKU parameters supplied to the create Redis operation. * - * @member {string} name What type of redis cache to deploy. Valid values: + * @member {string} name The type of Redis cache to deploy. Valid values: * (Basic, Standard, Premium). Possible values include: 'Basic', 'Standard', * 'Premium' * - * @member {string} family Which family to use. Valid values: (C, P). Possible - * values include: 'C', 'P' + * @member {string} family The SKU family to use. Valid values: (C, P). (C = + * Basic/Standard, P = Premium). Possible values include: 'C', 'P' * - * @member {number} capacity What size of redis cache to deploy. Valid values: - * for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) + * @member {number} capacity The size of the Redis cache to deploy. Valid + * values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P + * (Premium) family (1, 2, 3, 4). * */ export interface Sku { @@ -32,72 +36,21 @@ export interface Sku { capacity: number; } -/** - * @class - * Initializes a new instance of the RedisProperties class. - * @constructor - * Properties supplied to CreateOrUpdate redis operation. - * - * @member {string} [redisVersion] RedisVersion parameter has been deprecated. - * As such, it is no longer necessary to provide this parameter and any value - * specified is ignored. - * - * @member {object} sku What sku of redis cache to deploy. - * - * @member {string} [sku.name] What type of redis cache to deploy. Valid - * values: (Basic, Standard, Premium). Possible values include: 'Basic', - * 'Standard', 'Premium' - * - * @member {string} [sku.family] Which family to use. Valid values: (C, P). - * Possible values include: 'C', 'P' - * - * @member {number} [sku.capacity] What size of redis cache to deploy. Valid - * values: for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) - * - * @member {object} [redisConfiguration] All Redis Settings. Few possible - * keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value - * etc. - * - * @member {boolean} [enableNonSslPort] If the value is true, then the non-ssl - * redis server port (6379) will be enabled. - * - * @member {object} [tenantSettings] tenantSettings - * - * @member {number} [shardCount] The number of shards to be created on a - * Premium Cluster Cache. - * - * @member {string} [subnetId] The full resource ID of a subnet in a virtual - * network to deploy the redis cache in. Example format: - * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 - * - * @member {string} [staticIP] Required when deploying a redis cache inside an - * existing Azure Virtual Network. - * - */ -export interface RedisProperties { - redisVersion?: string; - sku: Sku; - redisConfiguration?: { [propertyName: string]: string }; - enableNonSslPort?: boolean; - tenantSettings?: { [propertyName: string]: string }; - shardCount?: number; - subnetId?: string; - staticIP?: string; -} - /** * @class * Initializes a new instance of the Resource class. * @constructor - * @member {string} [id] Resource Id + * The Resource definition. + * + * @member {string} [id] Resource ID. * - * @member {string} [name] Resource name + * @member {string} [name] Resource name. * - * @member {string} [type] Resource type + * @member {string} [type] Resource type. * - * @member {string} location Resource location + * @member {string} location Resource location. * - * @member {object} [tags] Resource tags + * @member {object} [tags] Resource tags. * */ export interface Resource extends BaseResource { @@ -110,32 +63,16 @@ export interface Resource extends BaseResource { /** * @class - * Initializes a new instance of the RedisCreateOrUpdateParameters class. + * Initializes a new instance of the RedisCreateParameters class. * @constructor - * Parameters supplied to the CreateOrUpdate Redis operation. + * Parameters supplied to the Create Redis operation. * - * @member {string} [redisVersion] RedisVersion parameter has been deprecated. - * As such, it is no longer necessary to provide this parameter and any value - * specified is ignored. - * - * @member {object} sku What sku of redis cache to deploy. - * - * @member {string} [sku.name] What type of redis cache to deploy. Valid - * values: (Basic, Standard, Premium). Possible values include: 'Basic', - * 'Standard', 'Premium' - * - * @member {string} [sku.family] Which family to use. Valid values: (C, P). - * Possible values include: 'C', 'P' - * - * @member {number} [sku.capacity] What size of redis cache to deploy. Valid - * values: for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) - * * @member {object} [redisConfiguration] All Redis Settings. Few possible * keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value * etc. * - * @member {boolean} [enableNonSslPort] If the value is true, then the non-ssl - * redis server port (6379) will be enabled. + * @member {boolean} [enableNonSslPort] Specifies whether the non-ssl Redis + * server port (6379) is enabled. * * @member {object} [tenantSettings] tenantSettings * @@ -143,70 +80,48 @@ export interface Resource extends BaseResource { * Premium Cluster Cache. * * @member {string} [subnetId] The full resource ID of a subnet in a virtual - * network to deploy the redis cache in. Example format: + * network to deploy the Redis cache in. Example format: * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 * - * @member {string} [staticIP] Required when deploying a redis cache inside an - * existing Azure Virtual Network. + * @member {string} [staticIP] Static IP address. Required when deploying a + * Redis cache inside an existing Azure Virtual Network. + * + * @member {object} sku The SKU of the Redis cache to deploy. + * + * @member {string} [sku.name] The type of Redis cache to deploy. Valid + * values: (Basic, Standard, Premium). Possible values include: 'Basic', + * 'Standard', 'Premium' + * + * @member {string} [sku.family] The SKU family to use. Valid values: (C, P). + * (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P' + * + * @member {number} [sku.capacity] The size of the Redis cache to deploy. + * Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P + * (Premium) family (1, 2, 3, 4). * */ -export interface RedisCreateOrUpdateParameters extends Resource { - redisVersion?: string; - sku: Sku; +export interface RedisCreateParameters extends Resource { redisConfiguration?: { [propertyName: string]: string }; enableNonSslPort?: boolean; tenantSettings?: { [propertyName: string]: string }; shardCount?: number; subnetId?: string; staticIP?: string; + sku: Sku; } /** * @class - * Initializes a new instance of the RedisAccessKeys class. - * @constructor - * Redis cache access keys. - * - * @member {string} [primaryKey] The current primary key that clients can use - * to authenticate with redis cache. - * - * @member {string} [secondaryKey] The current secondary key that clients can - * use to authenticate with redis cache. - * - */ -export interface RedisAccessKeys { - primaryKey?: string; - secondaryKey?: string; -} - -/** - * @class - * Initializes a new instance of the RedisResourceWithAccessKey class. + * Initializes a new instance of the RedisUpdateParameters class. * @constructor - * A redis item in CreateOrUpdate Operation response. + * Parameters supplied to the Update Redis operation. * - * @member {string} [redisVersion] RedisVersion parameter has been deprecated. - * As such, it is no longer necessary to provide this parameter and any value - * specified is ignored. - * - * @member {object} sku What sku of redis cache to deploy. - * - * @member {string} [sku.name] What type of redis cache to deploy. Valid - * values: (Basic, Standard, Premium). Possible values include: 'Basic', - * 'Standard', 'Premium' - * - * @member {string} [sku.family] Which family to use. Valid values: (C, P). - * Possible values include: 'C', 'P' - * - * @member {number} [sku.capacity] What size of redis cache to deploy. Valid - * values: for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) - * * @member {object} [redisConfiguration] All Redis Settings. Few possible * keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value * etc. * - * @member {boolean} [enableNonSslPort] If the value is true, then the non-ssl - * redis server port (6379) will be enabled. + * @member {boolean} [enableNonSslPort] Specifies whether the non-ssl Redis + * server port (6379) is enabled. * * @member {object} [tenantSettings] tenantSettings * @@ -214,73 +129,79 @@ export interface RedisAccessKeys { * Premium Cluster Cache. * * @member {string} [subnetId] The full resource ID of a subnet in a virtual - * network to deploy the redis cache in. Example format: + * network to deploy the Redis cache in. Example format: * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 * - * @member {string} [staticIP] Required when deploying a redis cache inside an - * existing Azure Virtual Network. + * @member {string} [staticIP] Static IP address. Required when deploying a + * Redis cache inside an existing Azure Virtual Network. * - * @member {string} [provisioningState] Redis instance provisioning status + * @member {object} [sku] The SKU of the Redis cache to deploy. * - * @member {string} [hostName] Redis host name - * - * @member {number} [port] Redis non-ssl port - * - * @member {number} [sslPort] Redis ssl port + * @member {string} [sku.name] The type of Redis cache to deploy. Valid + * values: (Basic, Standard, Premium). Possible values include: 'Basic', + * 'Standard', 'Premium' * - * @member {object} [accessKeys] Redis cache access keys. + * @member {string} [sku.family] The SKU family to use. Valid values: (C, P). + * (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P' * - * @member {string} [accessKeys.primaryKey] The current primary key that - * clients can use to authenticate with redis cache. + * @member {number} [sku.capacity] The size of the Redis cache to deploy. + * Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P + * (Premium) family (1, 2, 3, 4). * - * @member {string} [accessKeys.secondaryKey] The current secondary key that - * clients can use to authenticate with redis cache. + * @member {object} [tags] Resource tags. * */ -export interface RedisResourceWithAccessKey extends Resource { - redisVersion?: string; - sku: Sku; +export interface RedisUpdateParameters { redisConfiguration?: { [propertyName: string]: string }; enableNonSslPort?: boolean; tenantSettings?: { [propertyName: string]: string }; shardCount?: number; subnetId?: string; staticIP?: string; - provisioningState?: string; - hostName?: string; - port?: number; - sslPort?: number; - accessKeys?: RedisAccessKeys; + sku?: Sku; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the RedisAccessKeys class. + * @constructor + * Redis cache access keys. + * + * @member {string} [primaryKey] The current primary key that clients can use + * to authenticate with Redis cache. + * + * @member {string} [secondaryKey] The current secondary key that clients can + * use to authenticate with Redis cache. + * + */ +export interface RedisAccessKeys { + primaryKey?: string; + secondaryKey?: string; } /** * @class * Initializes a new instance of the RedisResource class. * @constructor - * A single redis item in List or Get Operation. + * A single Redis item in List or Get Operation. * - * @member {string} [redisVersion] RedisVersion parameter has been deprecated. - * As such, it is no longer necessary to provide this parameter and any value - * specified is ignored. + * @member {string} [redisVersion] Redis version. * - * @member {object} sku What sku of redis cache to deploy. + * @member {string} [provisioningState] Redis instance provisioning status. * - * @member {string} [sku.name] What type of redis cache to deploy. Valid - * values: (Basic, Standard, Premium). Possible values include: 'Basic', - * 'Standard', 'Premium' + * @member {string} [hostName] Redis host name. * - * @member {string} [sku.family] Which family to use. Valid values: (C, P). - * Possible values include: 'C', 'P' + * @member {number} [port] Redis non-SSL port. * - * @member {number} [sku.capacity] What size of redis cache to deploy. Valid - * values: for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) + * @member {number} [sslPort] Redis SSL port. * * @member {object} [redisConfiguration] All Redis Settings. Few possible * keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value * etc. * - * @member {boolean} [enableNonSslPort] If the value is true, then the non-ssl - * redis server port (6379) will be enabled. + * @member {boolean} [enableNonSslPort] Specifies whether the non-ssl Redis + * server port (6379) is enabled. * * @member {object} [tenantSettings] tenantSettings * @@ -288,62 +209,65 @@ export interface RedisResourceWithAccessKey extends Resource { * Premium Cluster Cache. * * @member {string} [subnetId] The full resource ID of a subnet in a virtual - * network to deploy the redis cache in. Example format: + * network to deploy the Redis cache in. Example format: * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 * - * @member {string} [staticIP] Required when deploying a redis cache inside an - * existing Azure Virtual Network. + * @member {string} [staticIP] Static IP address. Required when deploying a + * Redis cache inside an existing Azure Virtual Network. * - * @member {string} [provisioningState] Redis instance provisioning status + * @member {object} sku The SKU of the Redis cache to deploy. * - * @member {string} [hostName] Redis host name + * @member {string} [sku.name] The type of Redis cache to deploy. Valid + * values: (Basic, Standard, Premium). Possible values include: 'Basic', + * 'Standard', 'Premium' * - * @member {number} [port] Redis non-ssl port + * @member {string} [sku.family] The SKU family to use. Valid values: (C, P). + * (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P' * - * @member {number} [sslPort] Redis ssl port + * @member {number} [sku.capacity] The size of the Redis cache to deploy. + * Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P + * (Premium) family (1, 2, 3, 4). * */ export interface RedisResource extends Resource { redisVersion?: string; - sku: Sku; + provisioningState?: string; + hostName?: string; + port?: number; + sslPort?: number; redisConfiguration?: { [propertyName: string]: string }; enableNonSslPort?: boolean; tenantSettings?: { [propertyName: string]: string }; shardCount?: number; subnetId?: string; staticIP?: string; - provisioningState?: string; - hostName?: string; - port?: number; - sslPort?: number; + sku: Sku; } /** * @class - * Initializes a new instance of the RedisListKeysResult class. + * Initializes a new instance of the RedisListResult class. * @constructor - * The response of redis list keys operation. + * The response of list Redis operation. * - * @member {string} [primaryKey] The current primary key that clients can use - * to authenticate with redis cache. + * @member {array} [value] List of Redis cache instances. * - * @member {string} [secondaryKey] The current secondary key that clients can - * use to authenticate with redis cache. + * @member {string} [nextLink] Link for next set of locations. * */ -export interface RedisListKeysResult { - primaryKey?: string; - secondaryKey?: string; +export interface RedisListResult { + value?: RedisResource[]; + nextLink?: string; } /** * @class * Initializes a new instance of the RedisRegenerateKeyParameters class. * @constructor - * Specifies which redis access keys to reset. + * Specifies which Redis access keys to reset. * - * @member {string} keyType Which redis access key to reset. Possible values - * include: 'Primary', 'Secondary' + * @member {string} keyType The Redis access key to regenerate. Possible + * values include: 'Primary', 'Secondary' * */ export interface RedisRegenerateKeyParameters { @@ -354,14 +278,14 @@ export interface RedisRegenerateKeyParameters { * @class * Initializes a new instance of the RedisRebootParameters class. * @constructor - * Specifies which redis node(s) to reboot. + * Specifies which Redis node(s) to reboot. * - * @member {string} rebootType Which redis node(s) to reboot. Depending on + * @member {string} rebootType Which Redis node(s) to reboot. Depending on * this value data loss is possible. Possible values include: 'PrimaryNode', * 'SecondaryNode', 'AllNodes' * - * @member {number} [shardId] In case of cluster cache, this specifies shard - * id which should be rebooted. + * @member {number} [shardId] If clustering is enabled, the ID of the shard to + * be rebooted. * */ export interface RedisRebootParameters { @@ -373,11 +297,11 @@ export interface RedisRebootParameters { * @class * Initializes a new instance of the ExportRDBParameters class. * @constructor - * Parameters for redis export operation. + * Parameters for Redis export operation. * * @member {string} [format] File format. * - * @member {string} prefix Prifix to use for exported files. + * @member {string} prefix Prefix to use for exported files. * * @member {string} container Container name to export to. * @@ -392,11 +316,11 @@ export interface ExportRDBParameters { * @class * Initializes a new instance of the ImportRDBParameters class. * @constructor - * Parameters for redis import operation. + * Parameters for Redis import operation. * * @member {string} [format] File format. * - * @member {array} files files to import + * @member {array} files files to import. * */ export interface ImportRDBParameters { @@ -408,9 +332,11 @@ export interface ImportRDBParameters { * @class * Initializes a new instance of the ScheduleEntry class. * @constructor - * @member {string} dayOfWeek Day of week when cache can be patched. Possible - * values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', - * 'Saturday', 'Sunday' + * Patch schedule entry for a Premium Redis Cache. + * + * @member {string} dayOfWeek Day of the week when a cache can be patched. + * Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', + * 'Friday', 'Saturday', 'Sunday', 'Everyday', 'Weekend' * * @member {number} startHourUtc Start hour after which cache patching can * start. @@ -427,35 +353,22 @@ export interface ScheduleEntry { /** * @class - * Initializes a new instance of the RedisPatchSchedulesRequest class. - * @constructor - * Parameters to set patch schedules for redis cache. - * - * @member {array} scheduleEntries List of patch schedules for redis cache. - * - */ -export interface RedisPatchSchedulesRequest { - scheduleEntries: ScheduleEntry[]; -} - -/** - * @class - * Initializes a new instance of the RedisPatchSchedulesResponse class. + * Initializes a new instance of the RedisPatchSchedule class. * @constructor - * Response to put/get patch schedules for redis cache. + * Response to put/get patch schedules for Redis cache. * - * @member {string} [id] Resource Id + * @member {string} [id] Resource ID. * - * @member {string} [name] Resource name + * @member {string} [name] Resource name. * - * @member {string} [type] Resource type + * @member {string} [type] Resource type. * - * @member {string} [location] Resource location + * @member {string} [location] Resource location. * - * @member {array} scheduleEntries List of patch schedules for redis cache. + * @member {array} scheduleEntries List of patch schedules for a Redis cache. * */ -export interface RedisPatchSchedulesResponse { +export interface RedisPatchSchedule { id?: string; name?: string; type?: string; @@ -468,7 +381,7 @@ export interface RedisPatchSchedulesResponse { * @class * Initializes a new instance of the RedisListResult class. * @constructor - * The response of list redis operation. + * The response of list Redis operation. * * @member {string} [nextLink] Link for next set of locations. * diff --git a/lib/services/rediscachemanagement/lib/models/index.js b/lib/services/rediscachemanagement/lib/models/index.js index 669810ad77..d1c47e3dca 100644 --- a/lib/services/rediscachemanagement/lib/models/index.js +++ b/lib/services/rediscachemanagement/lib/models/index.js @@ -19,18 +19,15 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.Sku = require('./sku'); -exports.RedisProperties = require('./redisProperties'); exports.Resource = require('./resource'); -exports.RedisCreateOrUpdateParameters = require('./redisCreateOrUpdateParameters'); +exports.RedisCreateParameters = require('./redisCreateParameters'); +exports.RedisUpdateParameters = require('./redisUpdateParameters'); exports.RedisAccessKeys = require('./redisAccessKeys'); -exports.RedisResourceWithAccessKey = require('./redisResourceWithAccessKey'); exports.RedisResource = require('./redisResource'); -exports.RedisListKeysResult = require('./redisListKeysResult'); +exports.RedisListResult = require('./redisListResult'); exports.RedisRegenerateKeyParameters = require('./redisRegenerateKeyParameters'); exports.RedisRebootParameters = require('./redisRebootParameters'); exports.ExportRDBParameters = require('./exportRDBParameters'); exports.ImportRDBParameters = require('./importRDBParameters'); exports.ScheduleEntry = require('./scheduleEntry'); -exports.RedisPatchSchedulesRequest = require('./redisPatchSchedulesRequest'); -exports.RedisPatchSchedulesResponse = require('./redisPatchSchedulesResponse'); -exports.RedisListResult = require('./redisListResult'); +exports.RedisPatchSchedule = require('./redisPatchSchedule'); diff --git a/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js b/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js index f90cb6c447..d3416f359f 100644 --- a/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js +++ b/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js @@ -17,10 +17,10 @@ * Redis cache access keys. * * @member {string} [primaryKey] The current primary key that clients can use - * to authenticate with redis cache. + * to authenticate with Redis cache. * * @member {string} [secondaryKey] The current secondary key that clients can - * use to authenticate with redis cache. + * use to authenticate with Redis cache. * */ function RedisAccessKeys() { @@ -42,6 +42,7 @@ RedisAccessKeys.prototype.mapper = function () { modelProperties: { primaryKey: { required: false, + readOnly: true, serializedName: 'primaryKey', type: { name: 'String' @@ -49,6 +50,7 @@ RedisAccessKeys.prototype.mapper = function () { }, secondaryKey: { required: false, + readOnly: true, serializedName: 'secondaryKey', type: { name: 'String' diff --git a/lib/services/rediscachemanagement/lib/models/redisCreateOrUpdateParameters.js b/lib/services/rediscachemanagement/lib/models/redisCreateParameters.js similarity index 71% rename from lib/services/rediscachemanagement/lib/models/redisCreateOrUpdateParameters.js rename to lib/services/rediscachemanagement/lib/models/redisCreateParameters.js index 4706442e04..1a5ed48428 100644 --- a/lib/services/rediscachemanagement/lib/models/redisCreateOrUpdateParameters.js +++ b/lib/services/rediscachemanagement/lib/models/redisCreateParameters.js @@ -16,32 +16,16 @@ var util = require('util'); /** * @class - * Initializes a new instance of the RedisCreateOrUpdateParameters class. + * Initializes a new instance of the RedisCreateParameters class. * @constructor - * Parameters supplied to the CreateOrUpdate Redis operation. + * Parameters supplied to the Create Redis operation. * - * @member {string} [redisVersion] RedisVersion parameter has been deprecated. - * As such, it is no longer necessary to provide this parameter and any value - * specified is ignored. - * - * @member {object} sku What sku of redis cache to deploy. - * - * @member {string} [sku.name] What type of redis cache to deploy. Valid - * values: (Basic, Standard, Premium). Possible values include: 'Basic', - * 'Standard', 'Premium' - * - * @member {string} [sku.family] Which family to use. Valid values: (C, P). - * Possible values include: 'C', 'P' - * - * @member {number} [sku.capacity] What size of redis cache to deploy. Valid - * values: for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) - * * @member {object} [redisConfiguration] All Redis Settings. Few possible * keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value * etc. * - * @member {boolean} [enableNonSslPort] If the value is true, then the non-ssl - * redis server port (6379) will be enabled. + * @member {boolean} [enableNonSslPort] Specifies whether the non-ssl Redis + * server port (6379) is enabled. * * @member {object} [tenantSettings] tenantSettings * @@ -49,32 +33,45 @@ var util = require('util'); * Premium Cluster Cache. * * @member {string} [subnetId] The full resource ID of a subnet in a virtual - * network to deploy the redis cache in. Example format: + * network to deploy the Redis cache in. Example format: * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 * - * @member {string} [staticIP] Required when deploying a redis cache inside an - * existing Azure Virtual Network. + * @member {string} [staticIP] Static IP address. Required when deploying a + * Redis cache inside an existing Azure Virtual Network. + * + * @member {object} sku The SKU of the Redis cache to deploy. + * + * @member {string} [sku.name] The type of Redis cache to deploy. Valid + * values: (Basic, Standard, Premium). Possible values include: 'Basic', + * 'Standard', 'Premium' + * + * @member {string} [sku.family] The SKU family to use. Valid values: (C, P). + * (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P' + * + * @member {number} [sku.capacity] The size of the Redis cache to deploy. + * Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P + * (Premium) family (1, 2, 3, 4). * */ -function RedisCreateOrUpdateParameters() { - RedisCreateOrUpdateParameters['super_'].call(this); +function RedisCreateParameters() { + RedisCreateParameters['super_'].call(this); } -util.inherits(RedisCreateOrUpdateParameters, models['Resource']); +util.inherits(RedisCreateParameters, models['Resource']); /** - * Defines the metadata of RedisCreateOrUpdateParameters + * Defines the metadata of RedisCreateParameters * - * @returns {object} metadata of RedisCreateOrUpdateParameters + * @returns {object} metadata of RedisCreateParameters * */ -RedisCreateOrUpdateParameters.prototype.mapper = function () { +RedisCreateParameters.prototype.mapper = function () { return { required: false, - serializedName: 'RedisCreateOrUpdateParameters', + serializedName: 'RedisCreateParameters', type: { name: 'Composite', - className: 'RedisCreateOrUpdateParameters', + className: 'RedisCreateParameters', modelProperties: { id: { required: false, @@ -121,24 +118,9 @@ RedisCreateOrUpdateParameters.prototype.mapper = function () { } } }, - redisVersion: { - required: false, - serializedName: 'properties.redisVersion', - type: { - name: 'String' - } - }, - sku: { - required: true, - serializedName: 'properties.sku', - type: { - name: 'Composite', - className: 'Sku' - } - }, redisConfiguration: { required: false, - serializedName: 'properties.redisConfiguration', + serializedName: 'properties.RedisConfiguration', type: { name: 'Dictionary', value: { @@ -197,10 +179,18 @@ RedisCreateOrUpdateParameters.prototype.mapper = function () { type: { name: 'String' } + }, + sku: { + required: true, + serializedName: 'properties.sku', + type: { + name: 'Composite', + className: 'Sku' + } } } } }; }; -module.exports = RedisCreateOrUpdateParameters; +module.exports = RedisCreateParameters; diff --git a/lib/services/rediscachemanagement/lib/models/redisListKeysResult.js b/lib/services/rediscachemanagement/lib/models/redisListKeysResult.js deleted file mode 100644 index 4c40fd890d..0000000000 --- a/lib/services/rediscachemanagement/lib/models/redisListKeysResult.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * @class - * Initializes a new instance of the RedisListKeysResult class. - * @constructor - * The response of redis list keys operation. - * - * @member {string} [primaryKey] The current primary key that clients can use - * to authenticate with redis cache. - * - * @member {string} [secondaryKey] The current secondary key that clients can - * use to authenticate with redis cache. - * - */ -function RedisListKeysResult() { -} - -/** - * Defines the metadata of RedisListKeysResult - * - * @returns {object} metadata of RedisListKeysResult - * - */ -RedisListKeysResult.prototype.mapper = function () { - return { - required: false, - serializedName: 'RedisListKeysResult', - type: { - name: 'Composite', - className: 'RedisListKeysResult', - modelProperties: { - primaryKey: { - required: false, - serializedName: 'primaryKey', - type: { - name: 'String' - } - }, - secondaryKey: { - required: false, - serializedName: 'secondaryKey', - type: { - name: 'String' - } - } - } - } - }; -}; - -module.exports = RedisListKeysResult; diff --git a/lib/services/rediscachemanagement/lib/models/redisListResult.js b/lib/services/rediscachemanagement/lib/models/redisListResult.js index 5dfcdf4c8f..e472203600 100644 --- a/lib/services/rediscachemanagement/lib/models/redisListResult.js +++ b/lib/services/rediscachemanagement/lib/models/redisListResult.js @@ -16,7 +16,7 @@ var util = require('util'); * @class * Initializes a new instance of the RedisListResult class. * @constructor - * The response of list redis operation. + * The response of list Redis operation. * * @member {string} [nextLink] Link for next set of locations. * diff --git a/lib/services/rediscachemanagement/lib/models/redisPatchSchedulesResponse.js b/lib/services/rediscachemanagement/lib/models/redisPatchSchedule.js similarity index 69% rename from lib/services/rediscachemanagement/lib/models/redisPatchSchedulesResponse.js rename to lib/services/rediscachemanagement/lib/models/redisPatchSchedule.js index aa5d48c189..286680ab2e 100644 --- a/lib/services/rediscachemanagement/lib/models/redisPatchSchedulesResponse.js +++ b/lib/services/rediscachemanagement/lib/models/redisPatchSchedule.js @@ -16,37 +16,37 @@ var util = require('util'); /** * @class - * Initializes a new instance of the RedisPatchSchedulesResponse class. + * Initializes a new instance of the RedisPatchSchedule class. * @constructor - * Response to put/get patch schedules for redis cache. + * Response to put/get patch schedules for Redis cache. * - * @member {string} [id] Resource Id + * @member {string} [id] Resource ID. * - * @member {string} [name] Resource name + * @member {string} [name] Resource name. * - * @member {string} [type] Resource type + * @member {string} [type] Resource type. * - * @member {string} [location] Resource location + * @member {string} [location] Resource location. * - * @member {array} scheduleEntries List of patch schedules for redis cache. + * @member {array} scheduleEntries List of patch schedules for a Redis cache. * */ -function RedisPatchSchedulesResponse() { +function RedisPatchSchedule() { } /** - * Defines the metadata of RedisPatchSchedulesResponse + * Defines the metadata of RedisPatchSchedule * - * @returns {object} metadata of RedisPatchSchedulesResponse + * @returns {object} metadata of RedisPatchSchedule * */ -RedisPatchSchedulesResponse.prototype.mapper = function () { +RedisPatchSchedule.prototype.mapper = function () { return { required: false, - serializedName: 'RedisPatchSchedulesResponse', + serializedName: 'RedisPatchSchedule', type: { name: 'Composite', - className: 'RedisPatchSchedulesResponse', + className: 'RedisPatchSchedule', modelProperties: { id: { required: false, @@ -74,6 +74,7 @@ RedisPatchSchedulesResponse.prototype.mapper = function () { }, location: { required: false, + readOnly: true, serializedName: 'location', type: { name: 'String' @@ -99,4 +100,4 @@ RedisPatchSchedulesResponse.prototype.mapper = function () { }; }; -module.exports = RedisPatchSchedulesResponse; +module.exports = RedisPatchSchedule; diff --git a/lib/services/rediscachemanagement/lib/models/redisPatchSchedulesRequest.js b/lib/services/rediscachemanagement/lib/models/redisPatchSchedulesRequest.js deleted file mode 100644 index e48c301132..0000000000 --- a/lib/services/rediscachemanagement/lib/models/redisPatchSchedulesRequest.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -var models = require('./index'); - -var util = require('util'); - -/** - * @class - * Initializes a new instance of the RedisPatchSchedulesRequest class. - * @constructor - * Parameters to set patch schedules for redis cache. - * - * @member {array} scheduleEntries List of patch schedules for redis cache. - * - */ -function RedisPatchSchedulesRequest() { -} - -/** - * Defines the metadata of RedisPatchSchedulesRequest - * - * @returns {object} metadata of RedisPatchSchedulesRequest - * - */ -RedisPatchSchedulesRequest.prototype.mapper = function () { - return { - required: false, - serializedName: 'RedisPatchSchedulesRequest', - type: { - name: 'Composite', - className: 'RedisPatchSchedulesRequest', - modelProperties: { - scheduleEntries: { - required: true, - serializedName: 'properties.scheduleEntries', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ScheduleEntryElementType', - type: { - name: 'Composite', - className: 'ScheduleEntry' - } - } - } - } - } - } - }; -}; - -module.exports = RedisPatchSchedulesRequest; diff --git a/lib/services/rediscachemanagement/lib/models/redisRebootParameters.js b/lib/services/rediscachemanagement/lib/models/redisRebootParameters.js index d7d30d2aea..e096da6f82 100644 --- a/lib/services/rediscachemanagement/lib/models/redisRebootParameters.js +++ b/lib/services/rediscachemanagement/lib/models/redisRebootParameters.js @@ -14,14 +14,14 @@ * @class * Initializes a new instance of the RedisRebootParameters class. * @constructor - * Specifies which redis node(s) to reboot. + * Specifies which Redis node(s) to reboot. * - * @member {string} rebootType Which redis node(s) to reboot. Depending on + * @member {string} rebootType Which Redis node(s) to reboot. Depending on * this value data loss is possible. Possible values include: 'PrimaryNode', * 'SecondaryNode', 'AllNodes' * - * @member {number} [shardId] In case of cluster cache, this specifies shard - * id which should be rebooted. + * @member {number} [shardId] If clustering is enabled, the ID of the shard to + * be rebooted. * */ function RedisRebootParameters() { diff --git a/lib/services/rediscachemanagement/lib/models/redisRegenerateKeyParameters.js b/lib/services/rediscachemanagement/lib/models/redisRegenerateKeyParameters.js index 1dc553b9de..d7a8efe622 100644 --- a/lib/services/rediscachemanagement/lib/models/redisRegenerateKeyParameters.js +++ b/lib/services/rediscachemanagement/lib/models/redisRegenerateKeyParameters.js @@ -14,10 +14,10 @@ * @class * Initializes a new instance of the RedisRegenerateKeyParameters class. * @constructor - * Specifies which redis access keys to reset. + * Specifies which Redis access keys to reset. * - * @member {string} keyType Which redis access key to reset. Possible values - * include: 'Primary', 'Secondary' + * @member {string} keyType The Redis access key to regenerate. Possible + * values include: 'Primary', 'Secondary' * */ function RedisRegenerateKeyParameters() { diff --git a/lib/services/rediscachemanagement/lib/models/redisResource.js b/lib/services/rediscachemanagement/lib/models/redisResource.js index 6b5a24031e..0ac149309f 100644 --- a/lib/services/rediscachemanagement/lib/models/redisResource.js +++ b/lib/services/rediscachemanagement/lib/models/redisResource.js @@ -18,30 +18,24 @@ var util = require('util'); * @class * Initializes a new instance of the RedisResource class. * @constructor - * A single redis item in List or Get Operation. + * A single Redis item in List or Get Operation. * - * @member {string} [redisVersion] RedisVersion parameter has been deprecated. - * As such, it is no longer necessary to provide this parameter and any value - * specified is ignored. + * @member {string} [redisVersion] Redis version. * - * @member {object} sku What sku of redis cache to deploy. + * @member {string} [provisioningState] Redis instance provisioning status. * - * @member {string} [sku.name] What type of redis cache to deploy. Valid - * values: (Basic, Standard, Premium). Possible values include: 'Basic', - * 'Standard', 'Premium' + * @member {string} [hostName] Redis host name. * - * @member {string} [sku.family] Which family to use. Valid values: (C, P). - * Possible values include: 'C', 'P' + * @member {number} [port] Redis non-SSL port. * - * @member {number} [sku.capacity] What size of redis cache to deploy. Valid - * values: for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) + * @member {number} [sslPort] Redis SSL port. * * @member {object} [redisConfiguration] All Redis Settings. Few possible * keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value * etc. * - * @member {boolean} [enableNonSslPort] If the value is true, then the non-ssl - * redis server port (6379) will be enabled. + * @member {boolean} [enableNonSslPort] Specifies whether the non-ssl Redis + * server port (6379) is enabled. * * @member {object} [tenantSettings] tenantSettings * @@ -49,19 +43,24 @@ var util = require('util'); * Premium Cluster Cache. * * @member {string} [subnetId] The full resource ID of a subnet in a virtual - * network to deploy the redis cache in. Example format: + * network to deploy the Redis cache in. Example format: * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 * - * @member {string} [staticIP] Required when deploying a redis cache inside an - * existing Azure Virtual Network. + * @member {string} [staticIP] Static IP address. Required when deploying a + * Redis cache inside an existing Azure Virtual Network. * - * @member {string} [provisioningState] Redis instance provisioning status + * @member {object} sku The SKU of the Redis cache to deploy. * - * @member {string} [hostName] Redis host name + * @member {string} [sku.name] The type of Redis cache to deploy. Valid + * values: (Basic, Standard, Premium). Possible values include: 'Basic', + * 'Standard', 'Premium' * - * @member {number} [port] Redis non-ssl port + * @member {string} [sku.family] The SKU family to use. Valid values: (C, P). + * (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P' * - * @member {number} [sslPort] Redis ssl port + * @member {number} [sku.capacity] The size of the Redis cache to deploy. + * Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P + * (Premium) family (1, 2, 3, 4). * */ function RedisResource() { @@ -131,22 +130,47 @@ RedisResource.prototype.mapper = function () { }, redisVersion: { required: false, - serializedName: 'properties.redisVersion', + readOnly: true, + serializedName: 'properties.RedisVersion', type: { name: 'String' } }, - sku: { - required: true, - serializedName: 'properties.sku', + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', type: { - name: 'Composite', - className: 'Sku' + name: 'String' + } + }, + hostName: { + required: false, + readOnly: true, + serializedName: 'properties.hostName', + type: { + name: 'String' + } + }, + port: { + required: false, + readOnly: true, + serializedName: 'properties.port', + type: { + name: 'Number' + } + }, + sslPort: { + required: false, + readOnly: true, + serializedName: 'properties.sslPort', + type: { + name: 'Number' } }, redisConfiguration: { required: false, - serializedName: 'properties.redisConfiguration', + serializedName: 'properties.RedisConfiguration', type: { name: 'Dictionary', value: { @@ -206,32 +230,12 @@ RedisResource.prototype.mapper = function () { name: 'String' } }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - hostName: { - required: false, - serializedName: 'properties.hostName', - type: { - name: 'String' - } - }, - port: { - required: false, - serializedName: 'properties.port', - type: { - name: 'Number' - } - }, - sslPort: { - required: false, - serializedName: 'properties.sslPort', + sku: { + required: true, + serializedName: 'properties.sku', type: { - name: 'Number' + name: 'Composite', + className: 'Sku' } } } diff --git a/lib/services/rediscachemanagement/lib/models/redisResourceWithAccessKey.js b/lib/services/rediscachemanagement/lib/models/redisResourceWithAccessKey.js deleted file mode 100644 index 7731437de2..0000000000 --- a/lib/services/rediscachemanagement/lib/models/redisResourceWithAccessKey.js +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -var models = require('./index'); - -var util = require('util'); - -/** - * @class - * Initializes a new instance of the RedisResourceWithAccessKey class. - * @constructor - * A redis item in CreateOrUpdate Operation response. - * - * @member {string} [redisVersion] RedisVersion parameter has been deprecated. - * As such, it is no longer necessary to provide this parameter and any value - * specified is ignored. - * - * @member {object} sku What sku of redis cache to deploy. - * - * @member {string} [sku.name] What type of redis cache to deploy. Valid - * values: (Basic, Standard, Premium). Possible values include: 'Basic', - * 'Standard', 'Premium' - * - * @member {string} [sku.family] Which family to use. Valid values: (C, P). - * Possible values include: 'C', 'P' - * - * @member {number} [sku.capacity] What size of redis cache to deploy. Valid - * values: for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) - * - * @member {object} [redisConfiguration] All Redis Settings. Few possible - * keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value - * etc. - * - * @member {boolean} [enableNonSslPort] If the value is true, then the non-ssl - * redis server port (6379) will be enabled. - * - * @member {object} [tenantSettings] tenantSettings - * - * @member {number} [shardCount] The number of shards to be created on a - * Premium Cluster Cache. - * - * @member {string} [subnetId] The full resource ID of a subnet in a virtual - * network to deploy the redis cache in. Example format: - * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 - * - * @member {string} [staticIP] Required when deploying a redis cache inside an - * existing Azure Virtual Network. - * - * @member {string} [provisioningState] Redis instance provisioning status - * - * @member {string} [hostName] Redis host name - * - * @member {number} [port] Redis non-ssl port - * - * @member {number} [sslPort] Redis ssl port - * - * @member {object} [accessKeys] Redis cache access keys. - * - * @member {string} [accessKeys.primaryKey] The current primary key that - * clients can use to authenticate with redis cache. - * - * @member {string} [accessKeys.secondaryKey] The current secondary key that - * clients can use to authenticate with redis cache. - * - */ -function RedisResourceWithAccessKey() { - RedisResourceWithAccessKey['super_'].call(this); -} - -util.inherits(RedisResourceWithAccessKey, models['Resource']); - -/** - * Defines the metadata of RedisResourceWithAccessKey - * - * @returns {object} metadata of RedisResourceWithAccessKey - * - */ -RedisResourceWithAccessKey.prototype.mapper = function () { - return { - required: false, - serializedName: 'RedisResourceWithAccessKey', - type: { - name: 'Composite', - className: 'RedisResourceWithAccessKey', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: true, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - redisVersion: { - required: false, - serializedName: 'properties.redisVersion', - type: { - name: 'String' - } - }, - sku: { - required: true, - serializedName: 'properties.sku', - type: { - name: 'Composite', - className: 'Sku' - } - }, - redisConfiguration: { - required: false, - serializedName: 'properties.redisConfiguration', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - enableNonSslPort: { - required: false, - serializedName: 'properties.enableNonSslPort', - type: { - name: 'Boolean' - } - }, - tenantSettings: { - required: false, - serializedName: 'properties.tenantSettings', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - shardCount: { - required: false, - serializedName: 'properties.shardCount', - type: { - name: 'Number' - } - }, - subnetId: { - required: false, - serializedName: 'properties.subnetId', - constraints: { - Pattern: '^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$' - }, - type: { - name: 'String' - } - }, - staticIP: { - required: false, - serializedName: 'properties.staticIP', - constraints: { - Pattern: '^\d+\.\d+\.\d+\.\d+$' - }, - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - hostName: { - required: false, - serializedName: 'properties.hostName', - type: { - name: 'String' - } - }, - port: { - required: false, - serializedName: 'properties.port', - type: { - name: 'Number' - } - }, - sslPort: { - required: false, - serializedName: 'properties.sslPort', - type: { - name: 'Number' - } - }, - accessKeys: { - required: false, - serializedName: 'properties.accessKeys', - type: { - name: 'Composite', - className: 'RedisAccessKeys' - } - } - } - } - }; -}; - -module.exports = RedisResourceWithAccessKey; diff --git a/lib/services/rediscachemanagement/lib/models/redisProperties.js b/lib/services/rediscachemanagement/lib/models/redisUpdateParameters.js similarity index 61% rename from lib/services/rediscachemanagement/lib/models/redisProperties.js rename to lib/services/rediscachemanagement/lib/models/redisUpdateParameters.js index f268a06b6a..1271fdf97a 100644 --- a/lib/services/rediscachemanagement/lib/models/redisProperties.js +++ b/lib/services/rediscachemanagement/lib/models/redisUpdateParameters.js @@ -14,32 +14,16 @@ var models = require('./index'); /** * @class - * Initializes a new instance of the RedisProperties class. + * Initializes a new instance of the RedisUpdateParameters class. * @constructor - * Properties supplied to CreateOrUpdate redis operation. + * Parameters supplied to the Update Redis operation. * - * @member {string} [redisVersion] RedisVersion parameter has been deprecated. - * As such, it is no longer necessary to provide this parameter and any value - * specified is ignored. - * - * @member {object} sku What sku of redis cache to deploy. - * - * @member {string} [sku.name] What type of redis cache to deploy. Valid - * values: (Basic, Standard, Premium). Possible values include: 'Basic', - * 'Standard', 'Premium' - * - * @member {string} [sku.family] Which family to use. Valid values: (C, P). - * Possible values include: 'C', 'P' - * - * @member {number} [sku.capacity] What size of redis cache to deploy. Valid - * values: for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) - * * @member {object} [redisConfiguration] All Redis Settings. Few possible * keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value * etc. * - * @member {boolean} [enableNonSslPort] If the value is true, then the non-ssl - * redis server port (6379) will be enabled. + * @member {boolean} [enableNonSslPort] Specifies whether the non-ssl Redis + * server port (6379) is enabled. * * @member {object} [tenantSettings] tenantSettings * @@ -47,48 +31,48 @@ var models = require('./index'); * Premium Cluster Cache. * * @member {string} [subnetId] The full resource ID of a subnet in a virtual - * network to deploy the redis cache in. Example format: + * network to deploy the Redis cache in. Example format: * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 * - * @member {string} [staticIP] Required when deploying a redis cache inside an - * existing Azure Virtual Network. + * @member {string} [staticIP] Static IP address. Required when deploying a + * Redis cache inside an existing Azure Virtual Network. + * + * @member {object} [sku] The SKU of the Redis cache to deploy. + * + * @member {string} [sku.name] The type of Redis cache to deploy. Valid + * values: (Basic, Standard, Premium). Possible values include: 'Basic', + * 'Standard', 'Premium' + * + * @member {string} [sku.family] The SKU family to use. Valid values: (C, P). + * (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P' + * + * @member {number} [sku.capacity] The size of the Redis cache to deploy. + * Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P + * (Premium) family (1, 2, 3, 4). + * + * @member {object} [tags] Resource tags. * */ -function RedisProperties() { +function RedisUpdateParameters() { } /** - * Defines the metadata of RedisProperties + * Defines the metadata of RedisUpdateParameters * - * @returns {object} metadata of RedisProperties + * @returns {object} metadata of RedisUpdateParameters * */ -RedisProperties.prototype.mapper = function () { +RedisUpdateParameters.prototype.mapper = function () { return { required: false, - serializedName: 'RedisProperties', + serializedName: 'RedisUpdateParameters', type: { name: 'Composite', - className: 'RedisProperties', + className: 'RedisUpdateParameters', modelProperties: { - redisVersion: { - required: false, - serializedName: 'redisVersion', - type: { - name: 'String' - } - }, - sku: { - required: true, - serializedName: 'sku', - type: { - name: 'Composite', - className: 'Sku' - } - }, redisConfiguration: { required: false, - serializedName: 'redisConfiguration', + serializedName: 'properties.RedisConfiguration', type: { name: 'Dictionary', value: { @@ -102,14 +86,14 @@ RedisProperties.prototype.mapper = function () { }, enableNonSslPort: { required: false, - serializedName: 'enableNonSslPort', + serializedName: 'properties.enableNonSslPort', type: { name: 'Boolean' } }, tenantSettings: { required: false, - serializedName: 'tenantSettings', + serializedName: 'properties.tenantSettings', type: { name: 'Dictionary', value: { @@ -123,14 +107,14 @@ RedisProperties.prototype.mapper = function () { }, shardCount: { required: false, - serializedName: 'shardCount', + serializedName: 'properties.shardCount', type: { name: 'Number' } }, subnetId: { required: false, - serializedName: 'subnetId', + serializedName: 'properties.subnetId', constraints: { Pattern: '^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$' }, @@ -140,17 +124,39 @@ RedisProperties.prototype.mapper = function () { }, staticIP: { required: false, - serializedName: 'staticIP', + serializedName: 'properties.staticIP', constraints: { Pattern: '^\d+\.\d+\.\d+\.\d+$' }, type: { name: 'String' } + }, + sku: { + required: false, + serializedName: 'properties.sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + tags: { + required: false, + serializedName: 'properties.tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } } } } }; }; -module.exports = RedisProperties; +module.exports = RedisUpdateParameters; diff --git a/lib/services/rediscachemanagement/lib/models/resource.js b/lib/services/rediscachemanagement/lib/models/resource.js index 13827d365a..491d5d708d 100644 --- a/lib/services/rediscachemanagement/lib/models/resource.js +++ b/lib/services/rediscachemanagement/lib/models/resource.js @@ -18,15 +18,17 @@ var util = require('util'); * @class * Initializes a new instance of the Resource class. * @constructor - * @member {string} [id] Resource Id + * The Resource definition. + * + * @member {string} [id] Resource ID. * - * @member {string} [name] Resource name + * @member {string} [name] Resource name. * - * @member {string} [type] Resource type + * @member {string} [type] Resource type. * - * @member {string} location Resource location + * @member {string} location Resource location. * - * @member {object} [tags] Resource tags + * @member {object} [tags] Resource tags. * */ function Resource() { diff --git a/lib/services/rediscachemanagement/lib/models/scheduleEntry.js b/lib/services/rediscachemanagement/lib/models/scheduleEntry.js index b6987b34b5..963f0f3e1a 100644 --- a/lib/services/rediscachemanagement/lib/models/scheduleEntry.js +++ b/lib/services/rediscachemanagement/lib/models/scheduleEntry.js @@ -14,9 +14,11 @@ * @class * Initializes a new instance of the ScheduleEntry class. * @constructor - * @member {string} dayOfWeek Day of week when cache can be patched. Possible - * values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', - * 'Saturday', 'Sunday' + * Patch schedule entry for a Premium Redis Cache. + * + * @member {string} dayOfWeek Day of the week when a cache can be patched. + * Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', + * 'Friday', 'Saturday', 'Sunday', 'Everyday', 'Weekend' * * @member {number} startHourUtc Start hour after which cache patching can * start. @@ -46,7 +48,8 @@ ScheduleEntry.prototype.mapper = function () { required: true, serializedName: 'dayOfWeek', type: { - name: 'String' + name: 'Enum', + allowedValues: [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Everyday', 'Weekend' ] } }, startHourUtc: { diff --git a/lib/services/rediscachemanagement/lib/models/sku.js b/lib/services/rediscachemanagement/lib/models/sku.js index c5bf3f50ff..df76219b36 100644 --- a/lib/services/rediscachemanagement/lib/models/sku.js +++ b/lib/services/rediscachemanagement/lib/models/sku.js @@ -14,17 +14,18 @@ * @class * Initializes a new instance of the Sku class. * @constructor - * Sku parameters supplied to the create redis operation. + * SKU parameters supplied to the create Redis operation. * - * @member {string} name What type of redis cache to deploy. Valid values: + * @member {string} name The type of Redis cache to deploy. Valid values: * (Basic, Standard, Premium). Possible values include: 'Basic', 'Standard', * 'Premium' * - * @member {string} family Which family to use. Valid values: (C, P). Possible - * values include: 'C', 'P' + * @member {string} family The SKU family to use. Valid values: (C, P). (C = + * Basic/Standard, P = Premium). Possible values include: 'C', 'P' * - * @member {number} capacity What size of redis cache to deploy. Valid values: - * for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) + * @member {number} capacity The size of the Redis cache to deploy. Valid + * values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P + * (Premium) family (1, 2, 3, 4). * */ function Sku() { diff --git a/lib/services/rediscachemanagement/lib/operations/index.d.ts b/lib/services/rediscachemanagement/lib/operations/index.d.ts index 0289d26735..75050a50f2 100644 --- a/lib/services/rediscachemanagement/lib/operations/index.d.ts +++ b/lib/services/rediscachemanagement/lib/operations/index.d.ts @@ -21,39 +21,82 @@ import * as models from '../models'; export interface Redis { /** - * Create a redis cache, or replace (overwrite/recreate, with potential - * downtime) an existing cache + * Create or replace (overwrite/recreate, with potential downtime) an existing + * Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {object} parameters Parameters supplied to the CreateOrUpdate redis + * @param {object} parameters Parameters supplied to the Create Redis * operation. * - * @param {string} [parameters.redisVersion] RedisVersion parameter has been - * deprecated. As such, it is no longer necessary to provide this parameter - * and any value specified is ignored. + * @param {object} [parameters.redisConfiguration] All Redis Settings. Few + * possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @param {boolean} [parameters.enableNonSslPort] Specifies whether the + * non-ssl Redis server port (6379) is enabled. * - * @param {object} parameters.sku What sku of redis cache to deploy. + * @param {object} [parameters.tenantSettings] tenantSettings + * + * @param {number} [parameters.shardCount] The number of shards to be created + * on a Premium Cluster Cache. * - * @param {string} parameters.sku.name What type of redis cache to deploy. + * @param {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + * + * @param {string} [parameters.staticIP] Static IP address. Required when + * deploying a Redis cache inside an existing Azure Virtual Network. + * + * @param {object} parameters.sku The SKU of the Redis cache to deploy. + * + * @param {string} parameters.sku.name The type of Redis cache to deploy. * Valid values: (Basic, Standard, Premium). Possible values include: * 'Basic', 'Standard', 'Premium' * - * @param {string} parameters.sku.family Which family to use. Valid values: - * (C, P). Possible values include: 'C', 'P' + * @param {string} parameters.sku.family The SKU family to use. Valid values: + * (C, P). (C = Basic/Standard, P = Premium). Possible values include: 'C', + * 'P' + * + * @param {number} parameters.sku.capacity The size of the Redis cache to + * deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), + * for P (Premium) family (1, 2, 3, 4). * - * @param {number} parameters.sku.capacity What size of redis cache to deploy. - * Valid values: for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + create(resourceGroupName: string, name: string, parameters: models.RedisCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(resourceGroupName: string, name: string, parameters: models.RedisCreateParameters, callback: ServiceCallback): void; + + /** + * Update an existing Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {object} parameters Parameters supplied to the Update Redis + * operation. * * @param {object} [parameters.redisConfiguration] All Redis Settings. Few * possible keys: * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value * etc. * - * @param {boolean} [parameters.enableNonSslPort] If the value is true, then - * the non-ssl redis server port (6379) will be enabled. + * @param {boolean} [parameters.enableNonSslPort] Specifies whether the + * non-ssl Redis server port (6379) is enabled. * * @param {object} [parameters.tenantSettings] tenantSettings * @@ -61,15 +104,27 @@ export interface Redis { * on a Premium Cluster Cache. * * @param {string} [parameters.subnetId] The full resource ID of a subnet in a - * virtual network to deploy the redis cache in. Example format: + * virtual network to deploy the Redis cache in. Example format: * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 * - * @param {string} [parameters.staticIP] Required when deploying a redis cache - * inside an existing Azure Virtual Network. + * @param {string} [parameters.staticIP] Static IP address. Required when + * deploying a Redis cache inside an existing Azure Virtual Network. + * + * @param {object} [parameters.sku] The SKU of the Redis cache to deploy. * - * @param {string} parameters.location Resource location + * @param {string} parameters.sku.name The type of Redis cache to deploy. + * Valid values: (Basic, Standard, Premium). Possible values include: + * 'Basic', 'Standard', 'Premium' + * + * @param {string} parameters.sku.family The SKU family to use. Valid values: + * (C, P). (C = Basic/Standard, P = Premium). Possible values include: 'C', + * 'P' * - * @param {object} [parameters.tags] Resource tags + * @param {number} parameters.sku.capacity The size of the Redis cache to + * deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), + * for P (Premium) family (1, 2, 3, 4). + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -79,15 +134,15 @@ export interface Redis { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - createOrUpdate(resourceGroupName: string, name: string, parameters: models.RedisCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, name: string, parameters: models.RedisCreateOrUpdateParameters, callback: ServiceCallback): void; + update(resourceGroupName: string, name: string, parameters: models.RedisUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, name: string, parameters: models.RedisUpdateParameters, callback: ServiceCallback): void; /** - * Deletes a redis cache. This operation takes a while to complete. + * Deletes a Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * * @param {object} [options] Optional Parameters. * @@ -101,11 +156,11 @@ export interface Redis { deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; /** - * Gets a redis cache (resource description). + * Gets a Redis cache (resource description). * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * * @param {object} [options] Optional Parameters. * @@ -119,7 +174,7 @@ export interface Redis { get(resourceGroupName: string, name: string, callback: ServiceCallback): void; /** - * Gets all redis caches in a resource group. + * Lists all Redis caches in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -135,7 +190,7 @@ export interface Redis { listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; /** - * Gets all redis caches in the specified subscription. + * Gets all Redis caches in the specified subscription. * * @param {object} [options] Optional Parameters. * @@ -149,12 +204,12 @@ export interface Redis { list(callback: ServiceCallback): void; /** - * Retrieve a redis cache's access keys. This operation requires write + * Retrieve a Redis cache's access keys. This operation requires write * permission to the cache resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * * @param {object} [options] Optional Parameters. * @@ -164,18 +219,18 @@ export interface Redis { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - listKeys(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - listKeys(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listKeys(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listKeys(resourceGroupName: string, name: string, callback: ServiceCallback): void; /** - * Regenerate redis cache's access keys. This operation requires write + * Regenerate Redis cache's access keys. This operation requires write * permission to the cache resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {string} keyType Which redis access key to reset. Possible values + * @param {string} keyType The Redis access key to regenerate. Possible values * include: 'Primary', 'Secondary' * * @param {object} [options] Optional Parameters. @@ -186,25 +241,25 @@ export interface Redis { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - regenerateKey(resourceGroupName: string, name: string, keyType: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - regenerateKey(resourceGroupName: string, name: string, keyType: string, callback: ServiceCallback): void; + regenerateKey(resourceGroupName: string, name: string, keyType: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + regenerateKey(resourceGroupName: string, name: string, keyType: string, callback: ServiceCallback): void; /** - * Reboot specified redis node(s). This operation requires write permission to + * Reboot specified Redis node(s). This operation requires write permission to * the cache resource. There can be potential data loss. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {object} parameters Specifies which redis node(s) to reboot. + * @param {object} parameters Specifies which Redis node(s) to reboot. * - * @param {string} parameters.rebootType Which redis node(s) to reboot. + * @param {string} parameters.rebootType Which Redis node(s) to reboot. * Depending on this value data loss is possible. Possible values include: * 'PrimaryNode', 'SecondaryNode', 'AllNodes' * - * @param {number} [parameters.shardId] In case of cluster cache, this - * specifies shard id which should be rebooted. + * @param {number} [parameters.shardId] If clustering is enabled, the ID of + * the shard to be rebooted. * * @param {object} [options] Optional Parameters. * @@ -218,17 +273,17 @@ export interface Redis { forceReboot(resourceGroupName: string, name: string, parameters: models.RedisRebootParameters, callback: ServiceCallback): void; /** - * Import data into redis cache. + * Import data into Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {object} parameters Parameters for redis import operation. + * @param {object} parameters Parameters for Redis import operation. * * @param {string} [parameters.format] File format. * - * @param {array} parameters.files files to import + * @param {array} parameters.files files to import. * * @param {object} [options] Optional Parameters. * @@ -238,21 +293,23 @@ export interface Redis { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - importMethod(resourceGroupName: string, name: string, parameters: models.ImportRDBParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - importMethod(resourceGroupName: string, name: string, parameters: models.ImportRDBParameters, callback: ServiceCallback): void; + importData(resourceGroupName: string, name: string, parameters: models.ImportRDBParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + importData(resourceGroupName: string, name: string, parameters: models.ImportRDBParameters, callback: ServiceCallback): void; /** - * Import data into redis cache. + * Import data into Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {object} parameters Parameters for redis import operation. + * @param {object} parameters Parameters for Redis export operation. * * @param {string} [parameters.format] File format. * - * @param {array} parameters.files files to import + * @param {string} parameters.prefix Prefix to use for exported files. + * + * @param {string} parameters.container Container name to export to. * * @param {object} [options] Optional Parameters. * @@ -262,23 +319,156 @@ export interface Redis { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginImportMethod(resourceGroupName: string, name: string, parameters: models.ImportRDBParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginImportMethod(resourceGroupName: string, name: string, parameters: models.ImportRDBParameters, callback: ServiceCallback): void; + exportData(resourceGroupName: string, name: string, parameters: models.ExportRDBParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + exportData(resourceGroupName: string, name: string, parameters: models.ExportRDBParameters, callback: ServiceCallback): void; /** - * Import data into redis cache. + * Create or replace (overwrite/recreate, with potential downtime) an existing + * Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {object} parameters Parameters for redis export operation. + * @param {object} parameters Parameters supplied to the Create Redis + * operation. * - * @param {string} [parameters.format] File format. + * @param {object} [parameters.redisConfiguration] All Redis Settings. Few + * possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. * - * @param {string} parameters.prefix Prifix to use for exported files. + * @param {boolean} [parameters.enableNonSslPort] Specifies whether the + * non-ssl Redis server port (6379) is enabled. * - * @param {string} parameters.container Container name to export to. + * @param {object} [parameters.tenantSettings] tenantSettings + * + * @param {number} [parameters.shardCount] The number of shards to be created + * on a Premium Cluster Cache. + * + * @param {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + * + * @param {string} [parameters.staticIP] Static IP address. Required when + * deploying a Redis cache inside an existing Azure Virtual Network. + * + * @param {object} parameters.sku The SKU of the Redis cache to deploy. + * + * @param {string} parameters.sku.name The type of Redis cache to deploy. + * Valid values: (Basic, Standard, Premium). Possible values include: + * 'Basic', 'Standard', 'Premium' + * + * @param {string} parameters.sku.family The SKU family to use. Valid values: + * (C, P). (C = Basic/Standard, P = Premium). Possible values include: 'C', + * 'P' + * + * @param {number} parameters.sku.capacity The size of the Redis cache to + * deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), + * for P (Premium) family (1, 2, 3, 4). + * + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + beginCreate(resourceGroupName: string, name: string, parameters: models.RedisCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, name: string, parameters: models.RedisCreateParameters, callback: ServiceCallback): void; + + /** + * Update an existing Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {object} parameters Parameters supplied to the Update Redis + * operation. + * + * @param {object} [parameters.redisConfiguration] All Redis Settings. Few + * possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @param {boolean} [parameters.enableNonSslPort] Specifies whether the + * non-ssl Redis server port (6379) is enabled. + * + * @param {object} [parameters.tenantSettings] tenantSettings + * + * @param {number} [parameters.shardCount] The number of shards to be created + * on a Premium Cluster Cache. + * + * @param {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + * + * @param {string} [parameters.staticIP] Static IP address. Required when + * deploying a Redis cache inside an existing Azure Virtual Network. + * + * @param {object} [parameters.sku] The SKU of the Redis cache to deploy. + * + * @param {string} parameters.sku.name The type of Redis cache to deploy. + * Valid values: (Basic, Standard, Premium). Possible values include: + * 'Basic', 'Standard', 'Premium' + * + * @param {string} parameters.sku.family The SKU family to use. Valid values: + * (C, P). (C = Basic/Standard, P = Premium). Possible values include: 'C', + * 'P' + * + * @param {number} parameters.sku.capacity The size of the Redis cache to + * deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), + * for P (Premium) family (1, 2, 3, 4). + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + beginUpdate(resourceGroupName: string, name: string, parameters: models.RedisUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, name: string, parameters: models.RedisUpdateParameters, callback: ServiceCallback): void; + + /** + * Deletes a Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + beginDeleteMethod(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; + + /** + * Import data into Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {object} parameters Parameters for Redis import operation. + * + * @param {string} [parameters.format] File format. + * + * @param {array} parameters.files files to import. * * @param {object} [options] Optional Parameters. * @@ -288,21 +478,21 @@ export interface Redis { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - exportMethod(resourceGroupName: string, name: string, parameters: models.ExportRDBParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - exportMethod(resourceGroupName: string, name: string, parameters: models.ExportRDBParameters, callback: ServiceCallback): void; + beginImportData(resourceGroupName: string, name: string, parameters: models.ImportRDBParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginImportData(resourceGroupName: string, name: string, parameters: models.ImportRDBParameters, callback: ServiceCallback): void; /** - * Import data into redis cache. + * Import data into Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {object} parameters Parameters for redis export operation. + * @param {object} parameters Parameters for Redis export operation. * * @param {string} [parameters.format] File format. * - * @param {string} parameters.prefix Prifix to use for exported files. + * @param {string} parameters.prefix Prefix to use for exported files. * * @param {string} parameters.container Container name to export to. * @@ -314,11 +504,11 @@ export interface Redis { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginExportMethod(resourceGroupName: string, name: string, parameters: models.ExportRDBParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginExportMethod(resourceGroupName: string, name: string, parameters: models.ExportRDBParameters, callback: ServiceCallback): void; + beginExportData(resourceGroupName: string, name: string, parameters: models.ExportRDBParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginExportData(resourceGroupName: string, name: string, parameters: models.ExportRDBParameters, callback: ServiceCallback): void; /** - * Gets all redis caches in a resource group. + * Lists all Redis caches in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -335,7 +525,7 @@ export interface Redis { listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; /** - * Gets all redis caches in the specified subscription. + * Gets all Redis caches in the specified subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -361,13 +551,13 @@ export interface Redis { export interface PatchSchedules { /** - * Create or replace the patching schedule for redis cache. + * Create or replace the patching schedule for Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {array} scheduleEntries List of patch schedules for redis cache. + * @param {array} scheduleEntries List of patch schedules for a Redis cache. * * @param {object} [options] Optional Parameters. * @@ -377,15 +567,15 @@ export interface PatchSchedules { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - createOrUpdate(resourceGroupName: string, name: string, scheduleEntries: models.ScheduleEntry[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, name: string, scheduleEntries: models.ScheduleEntry[], callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, scheduleEntries: models.ScheduleEntry[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, scheduleEntries: models.ScheduleEntry[], callback: ServiceCallback): void; /** - * Deletes the patching schedule for redis cache. + * Deletes the patching schedule for Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * * @param {object} [options] Optional Parameters. * @@ -399,11 +589,11 @@ export interface PatchSchedules { deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; /** - * Gets the patching schedule for redis cache. + * Gets the patching schedule for Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * * @param {object} [options] Optional Parameters. * @@ -413,6 +603,6 @@ export interface PatchSchedules { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - get(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - get(resourceGroupName: string, name: string, callback: ServiceCallback): void; + get(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, name: string, callback: ServiceCallback): void; } diff --git a/lib/services/rediscachemanagement/lib/operations/patchSchedules.js b/lib/services/rediscachemanagement/lib/operations/patchSchedules.js index 11654c3821..84b77bf826 100644 --- a/lib/services/rediscachemanagement/lib/operations/patchSchedules.js +++ b/lib/services/rediscachemanagement/lib/operations/patchSchedules.js @@ -30,13 +30,13 @@ function PatchSchedules(client) { } /** - * Create or replace the patching schedule for redis cache. + * Create or replace the patching schedule for Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {array} scheduleEntries List of patch schedules for redis cache. + * @param {array} scheduleEntries List of patch schedules for a Redis cache. * * @param {object} [options] Optional Parameters. * @@ -50,8 +50,7 @@ function PatchSchedules(client) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link RedisPatchSchedulesResponse} for more - * information. + * See {@link RedisPatchSchedule} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -86,21 +85,22 @@ PatchSchedules.prototype.createOrUpdate = function (resourceGroupName, name, sch } catch (error) { return callback(error); } - var parameters; - if (scheduleEntries !== null && scheduleEntries !== undefined) { - parameters = new client.models['RedisPatchSchedulesRequest'](); + var parameters = new client.models['RedisPatchSchedule'](); + try { + if (scheduleEntries !== null && scheduleEntries !== undefined) + { parameters.scheduleEntries = scheduleEntries; + } + } catch (error) { + return callback(error); } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -132,7 +132,7 @@ PatchSchedules.prototype.createOrUpdate = function (resourceGroupName, name, sch var requestModel = null; try { if (parameters !== null && parameters !== undefined) { - var requestModelMapper = new client.models['RedisPatchSchedulesRequest']().mapper(); + var requestModelMapper = new client.models['RedisPatchSchedule']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -183,7 +183,7 @@ PatchSchedules.prototype.createOrUpdate = function (resourceGroupName, name, sch parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['RedisPatchSchedulesResponse']().mapper(); + var resultMapper = new client.models['RedisPatchSchedule']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -199,11 +199,11 @@ PatchSchedules.prototype.createOrUpdate = function (resourceGroupName, name, sch }; /** - * Deletes the patching schedule for redis cache. + * Deletes the patching schedule for Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * * @param {object} [options] Optional Parameters. * @@ -253,14 +253,11 @@ PatchSchedules.prototype.deleteMethod = function (resourceGroupName, name, optio } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -324,11 +321,11 @@ PatchSchedules.prototype.deleteMethod = function (resourceGroupName, name, optio }; /** - * Gets the patching schedule for redis cache. + * Gets the patching schedule for Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * * @param {object} [options] Optional Parameters. * @@ -342,8 +339,7 @@ PatchSchedules.prototype.deleteMethod = function (resourceGroupName, name, optio * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link RedisPatchSchedulesResponse} for more - * information. + * See {@link RedisPatchSchedule} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -380,14 +376,11 @@ PatchSchedules.prototype.get = function (resourceGroupName, name, options, callb } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -421,7 +414,7 @@ PatchSchedules.prototype.get = function (resourceGroupName, name, options, callb return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -456,7 +449,7 @@ PatchSchedules.prototype.get = function (resourceGroupName, name, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['RedisPatchSchedulesResponse']().mapper(); + var resultMapper = new client.models['RedisPatchSchedule']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { diff --git a/lib/services/rediscachemanagement/lib/operations/redis.js b/lib/services/rediscachemanagement/lib/operations/redis.js index a6a20d597b..1a84bf89bc 100644 --- a/lib/services/rediscachemanagement/lib/operations/redis.js +++ b/lib/services/rediscachemanagement/lib/operations/redis.js @@ -30,39 +30,141 @@ function Redis(client) { } /** - * Create a redis cache, or replace (overwrite/recreate, with potential - * downtime) an existing cache + * + * Create or replace (overwrite/recreate, with potential downtime) an existing + * Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {object} parameters Parameters supplied to the CreateOrUpdate redis + * @param {object} parameters Parameters supplied to the Create Redis * operation. * - * @param {string} [parameters.redisVersion] RedisVersion parameter has been - * deprecated. As such, it is no longer necessary to provide this parameter - * and any value specified is ignored. + * @param {object} [parameters.redisConfiguration] All Redis Settings. Few + * possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @param {boolean} [parameters.enableNonSslPort] Specifies whether the + * non-ssl Redis server port (6379) is enabled. * - * @param {object} parameters.sku What sku of redis cache to deploy. + * @param {object} [parameters.tenantSettings] tenantSettings + * + * @param {number} [parameters.shardCount] The number of shards to be created + * on a Premium Cluster Cache. + * + * @param {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 * - * @param {string} parameters.sku.name What type of redis cache to deploy. + * @param {string} [parameters.staticIP] Static IP address. Required when + * deploying a Redis cache inside an existing Azure Virtual Network. + * + * @param {object} parameters.sku The SKU of the Redis cache to deploy. + * + * @param {string} parameters.sku.name The type of Redis cache to deploy. * Valid values: (Basic, Standard, Premium). Possible values include: * 'Basic', 'Standard', 'Premium' * - * @param {string} parameters.sku.family Which family to use. Valid values: - * (C, P). Possible values include: 'C', 'P' + * @param {string} parameters.sku.family The SKU family to use. Valid values: + * (C, P). (C = Basic/Standard, P = Premium). Possible values include: 'C', + * 'P' + * + * @param {number} parameters.sku.capacity The size of the Redis cache to + * deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), + * for P (Premium) family (1, 2, 3, 4). + * + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. * - * @param {number} parameters.sku.capacity What size of redis cache to deploy. - * Valid values: for C family (0, 1, 2, 3, 4, 5, 6), for P family (1, 2, 3, 4) + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link RedisResource} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Redis.prototype.create = function (resourceGroupName, name, parameters, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, name, parameters, options, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['RedisResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +}; + +/** + * + * Update an existing Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {object} parameters Parameters supplied to the Update Redis + * operation. * * @param {object} [parameters.redisConfiguration] All Redis Settings. Few * possible keys: * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value * etc. * - * @param {boolean} [parameters.enableNonSslPort] If the value is true, then - * the non-ssl redis server port (6379) will be enabled. + * @param {boolean} [parameters.enableNonSslPort] Specifies whether the + * non-ssl Redis server port (6379) is enabled. * * @param {object} [parameters.tenantSettings] tenantSettings * @@ -70,15 +172,163 @@ function Redis(client) { * on a Premium Cluster Cache. * * @param {string} [parameters.subnetId] The full resource ID of a subnet in a - * virtual network to deploy the redis cache in. Example format: + * virtual network to deploy the Redis cache in. Example format: * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 * - * @param {string} [parameters.staticIP] Required when deploying a redis cache - * inside an existing Azure Virtual Network. + * @param {string} [parameters.staticIP] Static IP address. Required when + * deploying a Redis cache inside an existing Azure Virtual Network. + * + * @param {object} [parameters.sku] The SKU of the Redis cache to deploy. + * + * @param {string} parameters.sku.name The type of Redis cache to deploy. + * Valid values: (Basic, Standard, Premium). Possible values include: + * 'Basic', 'Standard', 'Premium' + * + * @param {string} parameters.sku.family The SKU family to use. Valid values: + * (C, P). (C = Basic/Standard, P = Premium). Possible values include: 'C', + * 'P' * - * @param {string} parameters.location Resource location + * @param {number} parameters.sku.capacity The size of the Redis cache to + * deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), + * for P (Premium) family (1, 2, 3, 4). + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link RedisResource} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Redis.prototype.update = function (resourceGroupName, name, parameters, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, name, parameters, options, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['RedisResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +}; + +/** + * + * Deletes a Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Redis.prototype.deleteMethod = function (resourceGroupName, name, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, name, options, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +}; + +/** + * Gets a Redis cache (resource description). + * + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.tags] Resource tags + * @param {string} name The name of the Redis cache. * * @param {object} [options] Optional Parameters. * @@ -92,14 +342,13 @@ function Redis(client) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link RedisResourceWithAccessKey} for more - * information. + * See {@link RedisResource} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, options, callback) { +Redis.prototype.get = function (resourceGroupName, name, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -116,9 +365,6 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } @@ -133,14 +379,11 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -149,7 +392,7 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -167,28 +410,14 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - // Serialize Request - var requestContent = null; - var requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - var requestModelMapper = new client.models['RedisCreateOrUpdateParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + - 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -217,13 +446,13 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, var result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { var parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['RedisResourceWithAccessKey']().mapper(); + var resultMapper = new client.models['RedisResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -233,6 +462,127 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, return callback(deserializationError); } } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Lists all Redis caches in a resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link RedisListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Redis.prototype.listByResourceGroup = function (resourceGroupName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { var parsedResponse = null; @@ -240,14 +590,14 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['RedisResourceWithAccessKey']().mapper(); + var resultMapper = new client.models['RedisListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { - var deserializationError1 = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); } } @@ -256,12 +606,8 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, }; /** - * Deletes a redis cache. This operation takes a while to complete. + * Gets all Redis caches in the specified subscription. * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} name The name of the redis cache. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -273,13 +619,14 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object. + * {object} [result] - The deserialized result object. + * See {@link RedisListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.deleteMethod = function (resourceGroupName, name, options, callback) { +Redis.prototype.list = function (options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -290,12 +637,6 @@ Redis.prototype.deleteMethod = function (resourceGroupName, name, options, callb } // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } @@ -310,14 +651,9 @@ Redis.prototype.deleteMethod = function (resourceGroupName, name, options, callb } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -326,7 +662,7 @@ Redis.prototype.deleteMethod = function (resourceGroupName, name, options, callb // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -351,7 +687,7 @@ Redis.prototype.deleteMethod = function (resourceGroupName, name, options, callb return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -365,6 +701,10 @@ Redis.prototype.deleteMethod = function (resourceGroupName, name, options, callb if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -375,17 +715,35 @@ Redis.prototype.deleteMethod = function (resourceGroupName, name, options, callb // Create Result var result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['RedisListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); }; /** - * Gets a redis cache (resource description). + * Retrieve a Redis cache's access keys. This operation requires write + * permission to the cache resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * * @param {object} [options] Optional Parameters. * @@ -399,13 +757,13 @@ Redis.prototype.deleteMethod = function (resourceGroupName, name, options, callb * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link RedisResource} for more information. + * See {@link RedisAccessKeys} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.get = function (resourceGroupName, name, options, callback) { +Redis.prototype.listKeys = function (resourceGroupName, name, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -436,14 +794,11 @@ Redis.prototype.get = function (resourceGroupName, name, options, callback) { } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -452,7 +807,7 @@ Redis.prototype.get = function (resourceGroupName, name, options, callback) { // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -512,7 +867,7 @@ Redis.prototype.get = function (resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['RedisResource']().mapper(); + var resultMapper = new client.models['RedisAccessKeys']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -528,10 +883,16 @@ Redis.prototype.get = function (resourceGroupName, name, options, callback) { }; /** - * Gets all redis caches in a resource group. + * Regenerate Redis cache's access keys. This operation requires write + * permission to the cache resource. * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} name The name of the Redis cache. + * + * @param {string} keyType The Redis access key to regenerate. Possible values + * include: 'Primary', 'Secondary' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -544,13 +905,13 @@ Redis.prototype.get = function (resourceGroupName, name, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link RedisListResult} for more information. + * See {@link RedisAccessKeys} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.listByResourceGroup = function (resourceGroupName, options, callback) { +Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -564,27 +925,41 @@ Redis.prototype.listByResourceGroup = function (resourceGroupName, options, call if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (keyType) { + var allowedValues = [ 'Primary', 'Secondary' ]; + if (!allowedValues.some( function(item) { return item === keyType; })) { + throw new Error(keyType + ' is not a valid value. The valid values are: ' + allowedValues); + } + } else { + throw new Error('keyType cannot be null or undefined.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } + var parameters; + if (keyType !== null && keyType !== undefined) { + parameters = new client.models['RedisRegenerateKeyParameters'](); + parameters.keyType = keyType; + } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -593,7 +968,7 @@ Redis.prototype.listByResourceGroup = function (resourceGroupName, options, call // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -611,7 +986,21 @@ Redis.prototype.listByResourceGroup = function (resourceGroupName, options, call } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - httpRequest.body = null; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['RedisRegenerateKeyParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { @@ -653,7 +1042,7 @@ Redis.prototype.listByResourceGroup = function (resourceGroupName, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['RedisListResult']().mapper(); + var resultMapper = new client.models['RedisAccessKeys']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -669,8 +1058,22 @@ Redis.prototype.listByResourceGroup = function (resourceGroupName, options, call }; /** - * Gets all redis caches in the specified subscription. + * Reboot specified Redis node(s). This operation requires write permission to + * the cache resource. There can be potential data loss. * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {object} parameters Specifies which Redis node(s) to reboot. + * + * @param {string} parameters.rebootType Which Redis node(s) to reboot. + * Depending on this value data loss is possible. Possible values include: + * 'PrimaryNode', 'SecondaryNode', 'AllNodes' + * + * @param {number} [parameters.shardId] If clustering is enabled, the ID of + * the shard to be rebooted. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -682,14 +1085,13 @@ Redis.prototype.listByResourceGroup = function (resourceGroupName, options, call * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object. - * See {@link RedisListResult} for more information. + * {null} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.list = function (options, callback) { +Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -700,6 +1102,15 @@ Redis.prototype.list = function (options, callback) { } // Validate try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } @@ -714,12 +1125,11 @@ Redis.prototype.list = function (options, callback) { } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -728,7 +1138,7 @@ Redis.prototype.list = function (options, callback) { // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -746,14 +1156,28 @@ Redis.prototype.list = function (options, callback) { } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - httpRequest.body = null; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['RedisRebootParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -767,10 +1191,6 @@ Redis.prototype.list = function (options, callback) { if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - var resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -781,35 +1201,195 @@ Redis.prototype.list = function (options, callback) { // Create Result var result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - var parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['RedisListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); +}; + +/** + * + * Import data into Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {object} parameters Parameters for Redis import operation. + * + * @param {string} [parameters.format] File format. + * + * @param {array} parameters.files files to import. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Redis.prototype.importData = function (resourceGroupName, name, parameters, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginImportData(resourceGroupName, name, parameters, options, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +}; + +/** + * + * Import data into Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {object} parameters Parameters for Redis export operation. + * + * @param {string} [parameters.format] File format. + * + * @param {string} parameters.prefix Prefix to use for exported files. + * + * @param {string} parameters.container Container name to export to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Redis.prototype.exportData = function (resourceGroupName, name, parameters, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginExportData(resourceGroupName, name, parameters, options, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); }); }; /** - * Retrieve a redis cache's access keys. This operation requires write - * permission to the cache resource. + * Create or replace (overwrite/recreate, with potential downtime) an existing + * Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. + * + * @param {object} parameters Parameters supplied to the Create Redis + * operation. + * + * @param {object} [parameters.redisConfiguration] All Redis Settings. Few + * possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @param {boolean} [parameters.enableNonSslPort] Specifies whether the + * non-ssl Redis server port (6379) is enabled. + * + * @param {object} [parameters.tenantSettings] tenantSettings + * + * @param {number} [parameters.shardCount] The number of shards to be created + * on a Premium Cluster Cache. + * + * @param {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + * + * @param {string} [parameters.staticIP] Static IP address. Required when + * deploying a Redis cache inside an existing Azure Virtual Network. + * + * @param {object} parameters.sku The SKU of the Redis cache to deploy. + * + * @param {string} parameters.sku.name The type of Redis cache to deploy. + * Valid values: (Basic, Standard, Premium). Possible values include: + * 'Basic', 'Standard', 'Premium' + * + * @param {string} parameters.sku.family The SKU family to use. Valid values: + * (C, P). (C = Basic/Standard, P = Premium). Possible values include: 'C', + * 'P' + * + * @param {number} parameters.sku.capacity The size of the Redis cache to + * deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), + * for P (Premium) family (1, 2, 3, 4). + * + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -823,13 +1403,13 @@ Redis.prototype.list = function (options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link RedisListKeysResult} for more information. + * See {@link RedisResource} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.listKeys = function (resourceGroupName, name, options, callback) { +Redis.prototype.beginCreate = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -846,6 +1426,9 @@ Redis.prototype.listKeys = function (resourceGroupName, name, options, callback) if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } @@ -860,14 +1443,11 @@ Redis.prototype.listKeys = function (resourceGroupName, name, options, callback) } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listKeys'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -876,7 +1456,7 @@ Redis.prototype.listKeys = function (resourceGroupName, name, options, callback) // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -894,14 +1474,28 @@ Redis.prototype.listKeys = function (resourceGroupName, name, options, callback) } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - httpRequest.body = null; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['RedisCreateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 201 && statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -936,7 +1530,7 @@ Redis.prototype.listKeys = function (resourceGroupName, name, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['RedisListKeysResult']().mapper(); + var resultMapper = new client.models['RedisResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -952,15 +1546,50 @@ Redis.prototype.listKeys = function (resourceGroupName, name, options, callback) }; /** - * Regenerate redis cache's access keys. This operation requires write - * permission to the cache resource. + * Update an existing Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {string} keyType Which redis access key to reset. Possible values - * include: 'Primary', 'Secondary' + * @param {object} parameters Parameters supplied to the Update Redis + * operation. + * + * @param {object} [parameters.redisConfiguration] All Redis Settings. Few + * possible keys: + * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value + * etc. + * + * @param {boolean} [parameters.enableNonSslPort] Specifies whether the + * non-ssl Redis server port (6379) is enabled. + * + * @param {object} [parameters.tenantSettings] tenantSettings + * + * @param {number} [parameters.shardCount] The number of shards to be created + * on a Premium Cluster Cache. + * + * @param {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + * + * @param {string} [parameters.staticIP] Static IP address. Required when + * deploying a Redis cache inside an existing Azure Virtual Network. + * + * @param {object} [parameters.sku] The SKU of the Redis cache to deploy. + * + * @param {string} parameters.sku.name The type of Redis cache to deploy. + * Valid values: (Basic, Standard, Premium). Possible values include: + * 'Basic', 'Standard', 'Premium' + * + * @param {string} parameters.sku.family The SKU family to use. Valid values: + * (C, P). (C = Basic/Standard, P = Premium). Possible values include: 'C', + * 'P' + * + * @param {number} parameters.sku.capacity The size of the Redis cache to + * deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), + * for P (Premium) family (1, 2, 3, 4). + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -974,13 +1603,13 @@ Redis.prototype.listKeys = function (resourceGroupName, name, options, callback) * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link RedisListKeysResult} for more information. + * See {@link RedisResource} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, options, callback) { +Redis.prototype.beginUpdate = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -997,41 +1626,28 @@ Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, opti if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (keyType) { - var allowedValues = [ 'Primary', 'Secondary' ]; - if (!allowedValues.some( function(item) { return item === keyType; })) { - throw new Error(keyType + ' is not a valid value. The valid values are: ' + allowedValues); - } - } else { - throw new Error('keyType cannot be null or undefined.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } - var parameters; - if (keyType !== null && keyType !== undefined) { - parameters = new client.models['RedisRegenerateKeyParameters'](); - parameters.keyType = keyType; - } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -1040,7 +1656,7 @@ Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, opti // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PATCH'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1063,7 +1679,7 @@ Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, opti var requestModel = null; try { if (parameters !== null && parameters !== undefined) { - var requestModelMapper = new client.models['RedisRegenerateKeyParameters']().mapper(); + var requestModelMapper = new client.models['RedisUpdateParameters']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -1114,7 +1730,7 @@ Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['RedisListKeysResult']().mapper(); + var resultMapper = new client.models['RedisResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1130,21 +1746,11 @@ Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, opti }; /** - * Reboot specified redis node(s). This operation requires write permission to - * the cache resource. There can be potential data loss. + * Deletes a Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. - * - * @param {object} parameters Specifies which redis node(s) to reboot. - * - * @param {string} parameters.rebootType Which redis node(s) to reboot. - * Depending on this value data loss is possible. Possible values include: - * 'PrimaryNode', 'SecondaryNode', 'AllNodes' - * - * @param {number} [parameters.shardId] In case of cluster cache, this - * specifies shard id which should be rebooted. + * @param {string} name The name of the Redis cache. * * @param {object} [options] Optional Parameters. * @@ -1163,7 +1769,7 @@ Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, opti * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, options, callback) { +Redis.prototype.beginDeleteMethod = function (resourceGroupName, name, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1180,9 +1786,6 @@ Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, opt if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } @@ -1197,14 +1800,11 @@ Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, opt } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -1213,7 +1813,7 @@ Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, opt // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'DELETE'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1231,21 +1831,7 @@ Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, opt } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - // Serialize Request - var requestContent = null; - var requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - var requestModelMapper = new client.models['RedisRebootParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + - 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { @@ -1282,84 +1868,17 @@ Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, opt }; /** - * - * Import data into redis cache. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} name The name of the redis cache. - * - * @param {object} parameters Parameters for redis import operation. - * - * @param {string} [parameters.format] File format. - * - * @param {array} parameters.files files to import - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -Redis.prototype.importMethod = function (resourceGroupName, name, parameters, options, callback) { - var client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginImportMethod(resourceGroupName, name, parameters, options, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * Import data into redis cache. + * Import data into Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {object} parameters Parameters for redis import operation. + * @param {object} parameters Parameters for Redis import operation. * * @param {string} [parameters.format] File format. * - * @param {array} parameters.files files to import + * @param {array} parameters.files files to import. * * @param {object} [options] Optional Parameters. * @@ -1378,7 +1897,7 @@ Redis.prototype.importMethod = function (resourceGroupName, name, parameters, op * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.beginImportMethod = function (resourceGroupName, name, parameters, options, callback) { +Redis.prototype.beginImportData = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1412,14 +1931,11 @@ Redis.prototype.beginImportMethod = function (resourceGroupName, name, parameter } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/import'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/import'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -1497,86 +2013,17 @@ Redis.prototype.beginImportMethod = function (resourceGroupName, name, parameter }; /** - * - * Import data into redis cache. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} name The name of the redis cache. - * - * @param {object} parameters Parameters for redis export operation. - * - * @param {string} [parameters.format] File format. - * - * @param {string} parameters.prefix Prifix to use for exported files. - * - * @param {string} parameters.container Container name to export to. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -Redis.prototype.exportMethod = function (resourceGroupName, name, parameters, options, callback) { - var client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginExportMethod(resourceGroupName, name, parameters, options, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * Import data into redis cache. + * Import data into Redis cache. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name The name of the redis cache. + * @param {string} name The name of the Redis cache. * - * @param {object} parameters Parameters for redis export operation. + * @param {object} parameters Parameters for Redis export operation. * * @param {string} [parameters.format] File format. * - * @param {string} parameters.prefix Prifix to use for exported files. + * @param {string} parameters.prefix Prefix to use for exported files. * * @param {string} parameters.container Container name to export to. * @@ -1597,7 +2044,7 @@ Redis.prototype.exportMethod = function (resourceGroupName, name, parameters, op * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.beginExportMethod = function (resourceGroupName, name, parameters, options, callback) { +Redis.prototype.beginExportData = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1631,14 +2078,11 @@ Redis.prototype.beginExportMethod = function (resourceGroupName, name, parameter } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/export'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/export'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -1716,7 +2160,7 @@ Redis.prototype.beginExportMethod = function (resourceGroupName, name, parameter }; /** - * Gets all redis caches in a resource group. + * Lists all Redis caches in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1763,9 +2207,6 @@ Redis.prototype.listByResourceGroupNext = function (nextPageLink, options, callb // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -1845,7 +2286,7 @@ Redis.prototype.listByResourceGroupNext = function (nextPageLink, options, callb }; /** - * Gets all redis caches in the specified subscription. + * Gets all Redis caches in the specified subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1892,9 +2333,6 @@ Redis.prototype.listNext = function (nextPageLink, options, callback) { // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts b/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts index 26fa28222d..921dc3c0f6 100644 --- a/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts +++ b/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts @@ -19,7 +19,7 @@ declare class RedisManagementClient { * * @param {credentials} credentials - Credentials needed for the client to connect to Azure. * - * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * @param {string} subscriptionId - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. * * @param {string} [baseUri] - The base URI of the service. * diff --git a/lib/services/rediscachemanagement/lib/redisManagementClient.js b/lib/services/rediscachemanagement/lib/redisManagementClient.js index 47a418f631..7f02588e5a 100644 --- a/lib/services/rediscachemanagement/lib/redisManagementClient.js +++ b/lib/services/rediscachemanagement/lib/redisManagementClient.js @@ -29,7 +29,7 @@ var operations = require('./operations'); * * @param {credentials} credentials - Credentials needed for the client to connect to Azure. * - * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * @param {string} subscriptionId - Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. * * @param {string} [baseUri] - The base URI of the service. *