diff --git a/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js b/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js index 30b8170518..04cf0f9e37 100644 --- a/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js +++ b/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js @@ -2,7 +2,7 @@ * 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. @@ -14,14 +14,14 @@ * @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. - * + * */ function ExportRDBParameters() { } diff --git a/lib/services/rediscachemanagement/lib/models/importRDBParameters.js b/lib/services/rediscachemanagement/lib/models/importRDBParameters.js index 529f4ab8ea..6165a0560e 100644 --- a/lib/services/rediscachemanagement/lib/models/importRDBParameters.js +++ b/lib/services/rediscachemanagement/lib/models/importRDBParameters.js @@ -2,7 +2,7 @@ * 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. @@ -16,12 +16,12 @@ 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..95caf261ed 100644 --- a/lib/services/rediscachemanagement/lib/models/index.d.ts +++ b/lib/services/rediscachemanagement/lib/models/index.d.ts @@ -2,29 +2,33 @@ * 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. */ +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 {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 {string} family The SKU family to use. Valid values: (C, P). (C = + * Basic/Standard, P = Premium). Possible values include: 'C', 'P' + * + * @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 { name: string; @@ -34,131 +38,128 @@ export interface Sku { /** * @class - * Initializes a new instance of the RedisProperties class. + * Initializes a new instance of the Resource class. + * @constructor + * The Resource definition. + * + * @member {string} [id] Resource ID. + * + * @member {string} [name] Resource name. + * + * @member {string} [type] Resource type. + * + * @member {string} location Resource location. + * + * @member {object} [tags] Resource tags. + * + */ +export interface Resource extends BaseResource { + id?: string; + name?: string; + type?: string; + location: string; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the RedisCreateParameters 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 + * Parameters supplied to the Create Redis operation. + * + * @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 - * + * * @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: + * 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 RedisProperties { - 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 Resource class. - * @constructor - * @member {string} [id] Resource Id - * - * @member {string} [name] Resource name - * - * @member {string} [type] Resource type - * - * @member {string} location Resource location - * - * @member {object} [tags] Resource tags - * - */ -export interface Resource extends BaseResource { - id?: string; - name?: string; - type?: string; - location: string; - tags?: { [propertyName: string]: string }; -} - -/** - * @class - * Initializes a new instance of the RedisCreateOrUpdateParameters class. + * Initializes a new instance of the RedisUpdateParameters class. * @constructor - * Parameters supplied to the 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 + * Parameters supplied to the Update Redis operation. + * + * @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 - * + * * @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: + * 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. + * */ -export interface RedisCreateOrUpdateParameters 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; + sku?: Sku; + tags?: { [propertyName: string]: string }; } /** @@ -168,11 +169,11 @@ export interface RedisCreateOrUpdateParameters extends Resource { * 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. + * */ export interface RedisAccessKeys { primaryKey?: string; @@ -181,170 +182,103 @@ export interface RedisAccessKeys { /** * @class - * Initializes a new instance of the RedisResourceWithAccessKey class. + * Initializes a new instance of the RedisResource 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 + * A single Redis item in List or Get Operation. + * + * @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 - * + * * @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: + * 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} [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 {string} [redisVersion] Redis version. + * + * @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] The keys of the Redis cache - not set if this + * object is not the response to Create or Update redis cache + * * @member {string} [accessKeys.primaryKey] The current primary key that - * clients can use to authenticate with redis cache. - * + * 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. - * - */ -export interface RedisResourceWithAccessKey extends Resource { - redisVersion?: string; - sku: Sku; - 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; -} - -/** - * @class - * Initializes a new instance of the RedisResource class. - * @constructor - * 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 {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 - * + * clients can use to authenticate with Redis cache. + * */ export interface RedisResource extends Resource { - redisVersion?: string; - sku: Sku; redisConfiguration?: { [propertyName: string]: string }; enableNonSslPort?: boolean; tenantSettings?: { [propertyName: string]: string }; shardCount?: number; subnetId?: string; staticIP?: string; + sku?: Sku; + redisVersion?: string; provisioningState?: string; hostName?: string; port?: number; sslPort?: number; + accessKeys?: RedisAccessKeys; } /** * @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 {array} [value] List of Redis cache instances. + * + * @member {string} [nextLink] Link for next set of locations. * - * @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 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 + * @member {string} keyType The Redis access key to regenerate. Possible values * include: 'Primary', 'Secondary' - * + * */ export interface RedisRegenerateKeyParameters { keyType: string; @@ -354,15 +288,15 @@ 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 - * this value data loss is possible. Possible values include: 'PrimaryNode', + * @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 { rebootType: string; @@ -373,14 +307,14 @@ 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. - * + * */ export interface ExportRDBParameters { format?: string; @@ -392,12 +326,12 @@ 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 { format?: string; @@ -408,16 +342,18 @@ 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. - * + * * @member {moment.duration} [maintenanceWindow] ISO8601 timespan specifying * how much time cache patching can take. - * + * */ export interface ScheduleEntry { dayOfWeek: string; @@ -427,40 +363,56 @@ export interface ScheduleEntry { /** * @class - * Initializes a new instance of the RedisPatchSchedulesRequest class. + * Initializes a new instance of the RedisPatchSchedule class. * @constructor - * Parameters to set patch schedules for redis cache. + * Response to put/get patch schedules for Redis cache. + * + * @member {string} [id] Resource ID. + * + * @member {string} [name] Resource name. + * + * @member {string} [type] Resource type. + * + * @member {string} [location] Resource location. + * + * @member {array} scheduleEntries List of patch schedules for a Redis cache. * - * @member {array} scheduleEntries List of patch schedules for redis cache. - * */ -export interface RedisPatchSchedulesRequest { +export interface RedisPatchSchedule { + id?: string; + name?: string; + type?: string; + location?: string; scheduleEntries: ScheduleEntry[]; } /** * @class - * Initializes a new instance of the RedisPatchSchedulesResponse class. + * Initializes a new instance of the RedisForceRebootResponse class. * @constructor - * Response to put/get patch schedules for redis cache. - * - * @member {string} [id] Resource Id - * - * @member {string} [name] Resource name - * - * @member {string} [type] Resource type - * - * @member {string} [location] Resource location - * - * @member {array} scheduleEntries List of patch schedules for redis cache. - * + * Response to force reboot for Redis cache. + * + * @member {string} [message] Status message + * */ -export interface RedisPatchSchedulesResponse { - id?: string; - name?: string; - type?: string; - location?: string; - scheduleEntries: ScheduleEntry[]; +export interface RedisForceRebootResponse { + message?: string; +} + +/** + * @class + * Initializes a new instance of the RedisListResult class. + * @constructor + * The response of list Redis operation. + * + * @member {array} [value] List of Redis cache instances. + * + * @member {string} [nextLink] Link for next set of locations. + * + */ +export interface RedisListResult { + value?: RedisResource[]; + nextLink?: string; } @@ -468,10 +420,10 @@ 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. - * + * */ export interface RedisListResult extends Array { nextLink?: string; diff --git a/lib/services/rediscachemanagement/lib/models/index.js b/lib/services/rediscachemanagement/lib/models/index.js index 669810ad77..31be3b5dfb 100644 --- a/lib/services/rediscachemanagement/lib/models/index.js +++ b/lib/services/rediscachemanagement/lib/models/index.js @@ -2,7 +2,7 @@ * 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. @@ -19,18 +19,17 @@ 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.RedisPatchSchedule = require('./redisPatchSchedule'); +exports.RedisForceRebootResponse = require('./redisForceRebootResponse'); exports.RedisListResult = require('./redisListResult'); diff --git a/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js b/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js index f90cb6c447..b21e656e40 100644 --- a/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js +++ b/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js @@ -2,7 +2,7 @@ * 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. @@ -17,11 +17,11 @@ * 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 64% rename from lib/services/rediscachemanagement/lib/models/redisCreateOrUpdateParameters.js rename to lib/services/rediscachemanagement/lib/models/redisCreateParameters.js index 4706442e04..7a816f7fef 100644 --- a/lib/services/rediscachemanagement/lib/models/redisCreateOrUpdateParameters.js +++ b/lib/services/rediscachemanagement/lib/models/redisCreateParameters.js @@ -2,7 +2,7 @@ * 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. @@ -16,65 +16,62 @@ 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 + * @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 - * + * * @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: + * 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,21 +118,6 @@ 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', @@ -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/redisForceRebootResponse.js b/lib/services/rediscachemanagement/lib/models/redisForceRebootResponse.js new file mode 100644 index 0000000000..1ff8ea4cb0 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/redisForceRebootResponse.js @@ -0,0 +1,52 @@ +/* + * 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 RedisForceRebootResponse class. + * @constructor + * Response to force reboot for Redis cache. + * + * @member {string} [message] Status message + * + */ +function RedisForceRebootResponse() { +} + +/** + * Defines the metadata of RedisForceRebootResponse + * + * @returns {object} metadata of RedisForceRebootResponse + * + */ +RedisForceRebootResponse.prototype.mapper = function () { + return { + required: false, + serializedName: 'RedisForceRebootResponse', + type: { + name: 'Composite', + className: 'RedisForceRebootResponse', + modelProperties: { + message: { + required: false, + readOnly: true, + serializedName: 'Message', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = RedisForceRebootResponse; 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..0d240b4971 100644 --- a/lib/services/rediscachemanagement/lib/models/redisListResult.js +++ b/lib/services/rediscachemanagement/lib/models/redisListResult.js @@ -2,7 +2,7 @@ * 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. @@ -16,10 +16,10 @@ 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. - * + * */ function RedisListResult() { } diff --git a/lib/services/rediscachemanagement/lib/models/redisPatchSchedulesResponse.js b/lib/services/rediscachemanagement/lib/models/redisPatchSchedule.js similarity index 68% rename from lib/services/rediscachemanagement/lib/models/redisPatchSchedulesResponse.js rename to lib/services/rediscachemanagement/lib/models/redisPatchSchedule.js index aa5d48c189..5ddd53c025 100644 --- a/lib/services/rediscachemanagement/lib/models/redisPatchSchedulesResponse.js +++ b/lib/services/rediscachemanagement/lib/models/redisPatchSchedule.js @@ -2,7 +2,7 @@ * 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. @@ -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} [name] Resource name. + * + * @member {string} [type] Resource type. + * + * @member {string} [location] Resource location. + * + * @member {array} scheduleEntries List of patch schedules for a Redis cache. * - * @member {string} [id] Resource Id - * - * @member {string} [name] Resource name - * - * @member {string} [type] Resource type - * - * @member {string} [location] Resource location - * - * @member {array} scheduleEntries List of patch schedules for 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..b9f810d186 100644 --- a/lib/services/rediscachemanagement/lib/models/redisRebootParameters.js +++ b/lib/services/rediscachemanagement/lib/models/redisRebootParameters.js @@ -2,7 +2,7 @@ * 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. @@ -14,15 +14,15 @@ * @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 - * this value data loss is possible. Possible values include: 'PrimaryNode', + * @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..e304c35097 100644 --- a/lib/services/rediscachemanagement/lib/models/redisRegenerateKeyParameters.js +++ b/lib/services/rediscachemanagement/lib/models/redisRegenerateKeyParameters.js @@ -2,7 +2,7 @@ * 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. @@ -14,11 +14,11 @@ * @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 + * @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..274c977e16 100644 --- a/lib/services/rediscachemanagement/lib/models/redisResource.js +++ b/lib/services/rediscachemanagement/lib/models/redisResource.js @@ -2,7 +2,7 @@ * 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. @@ -18,51 +18,59 @@ var util = require('util'); * @class * Initializes a new instance of the RedisResource class. * @constructor - * 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 {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 + * A single Redis item in List or Get Operation. + * + * @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 - * + * * @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: + * 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 {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 {string} [redisVersion] Redis version. + * + * @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] The keys of the Redis cache - not set if this + * object is not the response to Create or Update redis cache + * + * @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 RedisResource() { RedisResource['super_'].call(this); @@ -129,21 +137,6 @@ RedisResource.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', @@ -206,8 +199,25 @@ RedisResource.prototype.mapper = function () { name: 'String' } }, + sku: { + required: false, + serializedName: 'properties.sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + redisVersion: { + required: false, + readOnly: true, + serializedName: 'properties.redisVersion', + type: { + name: 'String' + } + }, provisioningState: { required: false, + readOnly: true, serializedName: 'properties.provisioningState', type: { name: 'String' @@ -215,6 +225,7 @@ RedisResource.prototype.mapper = function () { }, hostName: { required: false, + readOnly: true, serializedName: 'properties.hostName', type: { name: 'String' @@ -222,6 +233,7 @@ RedisResource.prototype.mapper = function () { }, port: { required: false, + readOnly: true, serializedName: 'properties.port', type: { name: 'Number' @@ -229,10 +241,20 @@ RedisResource.prototype.mapper = function () { }, sslPort: { required: false, + readOnly: true, serializedName: 'properties.sslPort', type: { name: 'Number' } + }, + accessKeys: { + required: false, + readOnly: true, + serializedName: 'properties.accessKeys', + type: { + name: 'Composite', + className: 'RedisAccessKeys' + } } } } 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 51% rename from lib/services/rediscachemanagement/lib/models/redisProperties.js rename to lib/services/rediscachemanagement/lib/models/redisUpdateParameters.js index f268a06b6a..668c203207 100644 --- a/lib/services/rediscachemanagement/lib/models/redisProperties.js +++ b/lib/services/rediscachemanagement/lib/models/redisUpdateParameters.js @@ -2,7 +2,7 @@ * 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. @@ -14,81 +14,65 @@ 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 + * @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 - * + * * @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: + * 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..4c643520d3 100644 --- a/lib/services/rediscachemanagement/lib/models/resource.js +++ b/lib/services/rediscachemanagement/lib/models/resource.js @@ -2,7 +2,7 @@ * 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. @@ -18,16 +18,18 @@ var util = require('util'); * @class * Initializes a new instance of the Resource class. * @constructor - * @member {string} [id] Resource Id - * - * @member {string} [name] Resource name - * - * @member {string} [type] Resource type - * - * @member {string} location Resource location - * - * @member {object} [tags] Resource tags - * + * The Resource definition. + * + * @member {string} [id] Resource ID. + * + * @member {string} [name] Resource name. + * + * @member {string} [type] Resource type. + * + * @member {string} location Resource location. + * + * @member {object} [tags] Resource tags. + * */ function Resource() { Resource['super_'].call(this); diff --git a/lib/services/rediscachemanagement/lib/models/scheduleEntry.js b/lib/services/rediscachemanagement/lib/models/scheduleEntry.js index b6987b34b5..4c90ac1362 100644 --- a/lib/services/rediscachemanagement/lib/models/scheduleEntry.js +++ b/lib/services/rediscachemanagement/lib/models/scheduleEntry.js @@ -2,7 +2,7 @@ * 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. @@ -14,16 +14,18 @@ * @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. - * + * * @member {moment.duration} [maintenanceWindow] ISO8601 timespan specifying * how much time cache patching can take. - * + * */ function ScheduleEntry() { } @@ -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..3ecf2b3978 100644 --- a/lib/services/rediscachemanagement/lib/models/sku.js +++ b/lib/services/rediscachemanagement/lib/models/sku.js @@ -2,7 +2,7 @@ * 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. @@ -14,18 +14,19 @@ * @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 {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 {string} family The SKU family to use. Valid values: (C, P). (C = + * Basic/Standard, P = Premium). Possible values include: 'C', 'P' + * + * @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..6d2da849fd 100644 --- a/lib/services/rediscachemanagement/lib/operations/index.d.ts +++ b/lib/services/rediscachemanagement/lib/operations/index.d.ts @@ -2,7 +2,7 @@ * 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. @@ -14,86 +14,139 @@ import * as models from '../models'; /** * @class - * Redis + * RedisOperations * __NOTE__: An instance of this class is automatically created for an * instance of the RedisManagementClient. */ -export interface Redis { +export interface RedisOperations { /** - * 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 {object} parameters Parameters supplied to the CreateOrUpdate redis + * + * @param {string} name The name of the Redis cache. + * + * @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.sku What sku of redis cache to deploy. - * - * @param {string} parameters.sku.name What 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 {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} [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 - * + * * @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: + * 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.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * + * + * @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 */ - 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; + 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; /** - * Deletes a redis cache. This operation takes a while to complete. + * 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 {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 + */ + 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. + * + * @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 */ @@ -101,17 +154,17 @@ 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. - * + * * @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 */ @@ -119,15 +172,15 @@ 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. - * + * * @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 */ @@ -135,13 +188,13 @@ 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. - * + * * @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 */ @@ -149,185 +202,262 @@ 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. - * + * * @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 */ - 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} keyType Which redis access key to reset. Possible values + * + * @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 * request - * + * * @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 {object} parameters Specifies which redis node(s) to reboot. - * - * @param {string} parameters.rebootType Which redis node(s) to reboot. + * + * @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 {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 * request - * + * * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - forceReboot(resourceGroupName: string, name: string, parameters: models.RedisRebootParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - forceReboot(resourceGroupName: string, name: string, parameters: models.RedisRebootParameters, callback: ServiceCallback): void; + forceReboot(resourceGroupName: string, name: string, parameters: models.RedisRebootParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 {object} parameters Parameters for redis import operation. - * + * + * @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 {array} parameters.files files to import. + * * @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 */ - 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. + * Export data from the redis cache to blobs in a container. * * @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} name The name of the Redis cache. + * + * @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. - * + * * @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 */ - 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 {object} parameters Parameters for redis export operation. - * + * + * @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. + * + * @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; + + /** + * 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 {string} parameters.prefix Prifix to use for exported files. - * - * @param {string} parameters.container Container name to export to. - * + * + * @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 {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. + * Export data from the redis cache to blobs in a container. * * @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} 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.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 {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. - * + * * @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 */ @@ -335,16 +465,16 @@ 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. - * + * * @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 */ @@ -361,37 +491,38 @@ export interface Redis { export interface PatchSchedules { /** - * Create or replace the patching schedule for redis cache. + * Create or replace the patching schedule for Redis cache (requires Premium + * SKU). * * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} name The name of the redis cache. - * - * @param {array} scheduleEntries List of patch schedules for redis cache. - * + * + * @param {string} name The name of the Redis cache. + * + * @param {array} scheduleEntries List of patch schedules for a 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 */ - 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 of a redis cache (requires Premium SKU). * * @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 */ @@ -399,20 +530,20 @@ export interface PatchSchedules { deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; /** - * Gets the patching schedule for redis cache. + * Gets the patching schedule of a redis cache (requires Premium SKU). * * @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 */ - 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/index.js b/lib/services/rediscachemanagement/lib/operations/index.js index 47342503ec..2c2d91e1c1 100644 --- a/lib/services/rediscachemanagement/lib/operations/index.js +++ b/lib/services/rediscachemanagement/lib/operations/index.js @@ -2,7 +2,7 @@ * 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. @@ -14,5 +14,5 @@ 'use strict'; -exports.Redis = require('./redis'); +exports.RedisOperations = require('./redisOperations'); exports.PatchSchedules = require('./patchSchedules'); diff --git a/lib/services/rediscachemanagement/lib/operations/patchSchedules.js b/lib/services/rediscachemanagement/lib/operations/patchSchedules.js index 11654c3821..10bbe72cff 100644 --- a/lib/services/rediscachemanagement/lib/operations/patchSchedules.js +++ b/lib/services/rediscachemanagement/lib/operations/patchSchedules.js @@ -2,7 +2,7 @@ * 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. @@ -30,19 +30,20 @@ function PatchSchedules(client) { } /** - * Create or replace the patching schedule for redis cache. + * Create or replace the patching schedule for Redis cache (requires Premium + * SKU). * * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} name The name of the redis cache. - * - * @param {array} scheduleEntries List of patch schedules for redis cache. - * + * + * @param {string} name The name of the Redis cache. + * + * @param {array} scheduleEntries List of patch schedules for a 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) @@ -50,8 +51,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 +86,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,12 +133,12 @@ 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); } } catch (error) { - var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); return callback(serializationError); } @@ -148,7 +149,7 @@ PatchSchedules.prototype.createOrUpdate = function (resourceGroupName, name, sch return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -167,7 +168,7 @@ PatchSchedules.prototype.createOrUpdate = function (resourceGroupName, name, sch error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -183,7 +184,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) { @@ -193,23 +194,40 @@ PatchSchedules.prototype.createOrUpdate = function (resourceGroupName, name, sch return callback(deserializationError); } } + // Deserialize Response + if (statusCode === 201) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['RedisPatchSchedule']().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); + } + } return callback(null, result, httpRequest, response); }); }; /** - * Deletes the patching schedule for redis cache. + * Deletes the patching schedule of a redis cache (requires Premium SKU). * * @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) @@ -253,14 +271,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) { @@ -294,7 +309,7 @@ PatchSchedules.prototype.deleteMethod = function (resourceGroupName, name, optio 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); @@ -304,12 +319,13 @@ PatchSchedules.prototype.deleteMethod = function (resourceGroupName, name, optio 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; + var internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -324,17 +340,17 @@ PatchSchedules.prototype.deleteMethod = function (resourceGroupName, name, optio }; /** - * Gets the patching schedule for redis cache. + * Gets the patching schedule of a redis cache (requires Premium SKU). * * @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) @@ -342,8 +358,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 +395,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) { @@ -440,7 +452,7 @@ PatchSchedules.prototype.get = function (resourceGroupName, name, options, callb error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -456,7 +468,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/redisOperations.js similarity index 73% rename from lib/services/rediscachemanagement/lib/operations/redis.js rename to lib/services/rediscachemanagement/lib/operations/redisOperations.js index a6a20d597b..13cb1c48c8 100644 --- a/lib/services/rediscachemanagement/lib/operations/redis.js +++ b/lib/services/rediscachemanagement/lib/operations/redisOperations.js @@ -2,7 +2,7 @@ * 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. @@ -17,74 +17,72 @@ var WebResource = msRest.WebResource; /** * @class - * Redis + * RedisOperations * __NOTE__: An instance of this class is automatically created for an * instance of the RedisManagementClient. - * Initializes a new instance of the Redis class. + * Initializes a new instance of the RedisOperations class. * @constructor * * @param {RedisManagementClient} client Reference to the service client. */ -function Redis(client) { +function RedisOperations(client) { this.client = 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 {object} parameters Parameters supplied to the CreateOrUpdate redis + * + * @param {string} name The name of the Redis cache. + * + * @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.sku What sku of redis cache to deploy. - * - * @param {string} parameters.sku.name What 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 {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} [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 - * + * * @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: + * 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.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * + * + * @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 {function} callback * * @returns {function} callback(err, result, request, response) @@ -92,14 +90,126 @@ 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. + */ +RedisOperations.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] 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 {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.createOrUpdate = function (resourceGroupName, name, parameters, options, callback) { +RedisOperations.prototype.update = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -133,14 +243,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 +256,7 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'PATCH'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -172,12 +279,12 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, var requestModel = null; try { if (parameters !== null && parameters !== undefined) { - var requestModelMapper = new client.models['RedisCreateOrUpdateParameters']().mapper(); + var requestModelMapper = new client.models['RedisUpdateParameters']().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 ' + + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); return callback(serializationError); } @@ -188,7 +295,7 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, 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); @@ -207,7 +314,7 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -217,13 +324,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,40 +340,24 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, return callback(deserializationError); } } - // 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['RedisResourceWithAccessKey']().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); - } - } return callback(null, result, httpRequest, response); }); }; /** - * 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. - * + * * @param {object} [options.customHeaders] Headers that will be added to the * request - * + * * @param {function} callback * * @returns {function} callback(err, result, request, response) @@ -279,119 +370,54 @@ Redis.prototype.createOrUpdate = function (resourceGroupName, name, parameters, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.deleteMethod = function (resourceGroupName, name, options, callback) { +RedisOperations.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.'); } - // 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.'); - } - 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 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)); - 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) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginDeleteMethod(resourceGroupName, name, options, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; - 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 && statusCode !== 204) { - var error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + 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; - 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; - } - } 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; - return callback(null, result, httpRequest, response); + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); }); }; /** - * 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. - * + * * @param {object} [options.customHeaders] Headers that will be added to the * request - * + * * @param {function} callback * * @returns {function} callback(err, result, request, response) @@ -405,7 +431,7 @@ Redis.prototype.deleteMethod = function (resourceGroupName, name, options, callb * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.get = function (resourceGroupName, name, options, callback) { +RedisOperations.prototype.get = function (resourceGroupName, name, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -436,14 +462,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}'; 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) { @@ -496,7 +519,7 @@ Redis.prototype.get = function (resourceGroupName, name, options, callback) { error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -528,15 +551,15 @@ Redis.prototype.get = function (resourceGroupName, name, options, callback) { }; /** - * 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. - * + * * @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) @@ -550,7 +573,7 @@ Redis.prototype.get = function (resourceGroupName, name, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.listByResourceGroup = function (resourceGroupName, options, callback) { +RedisOperations.prototype.listByResourceGroup = function (resourceGroupName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -578,13 +601,10 @@ Redis.prototype.listByResourceGroup = function (resourceGroupName, options, call } // 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/'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); 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) { @@ -637,7 +657,7 @@ Redis.prototype.listByResourceGroup = function (resourceGroupName, options, call error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -669,13 +689,13 @@ Redis.prototype.listByResourceGroup = function (resourceGroupName, options, call }; /** - * Gets all redis caches in the specified subscription. + * Gets all Redis caches in the specified subscription. * * @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) @@ -689,7 +709,7 @@ Redis.prototype.listByResourceGroup = function (resourceGroupName, options, call * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.list = function (options, callback) { +RedisOperations.prototype.list = function (options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -714,12 +734,9 @@ 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}/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) { @@ -772,7 +789,7 @@ Redis.prototype.list = function (options, callback) { error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -804,18 +821,18 @@ Redis.prototype.list = function (options, callback) { }; /** - * 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. - * + * * @param {object} [options.customHeaders] Headers that will be added to the * request - * + * * @param {function} callback * * @returns {function} callback(err, result, request, response) @@ -823,13 +840,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 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.listKeys = function (resourceGroupName, name, options, callback) { +RedisOperations.prototype.listKeys = function (resourceGroupName, name, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -860,14 +877,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}/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) { @@ -920,7 +934,7 @@ Redis.prototype.listKeys = function (resourceGroupName, name, options, callback) error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -936,7 +950,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['RedisAccessKeys']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -952,21 +966,21 @@ Redis.prototype.listKeys = function (resourceGroupName, name, options, callback) }; /** - * 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} keyType Which redis access key to reset. Possible values + * + * @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 * request - * + * * @param {function} callback * * @returns {function} callback(err, result, request, response) @@ -974,13 +988,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 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.regenerateKey = function (resourceGroupName, name, keyType, options, callback) { +RedisOperations.prototype.regenerateKey = function (resourceGroupName, name, keyType, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1024,14 +1038,11 @@ Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, opti } // 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}/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) { @@ -1068,7 +1079,7 @@ Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, opti requestContent = JSON.stringify(requestModel); } } catch (error) { - var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); return callback(serializationError); } @@ -1098,7 +1109,7 @@ Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, opti error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -1114,7 +1125,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['RedisAccessKeys']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1130,40 +1141,42 @@ Redis.prototype.regenerateKey = function (resourceGroupName, name, keyType, opti }; /** - * 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 {object} parameters Specifies which redis node(s) to reboot. - * - * @param {string} parameters.rebootType Which redis node(s) to reboot. + * + * @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 {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 * 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} [result] - The deserialized result object. + * See {@link RedisForceRebootResponse} 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.forceReboot = function (resourceGroupName, name, parameters, options, callback) { +RedisOperations.prototype.forceReboot = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1197,14 +1210,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}/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) { @@ -1241,7 +1251,7 @@ Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, opt requestContent = JSON.stringify(requestModel); } } catch (error) { - var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); return callback(serializationError); } @@ -1252,7 +1262,7 @@ Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, opt 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); @@ -1266,8 +1276,12 @@ Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, opt 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 ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -1276,6 +1290,23 @@ Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, opt // 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['RedisForceRebootResponse']().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); }); @@ -1283,23 +1314,23 @@ Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, opt /** * - * 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 {object} parameters Parameters for redis import operation. - * + * + * @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 {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) @@ -1312,7 +1343,7 @@ Redis.prototype.forceReboot = function (resourceGroupName, name, parameters, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.importMethod = function (resourceGroupName, name, parameters, options, callback) { +RedisOperations.prototype.importData = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1324,7 +1355,7 @@ Redis.prototype.importMethod = function (resourceGroupName, name, parameters, op } // Send request - this.beginImportMethod(resourceGroupName, name, parameters, options, function (err, parsedResult, httpRequest, response){ + this.beginImportData(resourceGroupName, name, parameters, options, function (err, parsedResult, httpRequest, response){ if (err) return callback(err); var initialResult = new msRest.HttpOperationResponse(); @@ -1349,23 +1380,26 @@ Redis.prototype.importMethod = function (resourceGroupName, name, parameters, op }; /** - * Import data into redis cache. + * + * Export data from the redis cache to blobs in a container. * * @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} name The name of the Redis cache. + * + * @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. - * + * * @param {object} [options.customHeaders] Headers that will be added to the * request - * + * * @param {function} callback * * @returns {function} callback(err, result, request, response) @@ -1378,7 +1412,109 @@ 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) { +RedisOperations.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); + }); + }); +}; + +/** + * 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 {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. + * + * @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. + */ +RedisOperations.prototype.beginCreate = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1412,14 +1548,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}'; 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) { @@ -1428,7 +1561,7 @@ Redis.prototype.beginImportMethod = function (resourceGroupName, name, parameter // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1451,12 +1584,12 @@ Redis.prototype.beginImportMethod = function (resourceGroupName, name, parameter var requestModel = null; try { if (parameters !== null && parameters !== undefined) { - var requestModelMapper = new client.models['ImportRDBParameters']().mapper(); + 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 ' + + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); return callback(serializationError); } @@ -1467,7 +1600,7 @@ Redis.prototype.beginImportMethod = function (resourceGroupName, name, parameter return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 201 && statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1481,8 +1614,12 @@ Redis.prototype.beginImportMethod = function (resourceGroupName, name, parameter 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 ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -1491,32 +1628,186 @@ Redis.prototype.beginImportMethod = function (resourceGroupName, name, parameter // Create Result var result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 201) { + 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); + } + } + // 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['RedisResource']().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); + } + } 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) * - * Import data into redis cache. + * {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. + */ +RedisOperations.prototype.beginDeleteMethod = 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.'); + } + // 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.'); + } + 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/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 = 'DELETE'; + 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 && statusCode !== 204) { + 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) { + var internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + } 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; + + 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} name The name of the Redis cache. + * + * @param {object} parameters Parameters for Redis import 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 {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) @@ -1529,62 +1820,142 @@ Redis.prototype.beginImportMethod = function (resourceGroupName, name, parameter * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.exportMethod = function (resourceGroupName, name, parameters, options, callback) { +RedisOperations.prototype.beginImportData = 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.'); } + // 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.'); + } + 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); + } - // 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); + // Construct URL + 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)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + 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'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['ImportRDBParameters']().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 !== 202 && statusCode !== 200 && statusCode !== 204) { + 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) { + var internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + } 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 - - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); }; /** - * Import data into redis cache. + * Export data from the redis cache to blobs in a container. * * @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} 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.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) @@ -1597,7 +1968,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) { +RedisOperations.prototype.beginExportData = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1631,14 +2002,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) { @@ -1675,7 +2043,7 @@ Redis.prototype.beginExportMethod = function (resourceGroupName, name, parameter requestContent = JSON.stringify(requestModel); } } catch (error) { - var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); return callback(serializationError); } @@ -1686,7 +2054,7 @@ Redis.prototype.beginExportMethod = function (resourceGroupName, name, parameter return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 202 && statusCode !== 200 && statusCode !== 204) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1696,12 +2064,13 @@ Redis.prototype.beginExportMethod = function (resourceGroupName, name, parameter 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; + var internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -1716,16 +2085,16 @@ 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. - * + * * @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) @@ -1739,7 +2108,7 @@ Redis.prototype.beginExportMethod = function (resourceGroupName, name, parameter * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.listByResourceGroupNext = function (nextPageLink, options, callback) { +RedisOperations.prototype.listByResourceGroupNext = function (nextPageLink, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1763,9 +2132,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(); @@ -1813,7 +2179,7 @@ Redis.prototype.listByResourceGroupNext = function (nextPageLink, options, callb error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -1845,16 +2211,16 @@ 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. - * + * * @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) @@ -1868,7 +2234,7 @@ Redis.prototype.listByResourceGroupNext = function (nextPageLink, options, callb * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -Redis.prototype.listNext = function (nextPageLink, options, callback) { +RedisOperations.prototype.listNext = function (nextPageLink, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1892,9 +2258,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(); @@ -1942,7 +2305,7 @@ Redis.prototype.listNext = function (nextPageLink, options, callback) { error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); return callback(error); } @@ -1974,4 +2337,4 @@ Redis.prototype.listNext = function (nextPageLink, options, callback) { }; -module.exports = Redis; +module.exports = RedisOperations; diff --git a/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts b/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts index 26fa28222d..3c295f0983 100644 --- a/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts +++ b/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts @@ -2,7 +2,7 @@ * 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. @@ -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. * @@ -56,7 +56,7 @@ declare class RedisManagementClient { generateClientRequestId: boolean; // Operation groups - redis: operations.Redis; + redisOperations: operations.RedisOperations; patchSchedules: operations.PatchSchedules; } diff --git a/lib/services/rediscachemanagement/lib/redisManagementClient.js b/lib/services/rediscachemanagement/lib/redisManagementClient.js index 47a418f631..83e92c6a89 100644 --- a/lib/services/rediscachemanagement/lib/redisManagementClient.js +++ b/lib/services/rediscachemanagement/lib/redisManagementClient.js @@ -2,7 +2,7 @@ * 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. @@ -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. * @@ -73,19 +73,19 @@ function RedisManagementClient(credentials, subscriptionId, baseUri, options) { this.credentials = credentials; this.subscriptionId = subscriptionId; - if(options.apiVersion !== null && options.apiVersion !== undefined) { + if(options.apiVersion !== null && options.apiVersion !== undefined) { this.apiVersion = options.apiVersion; } - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } - if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } - this.redis = new operations.Redis(this); + this.redisOperations = new operations.RedisOperations(this); this.patchSchedules = new operations.PatchSchedules(this); this.models = models; msRest.addSerializationMixin(this);