diff --git a/lib/services/rediscachemanagement/LICENSE.txt b/lib/services/rediscachemanagement/LICENSE.txt index 0313a903d7..8f3d856145 100644 --- a/lib/services/rediscachemanagement/LICENSE.txt +++ b/lib/services/rediscachemanagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2017 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +The MIT License (MIT) + +Copyright (c) 2019 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/rediscachemanagement/lib/models/checkNameAvailabilityParameters.js b/lib/services/rediscachemanagement/lib/models/checkNameAvailabilityParameters.js new file mode 100644 index 0000000000..24ac272862 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/checkNameAvailabilityParameters.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Parameters body to pass for resource name availability check. + * + */ +class CheckNameAvailabilityParameters { + /** + * Create a CheckNameAvailabilityParameters. + * @property {string} name Resource name. + * @property {string} type Resource type. The only legal value of this + * property for checking redis cache name availability is + * 'Microsoft.Cache/redis'. + */ + constructor() { + } + + /** + * Defines the metadata of CheckNameAvailabilityParameters + * + * @returns {object} metadata of CheckNameAvailabilityParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CheckNameAvailabilityParameters', + type: { + name: 'Composite', + className: 'CheckNameAvailabilityParameters', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CheckNameAvailabilityParameters; diff --git a/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js b/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js index f1431840c6..ece669461e 100644 --- a/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js +++ b/lib/services/rediscachemanagement/lib/models/exportRDBParameters.js @@ -17,9 +17,9 @@ class ExportRDBParameters { /** * Create a ExportRDBParameters. - * @member {string} [format] File format. - * @member {string} prefix Prefix to use for exported files. - * @member {string} container Container name to export to. + * @property {string} [format] File format. + * @property {string} prefix Prefix to use for exported files. + * @property {string} container Container name to export to. */ constructor() { } diff --git a/lib/services/rediscachemanagement/lib/models/importRDBParameters.js b/lib/services/rediscachemanagement/lib/models/importRDBParameters.js index ac773282f1..c9a99ef63e 100644 --- a/lib/services/rediscachemanagement/lib/models/importRDBParameters.js +++ b/lib/services/rediscachemanagement/lib/models/importRDBParameters.js @@ -17,8 +17,8 @@ class ImportRDBParameters { /** * Create a ImportRDBParameters. - * @member {string} [format] File format. - * @member {array} files files to import. + * @property {string} [format] File format. + * @property {array} files files to import. */ constructor() { } diff --git a/lib/services/rediscachemanagement/lib/models/index.d.ts b/lib/services/rediscachemanagement/lib/models/index.d.ts index de5fa0f48d..b5184e493b 100644 --- a/lib/services/rediscachemanagement/lib/models/index.d.ts +++ b/lib/services/rediscachemanagement/lib/models/index.d.ts @@ -1,424 +1,623 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; +export { + BaseResource, + CloudError +}; /** - * @class - * Initializes a new instance of the Sku class. - * @constructor * SKU parameters supplied to the create Redis operation. - * - * @member {string} name The type of Redis cache to deploy. Valid values: - * (Basic, Standard, Premium). Possible values include: 'Basic', 'Standard', - * 'Premium' - * @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 { + /** + * The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium). Possible values + * include: 'Basic', 'Standard', 'Premium' + */ name: string; + /** + * The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). Possible + * values include: 'C', 'P' + */ family: string; + /** + * 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). + */ capacity: number; } /** - * @class - * Initializes a new instance of the Resource class. - * @constructor + * Redis cache access keys. + */ +export interface RedisAccessKeys { + /** + * The current primary key that clients can use to authenticate with Redis cache. + */ + readonly primaryKey?: string; + /** + * The current secondary key that clients can use to authenticate with Redis cache. + */ + readonly secondaryKey?: string; +} + +/** + * Linked server Id + */ +export interface RedisLinkedServer { + /** + * Linked server Id. + */ + readonly id?: string; +} + +/** * 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 { + /** + * Resource ID. + */ readonly id?: string; + /** + * Resource name. + */ readonly name?: string; + /** + * Resource type. + */ readonly type?: string; - location: string; +} + +/** + * The resource model definition for a ARM proxy resource. It will have everything other than + * required location and tags + */ +export interface ProxyResource extends Resource { +} + +/** + * The resource model definition for a ARM tracked top level resource + */ +export interface TrackedResource extends Resource { + /** + * Resource tags. + */ tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; } /** - * @class - * Initializes a new instance of the RedisCreateParameters class. - * @constructor * 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] 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: - * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 - * @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 RedisCreateParameters extends Resource { + */ +export interface RedisCreateParameters { + /** + * 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. + */ redisConfiguration?: { [propertyName: string]: string }; + /** + * Specifies whether the non-ssl Redis server port (6379) is enabled. + */ enableNonSslPort?: boolean; + /** + * A dictionary of tenant settings + */ tenantSettings?: { [propertyName: string]: string }; + /** + * The number of shards to be created on a Premium Cluster Cache. + */ shardCount?: number; + /** + * Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', + * '1.1', '1.2'). Possible values include: '1.0', '1.1', '1.2' + */ + minimumTlsVersion?: string; + /** + * The SKU of the Redis cache to deploy. + */ + sku: Sku; + /** + * The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example + * format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + */ subnetId?: string; + /** + * Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual + * Network. + */ staticIP?: string; - sku: Sku; + /** + * A list of availability zones denoting where the resource needs to come from. + */ + zones?: string[]; + /** + * The geo-location where the resource lives + */ + location: string; + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the RedisUpdateParameters class. - * @constructor * 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] 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: - * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 - * @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 RedisUpdateParameters { + /** + * 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. + */ redisConfiguration?: { [propertyName: string]: string }; + /** + * Specifies whether the non-ssl Redis server port (6379) is enabled. + */ enableNonSslPort?: boolean; + /** + * A dictionary of tenant settings + */ tenantSettings?: { [propertyName: string]: string }; + /** + * The number of shards to be created on a Premium Cluster Cache. + */ shardCount?: number; - subnetId?: string; - staticIP?: string; + /** + * Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', + * '1.1', '1.2'). Possible values include: '1.0', '1.1', '1.2' + */ + minimumTlsVersion?: string; + /** + * The SKU of the Redis cache to deploy. + */ sku?: Sku; + /** + * Resource tags. + */ tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the RedisAccessKeys class. - * @constructor - * Redis cache access keys. - * - * @member {string} [primaryKey] The current primary key that clients can use - * to authenticate with Redis cache. - * @member {string} [secondaryKey] The current secondary key that clients can - * use to authenticate with Redis cache. + * Specifies a range of IP addresses permitted to connect to the cache */ -export interface RedisAccessKeys { - readonly primaryKey?: string; - readonly secondaryKey?: string; +export interface RedisFirewallRuleProperties { + /** + * lowest IP address included in the range + */ + startIP: string; + /** + * highest IP address included in the range + */ + endIP: string; } /** - * @class - * Initializes a new instance of the RedisLinkedServer class. - * @constructor - * Linked server Id - * - * @member {string} [id] Linked server Id. + * A firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses + * permitted to connect */ -export interface RedisLinkedServer { - readonly id?: string; +export interface RedisFirewallRule extends ProxyResource { + /** + * lowest IP address included in the range + */ + startIP: string; + /** + * highest IP address included in the range + */ + endIP: string; } /** - * @class - * Initializes a new instance of the RedisLinkedServerList class. - * @constructor - * List of linked server Ids of a Redis cache. - * - * @member {array} value List of linked server Ids of a Redis cache. + * Parameters required for creating a firewall rule on redis cache. */ -export interface RedisLinkedServerList { - value: RedisLinkedServer[]; +export interface RedisFirewallRuleCreateParameters { + /** + * lowest IP address included in the range + */ + startIP: string; + /** + * highest IP address included in the range + */ + endIP: string; } /** - * @class - * Initializes a new instance of the RedisResource class. - * @constructor * 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] 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: - * /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 - * @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. - * @member {object} [linkedServers] List of the linked servers associated with - * the cache - * @member {array} [linkedServers.value] List of linked server Ids of a Redis - * cache. - */ -export interface RedisResource extends Resource { + */ +export interface RedisResource extends TrackedResource { + /** + * 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. + */ redisConfiguration?: { [propertyName: string]: string }; + /** + * Specifies whether the non-ssl Redis server port (6379) is enabled. + */ enableNonSslPort?: boolean; + /** + * A dictionary of tenant settings + */ tenantSettings?: { [propertyName: string]: string }; + /** + * The number of shards to be created on a Premium Cluster Cache. + */ shardCount?: number; + /** + * Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', + * '1.1', '1.2'). Possible values include: '1.0', '1.1', '1.2' + */ + minimumTlsVersion?: string; + /** + * The SKU of the Redis cache to deploy. + */ + sku: Sku; + /** + * The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example + * format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + */ subnetId?: string; + /** + * Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual + * Network. + */ staticIP?: string; - sku?: Sku; + /** + * Redis version. + */ readonly redisVersion?: string; + /** + * Redis instance provisioning status. Possible values include: 'Creating', 'Deleting', + * 'Disabled', 'Failed', 'Linking', 'Provisioning', 'RecoveringScaleFailure', 'Scaling', + * 'Succeeded', 'Unlinking', 'Unprovisioning', 'Updating' + */ readonly provisioningState?: string; + /** + * Redis host name. + */ readonly hostName?: string; + /** + * Redis non-SSL port. + */ readonly port?: number; + /** + * Redis SSL port. + */ readonly sslPort?: number; + /** + * The keys of the Redis cache - not set if this object is not the response to Create or Update + * redis cache + */ readonly accessKeys?: RedisAccessKeys; - readonly linkedServers?: RedisLinkedServerList; + /** + * List of the linked servers associated with the cache + */ + readonly linkedServers?: RedisLinkedServer[]; + /** + * A list of availability zones denoting where the resource needs to come from. + */ + zones?: string[]; } /** - * @class - * Initializes a new instance of the RedisRegenerateKeyParameters class. - * @constructor * Specifies which Redis access keys to reset. - * - * @member {string} keyType The Redis access key to regenerate. Possible values - * include: 'Primary', 'Secondary' */ export interface RedisRegenerateKeyParameters { + /** + * The Redis access key to regenerate. Possible values include: 'Primary', 'Secondary' + */ keyType: string; } /** - * @class - * Initializes a new instance of the RedisRebootParameters class. - * @constructor * 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', - * 'SecondaryNode', 'AllNodes' - * @member {number} [shardId] If clustering is enabled, the ID of the shard to - * be rebooted. */ export interface RedisRebootParameters { + /** + * Which Redis node(s) to reboot. Depending on this value data loss is possible. Possible values + * include: 'PrimaryNode', 'SecondaryNode', 'AllNodes' + */ rebootType: string; + /** + * If clustering is enabled, the ID of the shard to be rebooted. + */ shardId?: number; } /** - * @class - * Initializes a new instance of the ExportRDBParameters class. - * @constructor * Parameters for Redis export operation. - * - * @member {string} [format] File format. - * @member {string} prefix Prefix to use for exported files. - * @member {string} container Container name to export to. */ export interface ExportRDBParameters { + /** + * File format. + */ format?: string; + /** + * Prefix to use for exported files. + */ prefix: string; + /** + * Container name to export to. + */ container: string; } /** - * @class - * Initializes a new instance of the ImportRDBParameters class. - * @constructor * Parameters for Redis import operation. - * - * @member {string} [format] File format. - * @member {array} files files to import. */ export interface ImportRDBParameters { + /** + * File format. + */ format?: string; + /** + * files to import. + */ files: string[]; } /** - * @class - * Initializes a new instance of the ScheduleEntry class. - * @constructor * 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 { + /** + * Day of the week when a cache can be patched. Possible values include: 'Monday', 'Tuesday', + * 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Everyday', 'Weekend' + */ dayOfWeek: string; + /** + * Start hour after which cache patching can start. + */ startHourUtc: number; + /** + * ISO8601 timespan specifying how much time cache patching can take. + */ maintenanceWindow?: moment.Duration; } /** - * @class - * Initializes a new instance of the RedisPatchSchedule class. - * @constructor + * List of patch schedules for a Redis cache. + */ +export interface ScheduleEntries { + /** + * List of patch schedules for a Redis cache. + */ + scheduleEntries: ScheduleEntry[]; +} + +/** * 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. */ -export interface RedisPatchSchedule { - readonly id?: string; - readonly name?: string; - readonly type?: string; - readonly location?: string; +export interface RedisPatchSchedule extends ProxyResource { + /** + * List of patch schedules for a Redis cache. + */ scheduleEntries: ScheduleEntry[]; } /** - * @class - * Initializes a new instance of the RedisForceRebootResponse class. - * @constructor * Response to force reboot for Redis cache. - * - * @member {string} [message] Status message */ export interface RedisForceRebootResponse { + /** + * Status message + */ readonly message?: string; } /** - * @class - * Initializes a new instance of the RedisLinkedServerWithProperties class. - * @constructor - * Response to put/get linked server (with properties) for Redis cache. - * - * @member {string} [id] Resource ID. - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. - * @member {string} linkedRedisCacheId Fully qualified resourceId of the linked - * redis cache. - * @member {string} linkedRedisCacheLocation Location of the linked redis - * cache. - * @member {string} serverRole Role of the linked server. Possible values - * include: 'Primary', 'Secondary' - * @member {string} [provisioningState] Terminal state of the link between - * primary and secondary redis cache. - */ -export interface RedisLinkedServerWithProperties { - readonly id?: string; - readonly name?: string; - readonly type?: string; + * Create properties for a linked server + */ +export interface RedisLinkedServerCreateProperties { + /** + * Fully qualified resourceId of the linked redis cache. + */ linkedRedisCacheId: string; + /** + * Location of the linked redis cache. + */ linkedRedisCacheLocation: string; + /** + * Role of the linked server. Possible values include: 'Primary', 'Secondary' + */ serverRole: string; +} + +/** + * Properties of a linked server to be returned in get/put response + */ +export interface RedisLinkedServerProperties extends RedisLinkedServerCreateProperties { + /** + * Terminal state of the link between primary and secondary redis cache. + */ readonly provisioningState?: string; } /** - * @class - * Initializes a new instance of the RedisLinkedServerWithPropertiesList class. - * @constructor - * List of linked servers (with properites) of a Redis cache. - * - * @member {array} value List of linked servers (with properites) of a Redis - * cache. + * Response to put/get linked server (with properties) for Redis cache. */ -export interface RedisLinkedServerWithPropertiesList { - value: RedisLinkedServerWithProperties[]; +export interface RedisLinkedServerWithProperties extends ProxyResource { + /** + * Fully qualified resourceId of the linked redis cache. + */ + linkedRedisCacheId: string; + /** + * Location of the linked redis cache. + */ + linkedRedisCacheLocation: string; + /** + * Role of the linked server. Possible values include: 'Primary', 'Secondary' + */ + serverRole: string; + /** + * Terminal state of the link between primary and secondary redis cache. + */ + readonly provisioningState?: string; } /** - * @class - * Initializes a new instance of the RedisLinkedServerCreateParameters class. - * @constructor * Parameter required for creating a linked server to redis cache. - * - * @member {string} linkedRedisCacheId Fully qualified resourceId of the linked - * redis cache. - * @member {string} linkedRedisCacheLocation Location of the linked redis - * cache. - * @member {string} serverRole Role of the linked server. Possible values - * include: 'Primary', 'Secondary' */ export interface RedisLinkedServerCreateParameters { + /** + * Fully qualified resourceId of the linked redis cache. + */ linkedRedisCacheId: string; + /** + * Location of the linked redis cache. + */ linkedRedisCacheLocation: string; + /** + * Role of the linked server. Possible values include: 'Primary', 'Secondary' + */ serverRole: string; } +/** + * The object that describes the operation. + */ +export interface OperationDisplay { + /** + * Friendly name of the resource provider + */ + provider?: string; + /** + * Operation type: read, write, delete, listKeys/action, etc. + */ + operation?: string; + /** + * Resource type on which the operation is performed. + */ + resource?: string; + /** + * Friendly name of the operation + */ + description?: string; +} + +/** + * REST API operation + */ +export interface Operation { + /** + * Operation name: {provider}/{resource}/{operation} + */ + name?: string; + /** + * The object that describes the operation. + */ + display?: OperationDisplay; +} + +/** + * Parameters body to pass for resource name availability check. + */ +export interface CheckNameAvailabilityParameters { + /** + * Resource name. + */ + name: string; + /** + * Resource type. The only legal value of this property for checking redis cache name + * availability is 'Microsoft.Cache/redis'. + */ + type: string; +} + +/** + * Properties of upgrade notification. + */ +export interface UpgradeNotification { + /** + * Name of upgrade notification. + */ + readonly name?: string; + /** + * Timestamp when upgrade notification occurred. + */ + readonly timestamp?: Date; + /** + * Details about this upgrade notification + */ + readonly upsellNotification?: { [propertyName: string]: string }; +} + +/** + * The response of listUpgradeNotifications. + */ +export interface NotificationListResponse { + /** + * List of all notifications. + */ + value?: UpgradeNotification[]; + /** + * Link for next set of notifications. + */ + readonly nextLink?: string; +} + +/** + * Result of the request to list REST API operations. It contains a list of operations and a URL + * nextLink to get the next set of results. + */ +export interface OperationListResult extends Array { + /** + * URL to get the next set of operation list results if there are any. + */ + readonly nextLink?: string; +} /** - * @class - * Initializes a new instance of the RedisListResult class. - * @constructor * The response of list Redis operation. - * - * @member {string} [nextLink] Link for next set of locations. */ export interface RedisListResult extends Array { - nextLink?: string; + /** + * Link for next page of results. + */ + readonly nextLink?: string; +} + +/** + * The response of list firewall rules Redis operation. + */ +export interface RedisFirewallRuleListResult extends Array { + /** + * Link for next page of results. + */ + readonly nextLink?: string; +} + +/** + * The response of list patch schedules Redis operation. + */ +export interface RedisPatchScheduleListResult extends Array { + /** + * Link for next page of results. + */ + readonly nextLink?: string; +} + +/** + * List of linked servers (with properties) of a Redis cache. + */ +export interface RedisLinkedServerWithPropertiesList extends Array { + /** + * Link for next set. + */ + readonly nextLink?: string; } diff --git a/lib/services/rediscachemanagement/lib/models/index.js b/lib/services/rediscachemanagement/lib/models/index.js index fdd2eb2cbc..fcfc7f948c 100644 --- a/lib/services/rediscachemanagement/lib/models/index.js +++ b/lib/services/rediscachemanagement/lib/models/index.js @@ -19,21 +19,36 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.Sku = require('./sku'); +exports.RedisAccessKeys = require('./redisAccessKeys'); +exports.RedisLinkedServer = require('./redisLinkedServer'); exports.Resource = require('./resource'); +exports.ProxyResource = require('./proxyResource'); +exports.TrackedResource = require('./trackedResource'); exports.RedisCreateParameters = require('./redisCreateParameters'); exports.RedisUpdateParameters = require('./redisUpdateParameters'); -exports.RedisAccessKeys = require('./redisAccessKeys'); -exports.RedisLinkedServer = require('./redisLinkedServer'); -exports.RedisLinkedServerList = require('./redisLinkedServerList'); +exports.RedisFirewallRuleProperties = require('./redisFirewallRuleProperties'); +exports.RedisFirewallRule = require('./redisFirewallRule'); +exports.RedisFirewallRuleCreateParameters = require('./redisFirewallRuleCreateParameters'); exports.RedisResource = require('./redisResource'); exports.RedisRegenerateKeyParameters = require('./redisRegenerateKeyParameters'); exports.RedisRebootParameters = require('./redisRebootParameters'); exports.ExportRDBParameters = require('./exportRDBParameters'); exports.ImportRDBParameters = require('./importRDBParameters'); exports.ScheduleEntry = require('./scheduleEntry'); +exports.ScheduleEntries = require('./scheduleEntries'); exports.RedisPatchSchedule = require('./redisPatchSchedule'); exports.RedisForceRebootResponse = require('./redisForceRebootResponse'); +exports.RedisLinkedServerCreateProperties = require('./redisLinkedServerCreateProperties'); +exports.RedisLinkedServerProperties = require('./redisLinkedServerProperties'); exports.RedisLinkedServerWithProperties = require('./redisLinkedServerWithProperties'); -exports.RedisLinkedServerWithPropertiesList = require('./redisLinkedServerWithPropertiesList'); exports.RedisLinkedServerCreateParameters = require('./redisLinkedServerCreateParameters'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.CheckNameAvailabilityParameters = require('./checkNameAvailabilityParameters'); +exports.UpgradeNotification = require('./upgradeNotification'); +exports.NotificationListResponse = require('./notificationListResponse'); +exports.OperationListResult = require('./operationListResult'); exports.RedisListResult = require('./redisListResult'); +exports.RedisFirewallRuleListResult = require('./redisFirewallRuleListResult'); +exports.RedisPatchScheduleListResult = require('./redisPatchScheduleListResult'); +exports.RedisLinkedServerWithPropertiesList = require('./redisLinkedServerWithPropertiesList'); diff --git a/lib/services/rediscachemanagement/lib/models/notificationListResponse.js b/lib/services/rediscachemanagement/lib/models/notificationListResponse.js new file mode 100644 index 0000000000..50cfe2d738 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/notificationListResponse.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * The response of listUpgradeNotifications. + * + */ +class NotificationListResponse { + /** + * Create a NotificationListResponse. + * @property {array} [value] List of all notifications. + * @property {string} [nextLink] Link for next set of notifications. + */ + constructor() { + } + + /** + * Defines the metadata of NotificationListResponse + * + * @returns {object} metadata of NotificationListResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'NotificationListResponse', + type: { + name: 'Composite', + className: 'NotificationListResponse', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UpgradeNotificationElementType', + type: { + name: 'Composite', + className: 'UpgradeNotification' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NotificationListResponse; diff --git a/lib/services/rediscachemanagement/lib/models/operation.js b/lib/services/rediscachemanagement/lib/models/operation.js new file mode 100644 index 0000000000..0a2ae2c220 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/operation.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * REST API operation + * + */ +class Operation { + /** + * Create a Operation. + * @property {string} [name] Operation name: + * {provider}/{resource}/{operation} + * @property {object} [display] The object that describes the operation. + * @property {string} [display.provider] Friendly name of the resource + * provider + * @property {string} [display.operation] Operation type: read, write, + * delete, listKeys/action, etc. + * @property {string} [display.resource] Resource type on which the operation + * is performed. + * @property {string} [display.description] Friendly name of the operation + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/rediscachemanagement/lib/models/operationDisplay.js b/lib/services/rediscachemanagement/lib/models/operationDisplay.js new file mode 100644 index 0000000000..281e216539 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/operationDisplay.js @@ -0,0 +1,78 @@ +/* + * 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'; + +/** + * The object that describes the operation. + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @property {string} [provider] Friendly name of the resource provider + * @property {string} [operation] Operation type: read, write, delete, + * listKeys/action, etc. + * @property {string} [resource] Resource type on which the operation is + * performed. + * @property {string} [description] Friendly name of the operation + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation_display', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/rediscachemanagement/lib/models/operationListResult.js b/lib/services/rediscachemanagement/lib/models/operationListResult.js new file mode 100644 index 0000000000..ab0e4192f6 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/operationListResult.js @@ -0,0 +1,70 @@ +/* + * 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'; + +/** + * Result of the request to list REST API operations. It contains a list of + * operations and a URL nextLink to get the next set of results. + */ +class OperationListResult extends Array { + /** + * Create a OperationListResult. + * @property {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationListResult + * + * @returns {object} metadata of OperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationListResult', + type: { + name: 'Composite', + className: 'OperationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationListResult; diff --git a/lib/services/rediscachemanagement/lib/models/proxyResource.js b/lib/services/rediscachemanagement/lib/models/proxyResource.js new file mode 100644 index 0000000000..43e93ec60e --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/proxyResource.js @@ -0,0 +1,73 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * The resource model definition for a ARM proxy resource. It will have + * everything other than required location and tags + * + * @extends models['Resource'] + */ +class ProxyResource extends models['Resource'] { + /** + * Create a ProxyResource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProxyResource + * + * @returns {object} metadata of ProxyResource + * + */ + mapper() { + return { + required: false, + serializedName: 'ProxyResource', + type: { + name: 'Composite', + className: 'ProxyResource', + 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' + } + } + } + } + }; + } +} + +module.exports = ProxyResource; diff --git a/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js b/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js index 8b2653d685..a33e3b1718 100644 --- a/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js +++ b/lib/services/rediscachemanagement/lib/models/redisAccessKeys.js @@ -17,10 +17,10 @@ class RedisAccessKeys { /** * Create a RedisAccessKeys. - * @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 + * @property {string} [primaryKey] The current primary key that clients can * use to authenticate with Redis cache. + * @property {string} [secondaryKey] The current secondary key that clients + * can use to authenticate with Redis cache. */ constructor() { } diff --git a/lib/services/rediscachemanagement/lib/models/redisCreateParameters.js b/lib/services/rediscachemanagement/lib/models/redisCreateParameters.js index c97847dba7..84f6a2d743 100644 --- a/lib/services/rediscachemanagement/lib/models/redisCreateParameters.js +++ b/lib/services/rediscachemanagement/lib/models/redisCreateParameters.js @@ -10,42 +10,45 @@ 'use strict'; -const models = require('./index'); - /** * Parameters supplied to the Create Redis operation. * - * @extends models['Resource'] */ -class RedisCreateParameters extends models['Resource'] { +class RedisCreateParameters { /** * Create a RedisCreateParameters. - * @member {object} [redisConfiguration] All Redis Settings. Few possible + * @property {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] Specifies whether the non-ssl Redis + * @property {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 + * @property {object} [tenantSettings] A dictionary of tenant settings + * @property {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] 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 + * @property {string} [minimumTlsVersion] Optional: requires clients to use a + * specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). + * Possible values include: '1.0', '1.1', '1.2' + * @property {object} sku The SKU of the Redis cache to deploy. + * @property {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. + * @property {string} [sku.family] The SKU family to use. Valid values: (C, + * P). (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P' + * @property {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). + * @property {string} [subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + * @property {string} [staticIP] Static IP address. Required when deploying a + * Redis cache inside an existing Azure Virtual Network. + * @property {array} [zones] A list of availability zones denoting where the + * resource needs to come from. + * @property {string} location The geo-location where the resource lives + * @property {object} [tags] Resource tags. */ constructor() { - super(); } /** @@ -62,51 +65,6 @@ class RedisCreateParameters extends models['Resource'] { name: 'Composite', className: 'RedisCreateParameters', 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' - } - } - } - }, redisConfiguration: { required: false, serializedName: 'properties.redisConfiguration', @@ -149,11 +107,26 @@ class RedisCreateParameters extends models['Resource'] { name: 'Number' } }, + minimumTlsVersion: { + required: false, + serializedName: 'properties.minimumTlsVersion', + type: { + name: 'String' + } + }, + sku: { + required: true, + serializedName: 'properties.sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, subnetId: { required: false, serializedName: 'properties.subnetId', constraints: { - Pattern: '^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$' + Pattern: /^\/subscriptions\/[^\/]*\/resourceGroups\/[^\/]*\/providers\/Microsoft.(ClassicNetwork|Network)\/virtualNetworks\/[^\/]*\/subnets\/[^\/]*$/ }, type: { name: 'String' @@ -163,18 +136,45 @@ class RedisCreateParameters extends models['Resource'] { required: false, serializedName: 'properties.staticIP', constraints: { - Pattern: '^\d+\.\d+\.\d+\.\d+$' + Pattern: /^\d+\.\d+\.\d+\.\d+$/ }, type: { name: 'String' } }, - sku: { + zones: { + required: false, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { required: true, - serializedName: 'properties.sku', + serializedName: 'location', type: { - name: 'Composite', - className: 'Sku' + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } } } } diff --git a/lib/services/rediscachemanagement/lib/models/redisFirewallRule.js b/lib/services/rediscachemanagement/lib/models/redisFirewallRule.js new file mode 100644 index 0000000000..55e695c388 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/redisFirewallRule.js @@ -0,0 +1,89 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * A firewall rule on a redis cache has a name, and describes a contiguous + * range of IP addresses permitted to connect + * + * @extends models['ProxyResource'] + */ +class RedisFirewallRule extends models['ProxyResource'] { + /** + * Create a RedisFirewallRule. + * @property {string} startIP lowest IP address included in the range + * @property {string} endIP highest IP address included in the range + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RedisFirewallRule + * + * @returns {object} metadata of RedisFirewallRule + * + */ + mapper() { + return { + required: false, + serializedName: 'RedisFirewallRule', + type: { + name: 'Composite', + className: 'RedisFirewallRule', + 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' + } + }, + startIP: { + required: true, + serializedName: 'properties.startIP', + type: { + name: 'String' + } + }, + endIP: { + required: true, + serializedName: 'properties.endIP', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RedisFirewallRule; diff --git a/lib/services/rediscachemanagement/lib/models/redisFirewallRuleCreateParameters.js b/lib/services/rediscachemanagement/lib/models/redisFirewallRuleCreateParameters.js new file mode 100644 index 0000000000..d5f25b3b44 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/redisFirewallRuleCreateParameters.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Parameters required for creating a firewall rule on redis cache. + * + */ +class RedisFirewallRuleCreateParameters { + /** + * Create a RedisFirewallRuleCreateParameters. + * @property {string} startIP lowest IP address included in the range + * @property {string} endIP highest IP address included in the range + */ + constructor() { + } + + /** + * Defines the metadata of RedisFirewallRuleCreateParameters + * + * @returns {object} metadata of RedisFirewallRuleCreateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'RedisFirewallRuleCreateParameters', + type: { + name: 'Composite', + className: 'RedisFirewallRuleCreateParameters', + modelProperties: { + startIP: { + required: true, + serializedName: 'properties.startIP', + type: { + name: 'String' + } + }, + endIP: { + required: true, + serializedName: 'properties.endIP', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RedisFirewallRuleCreateParameters; diff --git a/lib/services/rediscachemanagement/lib/models/redisFirewallRuleListResult.js b/lib/services/rediscachemanagement/lib/models/redisFirewallRuleListResult.js new file mode 100644 index 0000000000..33f863e6f8 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/redisFirewallRuleListResult.js @@ -0,0 +1,68 @@ +/* + * 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'; + +/** + * The response of list firewall rules Redis operation. + */ +class RedisFirewallRuleListResult extends Array { + /** + * Create a RedisFirewallRuleListResult. + * @property {string} [nextLink] Link for next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RedisFirewallRuleListResult + * + * @returns {object} metadata of RedisFirewallRuleListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RedisFirewallRuleListResult', + type: { + name: 'Composite', + className: 'RedisFirewallRuleListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RedisFirewallRuleElementType', + type: { + name: 'Composite', + className: 'RedisFirewallRule' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RedisFirewallRuleListResult; diff --git a/lib/services/rediscachemanagement/lib/models/redisFirewallRuleProperties.js b/lib/services/rediscachemanagement/lib/models/redisFirewallRuleProperties.js new file mode 100644 index 0000000000..10cb88506d --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/redisFirewallRuleProperties.js @@ -0,0 +1,60 @@ +/* + * 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'; + +/** + * Specifies a range of IP addresses permitted to connect to the cache + * + */ +class RedisFirewallRuleProperties { + /** + * Create a RedisFirewallRuleProperties. + * @property {string} startIP lowest IP address included in the range + * @property {string} endIP highest IP address included in the range + */ + constructor() { + } + + /** + * Defines the metadata of RedisFirewallRuleProperties + * + * @returns {object} metadata of RedisFirewallRuleProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'RedisFirewallRuleProperties', + type: { + name: 'Composite', + className: 'RedisFirewallRuleProperties', + modelProperties: { + startIP: { + required: true, + serializedName: 'startIP', + type: { + name: 'String' + } + }, + endIP: { + required: true, + serializedName: 'endIP', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RedisFirewallRuleProperties; diff --git a/lib/services/rediscachemanagement/lib/models/redisForceRebootResponse.js b/lib/services/rediscachemanagement/lib/models/redisForceRebootResponse.js index 02731a1578..baf2ae9a28 100644 --- a/lib/services/rediscachemanagement/lib/models/redisForceRebootResponse.js +++ b/lib/services/rediscachemanagement/lib/models/redisForceRebootResponse.js @@ -17,7 +17,7 @@ class RedisForceRebootResponse { /** * Create a RedisForceRebootResponse. - * @member {string} [message] Status message + * @property {string} [message] Status message */ constructor() { } @@ -39,7 +39,7 @@ class RedisForceRebootResponse { message: { required: false, readOnly: true, - serializedName: 'Message', + serializedName: 'message', type: { name: 'String' } diff --git a/lib/services/rediscachemanagement/lib/models/redisLinkedServer.js b/lib/services/rediscachemanagement/lib/models/redisLinkedServer.js index 9a49f92b13..965b5ea466 100644 --- a/lib/services/rediscachemanagement/lib/models/redisLinkedServer.js +++ b/lib/services/rediscachemanagement/lib/models/redisLinkedServer.js @@ -17,7 +17,7 @@ class RedisLinkedServer { /** * Create a RedisLinkedServer. - * @member {string} [id] Linked server Id. + * @property {string} [id] Linked server Id. */ constructor() { } diff --git a/lib/services/rediscachemanagement/lib/models/redisLinkedServerCreateParameters.js b/lib/services/rediscachemanagement/lib/models/redisLinkedServerCreateParameters.js index 66c67d198b..f24d00f613 100644 --- a/lib/services/rediscachemanagement/lib/models/redisLinkedServerCreateParameters.js +++ b/lib/services/rediscachemanagement/lib/models/redisLinkedServerCreateParameters.js @@ -17,11 +17,11 @@ class RedisLinkedServerCreateParameters { /** * Create a RedisLinkedServerCreateParameters. - * @member {string} linkedRedisCacheId Fully qualified resourceId of the + * @property {string} linkedRedisCacheId Fully qualified resourceId of the * linked redis cache. - * @member {string} linkedRedisCacheLocation Location of the linked redis + * @property {string} linkedRedisCacheLocation Location of the linked redis * cache. - * @member {string} serverRole Role of the linked server. Possible values + * @property {string} serverRole Role of the linked server. Possible values * include: 'Primary', 'Secondary' */ constructor() { diff --git a/lib/services/rediscachemanagement/lib/models/redisLinkedServerCreateProperties.js b/lib/services/rediscachemanagement/lib/models/redisLinkedServerCreateProperties.js new file mode 100644 index 0000000000..6946fdb1c0 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/redisLinkedServerCreateProperties.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * Create properties for a linked server + * + */ +class RedisLinkedServerCreateProperties { + /** + * Create a RedisLinkedServerCreateProperties. + * @property {string} linkedRedisCacheId Fully qualified resourceId of the + * linked redis cache. + * @property {string} linkedRedisCacheLocation Location of the linked redis + * cache. + * @property {string} serverRole Role of the linked server. Possible values + * include: 'Primary', 'Secondary' + */ + constructor() { + } + + /** + * Defines the metadata of RedisLinkedServerCreateProperties + * + * @returns {object} metadata of RedisLinkedServerCreateProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'RedisLinkedServerCreateProperties', + type: { + name: 'Composite', + className: 'RedisLinkedServerCreateProperties', + modelProperties: { + linkedRedisCacheId: { + required: true, + serializedName: 'linkedRedisCacheId', + type: { + name: 'String' + } + }, + linkedRedisCacheLocation: { + required: true, + serializedName: 'linkedRedisCacheLocation', + type: { + name: 'String' + } + }, + serverRole: { + required: true, + serializedName: 'serverRole', + type: { + name: 'Enum', + allowedValues: [ 'Primary', 'Secondary' ] + } + } + } + } + }; + } +} + +module.exports = RedisLinkedServerCreateProperties; diff --git a/lib/services/rediscachemanagement/lib/models/redisLinkedServerProperties.js b/lib/services/rediscachemanagement/lib/models/redisLinkedServerProperties.js new file mode 100644 index 0000000000..4123437ff1 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/redisLinkedServerProperties.js @@ -0,0 +1,80 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * Properties of a linked server to be returned in get/put response + * + * @extends models['RedisLinkedServerCreateProperties'] + */ +class RedisLinkedServerProperties extends models['RedisLinkedServerCreateProperties'] { + /** + * Create a RedisLinkedServerProperties. + * @property {string} [provisioningState] Terminal state of the link between + * primary and secondary redis cache. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RedisLinkedServerProperties + * + * @returns {object} metadata of RedisLinkedServerProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'RedisLinkedServerProperties', + type: { + name: 'Composite', + className: 'RedisLinkedServerProperties', + modelProperties: { + linkedRedisCacheId: { + required: true, + serializedName: 'linkedRedisCacheId', + type: { + name: 'String' + } + }, + linkedRedisCacheLocation: { + required: true, + serializedName: 'linkedRedisCacheLocation', + type: { + name: 'String' + } + }, + serverRole: { + required: true, + serializedName: 'serverRole', + type: { + name: 'Enum', + allowedValues: [ 'Primary', 'Secondary' ] + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RedisLinkedServerProperties; diff --git a/lib/services/rediscachemanagement/lib/models/redisLinkedServerWithProperties.js b/lib/services/rediscachemanagement/lib/models/redisLinkedServerWithProperties.js index d01bee397f..bacafa0138 100644 --- a/lib/services/rediscachemanagement/lib/models/redisLinkedServerWithProperties.js +++ b/lib/services/rediscachemanagement/lib/models/redisLinkedServerWithProperties.js @@ -10,26 +10,27 @@ 'use strict'; +const models = require('./index'); + /** * Response to put/get linked server (with properties) for Redis cache. * + * @extends models['ProxyResource'] */ -class RedisLinkedServerWithProperties { +class RedisLinkedServerWithProperties extends models['ProxyResource'] { /** * Create a RedisLinkedServerWithProperties. - * @member {string} [id] Resource ID. - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. - * @member {string} linkedRedisCacheId Fully qualified resourceId of the + * @property {string} linkedRedisCacheId Fully qualified resourceId of the * linked redis cache. - * @member {string} linkedRedisCacheLocation Location of the linked redis + * @property {string} linkedRedisCacheLocation Location of the linked redis * cache. - * @member {string} serverRole Role of the linked server. Possible values + * @property {string} serverRole Role of the linked server. Possible values * include: 'Primary', 'Secondary' - * @member {string} [provisioningState] Terminal state of the link between + * @property {string} [provisioningState] Terminal state of the link between * primary and secondary redis cache. */ constructor() { + super(); } /** diff --git a/lib/services/rediscachemanagement/lib/models/redisLinkedServerWithPropertiesList.js b/lib/services/rediscachemanagement/lib/models/redisLinkedServerWithPropertiesList.js index ad6a4a9ff9..bca7a1c9fc 100644 --- a/lib/services/rediscachemanagement/lib/models/redisLinkedServerWithPropertiesList.js +++ b/lib/services/rediscachemanagement/lib/models/redisLinkedServerWithPropertiesList.js @@ -10,19 +10,16 @@ 'use strict'; -const models = require('./index'); - /** - * List of linked servers (with properites) of a Redis cache. - * + * List of linked servers (with properties) of a Redis cache. */ -class RedisLinkedServerWithPropertiesList { +class RedisLinkedServerWithPropertiesList extends Array { /** * Create a RedisLinkedServerWithPropertiesList. - * @member {array} value List of linked servers (with properites) of a Redis - * cache. + * @property {string} [nextLink] Link for next set. */ constructor() { + super(); } /** @@ -40,8 +37,8 @@ class RedisLinkedServerWithPropertiesList { className: 'RedisLinkedServerWithPropertiesList', modelProperties: { value: { - required: true, - serializedName: 'value', + required: false, + serializedName: '', type: { name: 'Sequence', element: { @@ -53,6 +50,14 @@ class RedisLinkedServerWithPropertiesList { } } } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } } } } diff --git a/lib/services/rediscachemanagement/lib/models/redisListResult.js b/lib/services/rediscachemanagement/lib/models/redisListResult.js index 2b2e32e385..0988417a25 100644 --- a/lib/services/rediscachemanagement/lib/models/redisListResult.js +++ b/lib/services/rediscachemanagement/lib/models/redisListResult.js @@ -16,7 +16,7 @@ class RedisListResult extends Array { /** * Create a RedisListResult. - * @member {string} [nextLink] Link for next set of locations. + * @property {string} [nextLink] Link for next page of results. */ constructor() { super(); @@ -53,6 +53,7 @@ class RedisListResult extends Array { }, nextLink: { required: false, + readOnly: true, serializedName: 'nextLink', type: { name: 'String' diff --git a/lib/services/rediscachemanagement/lib/models/redisPatchSchedule.js b/lib/services/rediscachemanagement/lib/models/redisPatchSchedule.js index 4603752530..c33dde39e5 100644 --- a/lib/services/rediscachemanagement/lib/models/redisPatchSchedule.js +++ b/lib/services/rediscachemanagement/lib/models/redisPatchSchedule.js @@ -15,17 +15,16 @@ const models = require('./index'); /** * Response to put/get patch schedules for Redis cache. * + * @extends models['ProxyResource'] */ -class RedisPatchSchedule { +class RedisPatchSchedule extends models['ProxyResource'] { /** * Create a RedisPatchSchedule. - * @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. + * @property {array} scheduleEntries List of patch schedules for a Redis + * cache. */ constructor() { + super(); } /** @@ -66,14 +65,6 @@ class RedisPatchSchedule { name: 'String' } }, - location: { - required: false, - readOnly: true, - serializedName: 'location', - type: { - name: 'String' - } - }, scheduleEntries: { required: true, serializedName: 'properties.scheduleEntries', diff --git a/lib/services/rediscachemanagement/lib/models/redisPatchScheduleListResult.js b/lib/services/rediscachemanagement/lib/models/redisPatchScheduleListResult.js new file mode 100644 index 0000000000..c9a4b60bc3 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/redisPatchScheduleListResult.js @@ -0,0 +1,68 @@ +/* + * 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'; + +/** + * The response of list patch schedules Redis operation. + */ +class RedisPatchScheduleListResult extends Array { + /** + * Create a RedisPatchScheduleListResult. + * @property {string} [nextLink] Link for next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RedisPatchScheduleListResult + * + * @returns {object} metadata of RedisPatchScheduleListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RedisPatchScheduleListResult', + type: { + name: 'Composite', + className: 'RedisPatchScheduleListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RedisPatchScheduleElementType', + type: { + name: 'Composite', + className: 'RedisPatchSchedule' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RedisPatchScheduleListResult; diff --git a/lib/services/rediscachemanagement/lib/models/redisRebootParameters.js b/lib/services/rediscachemanagement/lib/models/redisRebootParameters.js index 1ab0fce62d..ba0cc5da98 100644 --- a/lib/services/rediscachemanagement/lib/models/redisRebootParameters.js +++ b/lib/services/rediscachemanagement/lib/models/redisRebootParameters.js @@ -17,10 +17,10 @@ class RedisRebootParameters { /** * Create a RedisRebootParameters. - * @member {string} rebootType Which Redis node(s) to reboot. Depending on + * @property {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] If clustering is enabled, the ID of the shard + * @property {number} [shardId] If clustering is enabled, the ID of the shard * to be rebooted. */ constructor() { diff --git a/lib/services/rediscachemanagement/lib/models/redisRegenerateKeyParameters.js b/lib/services/rediscachemanagement/lib/models/redisRegenerateKeyParameters.js index 07e9f05424..83bd57fb92 100644 --- a/lib/services/rediscachemanagement/lib/models/redisRegenerateKeyParameters.js +++ b/lib/services/rediscachemanagement/lib/models/redisRegenerateKeyParameters.js @@ -17,7 +17,7 @@ class RedisRegenerateKeyParameters { /** * Create a RedisRegenerateKeyParameters. - * @member {string} keyType The Redis access key to regenerate. Possible + * @property {string} keyType The Redis access key to regenerate. Possible * values include: 'Primary', 'Secondary' */ constructor() { diff --git a/lib/services/rediscachemanagement/lib/models/redisResource.js b/lib/services/rediscachemanagement/lib/models/redisResource.js index 9124f92e55..30f8f11473 100644 --- a/lib/services/rediscachemanagement/lib/models/redisResource.js +++ b/lib/services/rediscachemanagement/lib/models/redisResource.js @@ -15,49 +15,55 @@ const models = require('./index'); /** * A single Redis item in List or Get Operation. * - * @extends models['Resource'] + * @extends models['TrackedResource'] */ -class RedisResource extends models['Resource'] { +class RedisResource extends models['TrackedResource'] { /** * Create a RedisResource. - * @member {object} [redisConfiguration] All Redis Settings. Few possible + * @property {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] Specifies whether the non-ssl Redis + * @property {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 + * @property {object} [tenantSettings] A dictionary of tenant settings + * @property {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] 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 + * @property {string} [minimumTlsVersion] Optional: requires clients to use a + * specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). + * Possible values include: '1.0', '1.1', '1.2' + * @property {object} sku The SKU of the Redis cache to deploy. + * @property {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. + * @property {string} [sku.family] The SKU family to use. Valid values: (C, + * P). (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P' + * @property {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 + * @property {string} [subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + * @property {string} [staticIP] Static IP address. Required when deploying a + * Redis cache inside an existing Azure Virtual Network. + * @property {string} [redisVersion] Redis version. + * @property {string} [provisioningState] Redis instance provisioning status. + * Possible values include: 'Creating', 'Deleting', 'Disabled', 'Failed', + * 'Linking', 'Provisioning', 'RecoveringScaleFailure', 'Scaling', + * 'Succeeded', 'Unlinking', 'Unprovisioning', 'Updating' + * @property {string} [hostName] Redis host name. + * @property {number} [port] Redis non-SSL port. + * @property {number} [sslPort] Redis SSL port. + * @property {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 + * @property {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. - * @member {object} [linkedServers] List of the linked servers associated + * @property {string} [accessKeys.secondaryKey] The current secondary key + * that clients can use to authenticate with Redis cache. + * @property {array} [linkedServers] List of the linked servers associated * with the cache - * @member {array} [linkedServers.value] List of linked server Ids of a Redis - * cache. + * @property {array} [zones] A list of availability zones denoting where the + * resource needs to come from. */ constructor() { super(); @@ -101,13 +107,6 @@ class RedisResource extends models['Resource'] { name: 'String' } }, - location: { - required: true, - serializedName: 'location', - type: { - name: 'String' - } - }, tags: { required: false, serializedName: 'tags', @@ -122,6 +121,13 @@ class RedisResource extends models['Resource'] { } } }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, redisConfiguration: { required: false, serializedName: 'properties.redisConfiguration', @@ -164,11 +170,26 @@ class RedisResource extends models['Resource'] { name: 'Number' } }, + minimumTlsVersion: { + required: false, + serializedName: 'properties.minimumTlsVersion', + type: { + name: 'String' + } + }, + sku: { + required: true, + serializedName: 'properties.sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, subnetId: { required: false, serializedName: 'properties.subnetId', constraints: { - Pattern: '^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$' + Pattern: /^\/subscriptions\/[^\/]*\/resourceGroups\/[^\/]*\/providers\/Microsoft.(ClassicNetwork|Network)\/virtualNetworks\/[^\/]*\/subnets\/[^\/]*$/ }, type: { name: 'String' @@ -178,20 +199,12 @@ class RedisResource extends models['Resource'] { required: false, serializedName: 'properties.staticIP', constraints: { - Pattern: '^\d+\.\d+\.\d+\.\d+$' + Pattern: /^\d+\.\d+\.\d+\.\d+$/ }, type: { name: 'String' } }, - sku: { - required: false, - serializedName: 'properties.sku', - type: { - name: 'Composite', - className: 'Sku' - } - }, redisVersion: { required: false, readOnly: true, @@ -246,8 +259,29 @@ class RedisResource extends models['Resource'] { readOnly: true, serializedName: 'properties.linkedServers', type: { - name: 'Composite', - className: 'RedisLinkedServerList' + name: 'Sequence', + element: { + required: false, + serializedName: 'RedisLinkedServerElementType', + type: { + name: 'Composite', + className: 'RedisLinkedServer' + } + } + } + }, + zones: { + required: false, + serializedName: 'zones', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } } } } diff --git a/lib/services/rediscachemanagement/lib/models/redisUpdateParameters.js b/lib/services/rediscachemanagement/lib/models/redisUpdateParameters.js index 1018017ae1..309ab1df5e 100644 --- a/lib/services/rediscachemanagement/lib/models/redisUpdateParameters.js +++ b/lib/services/rediscachemanagement/lib/models/redisUpdateParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Parameters supplied to the Update Redis operation. * @@ -19,30 +17,28 @@ const models = require('./index'); class RedisUpdateParameters { /** * Create a RedisUpdateParameters. - * @member {object} [redisConfiguration] All Redis Settings. Few possible + * @property {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] Specifies whether the non-ssl Redis + * @property {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 + * @property {object} [tenantSettings] A dictionary of tenant settings + * @property {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] 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 + * @property {string} [minimumTlsVersion] Optional: requires clients to use a + * specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). + * Possible values include: '1.0', '1.1', '1.2' + * @property {object} [sku] The SKU of the Redis cache to deploy. + * @property {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. + * @property {string} [sku.family] The SKU family to use. Valid values: (C, + * P). (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P' + * @property {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. + * @property {object} [tags] Resource tags. */ constructor() { } @@ -103,22 +99,9 @@ class RedisUpdateParameters { name: 'Number' } }, - subnetId: { - required: false, - serializedName: 'properties.subnetId', - constraints: { - Pattern: '^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$' - }, - type: { - name: 'String' - } - }, - staticIP: { + minimumTlsVersion: { required: false, - serializedName: 'properties.staticIP', - constraints: { - Pattern: '^\d+\.\d+\.\d+\.\d+$' - }, + serializedName: 'properties.minimumTlsVersion', type: { name: 'String' } @@ -133,7 +116,7 @@ class RedisUpdateParameters { }, tags: { required: false, - serializedName: 'properties.tags', + serializedName: 'tags', type: { name: 'Dictionary', value: { diff --git a/lib/services/rediscachemanagement/lib/models/resource.js b/lib/services/rediscachemanagement/lib/models/resource.js index ce3c115057..ff4d38f3c9 100644 --- a/lib/services/rediscachemanagement/lib/models/resource.js +++ b/lib/services/rediscachemanagement/lib/models/resource.js @@ -20,11 +20,9 @@ const models = require('./index'); class Resource extends models['BaseResource'] { /** * Create a Resource. - * @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. + * @property {string} [id] Resource ID. + * @property {string} [name] Resource name. + * @property {string} [type] Resource type. */ constructor() { super(); @@ -67,27 +65,6 @@ class Resource extends models['BaseResource'] { 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' - } - } - } } } } diff --git a/lib/services/rediscachemanagement/lib/models/redisLinkedServerList.js b/lib/services/rediscachemanagement/lib/models/scheduleEntries.js similarity index 56% rename from lib/services/rediscachemanagement/lib/models/redisLinkedServerList.js rename to lib/services/rediscachemanagement/lib/models/scheduleEntries.js index aa107ae92c..2126ea9fb3 100644 --- a/lib/services/rediscachemanagement/lib/models/redisLinkedServerList.js +++ b/lib/services/rediscachemanagement/lib/models/scheduleEntries.js @@ -10,45 +10,44 @@ 'use strict'; -const models = require('./index'); - /** - * List of linked server Ids of a Redis cache. + * List of patch schedules for a Redis cache. * */ -class RedisLinkedServerList { +class ScheduleEntries { /** - * Create a RedisLinkedServerList. - * @member {array} value List of linked server Ids of a Redis cache. + * Create a ScheduleEntries. + * @property {array} scheduleEntries List of patch schedules for a Redis + * cache. */ constructor() { } /** - * Defines the metadata of RedisLinkedServerList + * Defines the metadata of ScheduleEntries * - * @returns {object} metadata of RedisLinkedServerList + * @returns {object} metadata of ScheduleEntries * */ mapper() { return { required: false, - serializedName: 'RedisLinkedServerList', + serializedName: 'ScheduleEntries', type: { name: 'Composite', - className: 'RedisLinkedServerList', + className: 'ScheduleEntries', modelProperties: { - value: { + scheduleEntries: { required: true, - serializedName: 'value', + serializedName: 'scheduleEntries', type: { name: 'Sequence', element: { required: false, - serializedName: 'RedisLinkedServerElementType', + serializedName: 'ScheduleEntryElementType', type: { name: 'Composite', - className: 'RedisLinkedServer' + className: 'ScheduleEntry' } } } @@ -59,4 +58,4 @@ class RedisLinkedServerList { } } -module.exports = RedisLinkedServerList; +module.exports = ScheduleEntries; diff --git a/lib/services/rediscachemanagement/lib/models/scheduleEntry.js b/lib/services/rediscachemanagement/lib/models/scheduleEntry.js index fd45797776..be2f343bd4 100644 --- a/lib/services/rediscachemanagement/lib/models/scheduleEntry.js +++ b/lib/services/rediscachemanagement/lib/models/scheduleEntry.js @@ -17,13 +17,13 @@ class ScheduleEntry { /** * Create a ScheduleEntry. - * @member {string} dayOfWeek Day of the week when a cache can be patched. + * @property {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 + * @property {number} startHourUtc Start hour after which cache patching can * start. - * @member {moment.duration} [maintenanceWindow] ISO8601 timespan specifying - * how much time cache patching can take. + * @property {moment.duration} [maintenanceWindow] ISO8601 timespan + * specifying how much time cache patching can take. */ constructor() { } diff --git a/lib/services/rediscachemanagement/lib/models/sku.js b/lib/services/rediscachemanagement/lib/models/sku.js index 026f29ccb7..c6478f6701 100644 --- a/lib/services/rediscachemanagement/lib/models/sku.js +++ b/lib/services/rediscachemanagement/lib/models/sku.js @@ -17,12 +17,12 @@ class Sku { /** * Create a Sku. - * @member {string} name The type of Redis cache to deploy. Valid values: + * @property {string} name The type of Redis cache to deploy. Valid values: * (Basic, Standard, Premium). Possible values include: 'Basic', 'Standard', * 'Premium' - * @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 + * @property {string} family The SKU family to use. Valid values: (C, P). (C + * = Basic/Standard, P = Premium). Possible values include: 'C', 'P' + * @property {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). */ diff --git a/lib/services/rediscachemanagement/lib/models/trackedResource.js b/lib/services/rediscachemanagement/lib/models/trackedResource.js new file mode 100644 index 0000000000..d74a5106d9 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/trackedResource.js @@ -0,0 +1,95 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * The resource model definition for a ARM tracked top level resource + * + * @extends models['Resource'] + */ +class TrackedResource extends models['Resource'] { + /** + * Create a TrackedResource. + * @property {object} [tags] Resource tags. + * @property {string} location The geo-location where the resource lives + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TrackedResource + * + * @returns {object} metadata of TrackedResource + * + */ + mapper() { + return { + required: false, + serializedName: 'TrackedResource', + type: { + name: 'Composite', + className: 'TrackedResource', + 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' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TrackedResource; diff --git a/lib/services/rediscachemanagement/lib/models/upgradeNotification.js b/lib/services/rediscachemanagement/lib/models/upgradeNotification.js new file mode 100644 index 0000000000..346d7d79c4 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/models/upgradeNotification.js @@ -0,0 +1,79 @@ +/* + * 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'; + +/** + * Properties of upgrade notification. + * + */ +class UpgradeNotification { + /** + * Create a UpgradeNotification. + * @property {string} [name] Name of upgrade notification. + * @property {date} [timestamp] Timestamp when upgrade notification occurred. + * @property {object} [upsellNotification] Details about this upgrade + * notification + */ + constructor() { + } + + /** + * Defines the metadata of UpgradeNotification + * + * @returns {object} metadata of UpgradeNotification + * + */ + mapper() { + return { + required: false, + serializedName: 'UpgradeNotification', + type: { + name: 'Composite', + className: 'UpgradeNotification', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + timestamp: { + required: false, + readOnly: true, + serializedName: 'timestamp', + type: { + name: 'DateTime' + } + }, + upsellNotification: { + required: false, + readOnly: true, + serializedName: 'upsellNotification', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = UpgradeNotification; diff --git a/lib/services/rediscachemanagement/lib/operations/firewallRules.js b/lib/services/rediscachemanagement/lib/operations/firewallRules.js new file mode 100644 index 0000000000..93af4314e2 --- /dev/null +++ b/lib/services/rediscachemanagement/lib/operations/firewallRules.js @@ -0,0 +1,1239 @@ +/* + * 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'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all firewall rules in the specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName 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 - The 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 if an error did not occur. + * See {@link RedisFirewallRuleListResult} 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. + */ +function _listByRedisResource(resourceGroupName, cacheName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + 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 (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 (cacheName === null || cacheName === undefined || typeof cacheName.valueOf() !== 'string') { + throw new Error('cacheName 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 + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{cacheName}', encodeURIComponent(cacheName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RedisFirewallRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Create or update a redis cache firewall rule + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} parameters Parameters supplied to the create or update redis + * firewall rule operation. + * + * @param {string} parameters.startIP lowest IP address included in the range + * + * @param {string} parameters.endIP highest IP address included in the range + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The 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 if an error did not occur. + * See {@link RedisFirewallRule} 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. + */ +function _createOrUpdate(resourceGroupName, cacheName, ruleName, parameters, options, callback) { + /* jshint validthis: true */ + let 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 (cacheName === null || cacheName === undefined || typeof cacheName.valueOf() !== 'string') { + throw new Error('cacheName cannot be null or undefined and it must be of type string.'); + } + if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { + throw new Error('ruleName 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); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{cacheName}', encodeURIComponent(cacheName)); + requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['RedisFirewallRuleCreateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RedisFirewallRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RedisFirewallRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a single firewall rule in a specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The 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 if an error did not occur. + * See {@link RedisFirewallRule} 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. + */ +function _get(resourceGroupName, cacheName, ruleName, options, callback) { + /* jshint validthis: true */ + let 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 (cacheName === null || cacheName === undefined || typeof cacheName.valueOf() !== 'string') { + throw new Error('cacheName cannot be null or undefined and it must be of type string.'); + } + if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { + throw new Error('ruleName 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 + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{cacheName}', encodeURIComponent(cacheName)); + requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RedisFirewallRule']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a single firewall rule in a specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The 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 if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, cacheName, ruleName, options, callback) { + /* jshint validthis: true */ + let 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 (cacheName === null || cacheName === undefined || typeof cacheName.valueOf() !== 'string') { + throw new Error('cacheName cannot be null or undefined and it must be of type string.'); + } + if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { + throw new Error('ruleName 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 + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{cacheName}', encodeURIComponent(cacheName)); + requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all firewall rules in the specified redis cache. + * + * @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 - The 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 if an error did not occur. + * See {@link RedisFirewallRuleListResult} 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. + */ +function _listByRedisResourceNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink 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 + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RedisFirewallRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a FirewallRules. */ +class FirewallRules { + /** + * Create a FirewallRules. + * @param {RedisManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByRedisResource = _listByRedisResource; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._listByRedisResourceNext = _listByRedisResourceNext; + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByRedisResourceWithHttpOperationResponse(resourceGroupName, cacheName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByRedisResource(resourceGroupName, cacheName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName 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} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RedisFirewallRuleListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RedisFirewallRuleListResult} 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. + */ + listByRedisResource(resourceGroupName, cacheName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByRedisResource(resourceGroupName, cacheName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByRedisResource(resourceGroupName, cacheName, options, optionalCallback); + } + } + + /** + * Create or update a redis cache firewall rule + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} parameters Parameters supplied to the create or update redis + * firewall rule operation. + * + * @param {string} parameters.startIP lowest IP address included in the range + * + * @param {string} parameters.endIP highest IP address included in the range + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, cacheName, ruleName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, cacheName, ruleName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or update a redis cache firewall rule + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} parameters Parameters supplied to the create or update redis + * firewall rule operation. + * + * @param {string} parameters.startIP lowest IP address included in the range + * + * @param {string} parameters.endIP highest IP address included in the range + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RedisFirewallRule} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RedisFirewallRule} 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. + */ + createOrUpdate(resourceGroupName, cacheName, ruleName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, cacheName, ruleName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, cacheName, ruleName, parameters, options, optionalCallback); + } + } + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, cacheName, ruleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, cacheName, ruleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RedisFirewallRule} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RedisFirewallRule} 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. + */ + get(resourceGroupName, cacheName, ruleName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, cacheName, ruleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, cacheName, ruleName, options, optionalCallback); + } + } + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, cacheName, ruleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, cacheName, ruleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, cacheName, ruleName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, cacheName, ruleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, cacheName, ruleName, options, optionalCallback); + } + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByRedisResourceNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByRedisResourceNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all firewall rules in the specified redis cache. + * + * @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} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RedisFirewallRuleListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RedisFirewallRuleListResult} 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. + */ + listByRedisResourceNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByRedisResourceNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByRedisResourceNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = FirewallRules; diff --git a/lib/services/rediscachemanagement/lib/operations/index.d.ts b/lib/services/rediscachemanagement/lib/operations/index.d.ts index c576a06781..0ec401241b 100644 --- a/lib/services/rediscachemanagement/lib/operations/index.d.ts +++ b/lib/services/rediscachemanagement/lib/operations/index.d.ts @@ -12,6 +12,127 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the RedisManagementClient. + */ +export interface Operations { + + + /** + * Lists all of the available REST API operations of the Microsoft.Cache + * provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the available REST API operations of the Microsoft.Cache + * provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the available REST API operations of the Microsoft.Cache + * provider. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the available REST API operations of the Microsoft.Cache + * provider. + * + * @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} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * Redis @@ -21,6 +142,140 @@ import * as models from '../models'; export interface Redis { + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param {object} parameters Parameters supplied to the CheckNameAvailability + * Redis operation. The only supported resource type is 'Microsoft.Cache/redis' + * + * @param {string} parameters.name Resource name. + * + * @param {string} parameters.type Resource type. The only legal value of this + * property for checking redis cache name availability is + * 'Microsoft.Cache/redis'. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + checkNameAvailabilityWithHttpOperationResponse(parameters: models.CheckNameAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param {object} parameters Parameters supplied to the CheckNameAvailability + * Redis operation. The only supported resource type is 'Microsoft.Cache/redis' + * + * @param {string} parameters.name Resource name. + * + * @param {string} parameters.type Resource type. The only legal value of this + * property for checking redis cache name availability is + * 'Microsoft.Cache/redis'. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + checkNameAvailability(parameters: models.CheckNameAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkNameAvailability(parameters: models.CheckNameAvailabilityParameters, callback: ServiceCallback): void; + checkNameAvailability(parameters: models.CheckNameAvailabilityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {number} history how many minutes in past to look for upgrade + * notifications + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listUpgradeNotificationsWithHttpOperationResponse(resourceGroupName: string, name: string, history: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {number} history how many minutes in past to look for upgrade + * notifications + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NotificationListResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {NotificationListResponse} [result] - The deserialized result object if an error did not occur. + * See {@link NotificationListResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listUpgradeNotifications(resourceGroupName: string, name: string, history: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listUpgradeNotifications(resourceGroupName: string, name: string, history: number, callback: ServiceCallback): void; + listUpgradeNotifications(resourceGroupName: string, name: string, history: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Create or replace (overwrite/recreate, with potential downtime) an existing * Redis cache. @@ -40,17 +295,14 @@ export interface Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} parameters.sku The SKU of the Redis cache to deploy. * @@ -65,7 +317,18 @@ export interface Redis { * 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 {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/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 {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * + * @param {string} parameters.location The geo-location where the resource + * lives * * @param {object} [parameters.tags] Resource tags. * @@ -101,17 +364,14 @@ export interface Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} parameters.sku The SKU of the Redis cache to deploy. * @@ -126,7 +386,18 @@ export interface Redis { * 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 {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/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 {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * + * @param {string} parameters.location The geo-location where the resource + * lives * * @param {object} [parameters.tags] Resource tags. * @@ -180,17 +451,14 @@ export interface Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} [parameters.sku] The SKU of the Redis cache to deploy. * @@ -238,17 +506,14 @@ export interface Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} [parameters.sku] The SKU of the Redis cache to deploy. * @@ -891,17 +1156,14 @@ export interface Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} parameters.sku The SKU of the Redis cache to deploy. * @@ -916,7 +1178,18 @@ export interface Redis { * 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 {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/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 {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * + * @param {string} parameters.location The geo-location where the resource + * lives * * @param {object} [parameters.tags] Resource tags. * @@ -952,17 +1225,14 @@ export interface Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} parameters.sku The SKU of the Redis cache to deploy. * @@ -977,7 +1247,18 @@ export interface Redis { * 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 {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/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 {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * + * @param {string} parameters.location The geo-location where the resource + * lives * * @param {object} [parameters.tags] Resource tags. * @@ -1331,13 +1612,402 @@ export interface Redis { /** * @class - * PatchSchedules + * FirewallRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the RedisManagementClient. + */ +export interface FirewallRules { + + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByRedisResourceWithHttpOperationResponse(resourceGroupName: string, cacheName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all firewall rules in the specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName 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} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RedisFirewallRuleListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RedisFirewallRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RedisFirewallRuleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByRedisResource(resourceGroupName: string, cacheName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByRedisResource(resourceGroupName: string, cacheName: string, callback: ServiceCallback): void; + listByRedisResource(resourceGroupName: string, cacheName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create or update a redis cache firewall rule + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} parameters Parameters supplied to the create or update redis + * firewall rule operation. + * + * @param {string} parameters.startIP lowest IP address included in the range + * + * @param {string} parameters.endIP highest IP address included in the range + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, cacheName: string, ruleName: string, parameters: models.RedisFirewallRuleCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update a redis cache firewall rule + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} parameters Parameters supplied to the create or update redis + * firewall rule operation. + * + * @param {string} parameters.startIP lowest IP address included in the range + * + * @param {string} parameters.endIP highest IP address included in the range + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RedisFirewallRule} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RedisFirewallRule} [result] - The deserialized result object if an error did not occur. + * See {@link RedisFirewallRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, cacheName: string, ruleName: string, parameters: models.RedisFirewallRuleCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, cacheName: string, ruleName: string, parameters: models.RedisFirewallRuleCreateParameters, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, cacheName: string, ruleName: string, parameters: models.RedisFirewallRuleCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, cacheName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a single firewall rule in a specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RedisFirewallRule} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RedisFirewallRule} [result] - The deserialized result object if an error did not occur. + * See {@link RedisFirewallRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, cacheName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, cacheName: string, ruleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, cacheName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, cacheName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a single firewall rule in a specified redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {string} ruleName The name of the firewall rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, cacheName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, cacheName: string, ruleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, cacheName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all firewall rules in the specified redis cache. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByRedisResourceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all firewall rules in the specified redis cache. + * + * @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} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RedisFirewallRuleListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RedisFirewallRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RedisFirewallRuleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByRedisResourceNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByRedisResourceNext(nextPageLink: string, callback: ServiceCallback): void; + listByRedisResourceNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * PatchSchedules * __NOTE__: An instance of this class is automatically created for an * instance of the RedisManagementClient. */ export interface PatchSchedules { + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByRedisResourceWithHttpOperationResponse(resourceGroupName: string, cacheName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName 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} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RedisPatchScheduleListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RedisPatchScheduleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RedisPatchScheduleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByRedisResource(resourceGroupName: string, cacheName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByRedisResource(resourceGroupName: string, cacheName: string, callback: ServiceCallback): void; + listByRedisResource(resourceGroupName: string, cacheName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Create or replace the patching schedule for Redis cache (requires Premium * SKU). @@ -1518,15 +2188,73 @@ export interface PatchSchedules { get(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; get(resourceGroupName: string, name: string, callback: ServiceCallback): void; get(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByRedisResourceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @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} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RedisPatchScheduleListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RedisPatchScheduleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RedisPatchScheduleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByRedisResourceNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByRedisResourceNext(nextPageLink: string, callback: ServiceCallback): void; + listByRedisResourceNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * RedisLinkedServerOperations + * LinkedServer * __NOTE__: An instance of this class is automatically created for an * instance of the RedisManagementClient. */ -export interface RedisLinkedServerOperations { +export interface LinkedServer { /** @@ -1899,4 +2627,64 @@ export interface RedisLinkedServerOperations { beginCreate(resourceGroupName: string, name: string, linkedServerName: string, parameters: models.RedisLinkedServerCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; beginCreate(resourceGroupName: string, name: string, linkedServerName: string, parameters: models.RedisLinkedServerCreateParameters, callback: ServiceCallback): void; beginCreate(resourceGroupName: string, name: string, linkedServerName: string, parameters: models.RedisLinkedServerCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the list of linked servers associated with this redis cache (requires + * Premium SKU). + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the list of linked servers associated with this redis cache (requires + * Premium SKU). + * + * @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} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RedisLinkedServerWithPropertiesList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RedisLinkedServerWithPropertiesList} [result] - The deserialized result object if an error did not occur. + * See {@link RedisLinkedServerWithPropertiesList} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/rediscachemanagement/lib/operations/index.js b/lib/services/rediscachemanagement/lib/operations/index.js index 1c0d1290c5..b44cbd07fa 100644 --- a/lib/services/rediscachemanagement/lib/operations/index.js +++ b/lib/services/rediscachemanagement/lib/operations/index.js @@ -14,6 +14,8 @@ 'use strict'; +exports.Operations = require('./operations'); exports.Redis = require('./redis'); +exports.FirewallRules = require('./firewallRules'); exports.PatchSchedules = require('./patchSchedules'); -exports.RedisLinkedServerOperations = require('./redisLinkedServerOperations'); +exports.LinkedServer = require('./linkedServer'); diff --git a/lib/services/rediscachemanagement/lib/operations/redisLinkedServerOperations.js b/lib/services/rediscachemanagement/lib/operations/linkedServer.js similarity index 85% rename from lib/services/rediscachemanagement/lib/operations/redisLinkedServerOperations.js rename to lib/services/rediscachemanagement/lib/operations/linkedServer.js index 7e5023a310..edad9f38f0 100644 --- a/lib/services/rediscachemanagement/lib/operations/redisLinkedServerOperations.js +++ b/lib/services/rediscachemanagement/lib/operations/linkedServer.js @@ -741,10 +741,139 @@ function _beginCreate(resourceGroupName, name, linkedServerName, parameters, opt }); } -/** Class representing a RedisLinkedServerOperations. */ -class RedisLinkedServerOperations { +/** + * Gets the list of linked servers associated with this redis cache (requires + * Premium SKU). + * + * @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 - The 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 if an error did not occur. + * See {@link RedisLinkedServerWithPropertiesList} 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. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink 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 + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RedisLinkedServerWithPropertiesList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a LinkedServer. */ +class LinkedServer { /** - * Create a RedisLinkedServerOperations. + * Create a LinkedServer. * @param {RedisManagementClient} client Reference to the service client. */ constructor(client) { @@ -754,6 +883,7 @@ class RedisLinkedServerOperations { this._get = _get; this._list = _list; this._beginCreate = _beginCreate; + this._listNext = _listNext; } /** @@ -1263,6 +1393,93 @@ class RedisLinkedServerOperations { } } + /** + * Gets the list of linked servers associated with this redis cache (requires + * Premium SKU). + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the list of linked servers associated with this redis cache (requires + * Premium SKU). + * + * @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} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RedisLinkedServerWithPropertiesList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RedisLinkedServerWithPropertiesList} 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. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + } -module.exports = RedisLinkedServerOperations; +module.exports = LinkedServer; diff --git a/lib/services/rediscachemanagement/lib/operations/operations.js b/lib/services/rediscachemanagement/lib/operations/operations.js new file mode 100644 index 0000000000..8e9e36171b --- /dev/null +++ b/lib/services/rediscachemanagement/lib/operations/operations.js @@ -0,0 +1,455 @@ +/* + * 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'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Lists all of the available REST API operations of the Microsoft.Cache + * provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The 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 if an error did not occur. + * See {@link OperationListResult} 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. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + 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.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 + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Cache/operations'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the available REST API operations of the Microsoft.Cache + * provider. + * + * @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 - The 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 if an error did not occur. + * See {@link OperationListResult} 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. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink 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 + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Operations. */ +class Operations { + /** + * Create a Operations. + * @param {RedisManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache + * provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache + * provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} 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. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache + * provider. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the available REST API operations of the Microsoft.Cache + * provider. + * + * @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} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} 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. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Operations; diff --git a/lib/services/rediscachemanagement/lib/operations/patchSchedules.js b/lib/services/rediscachemanagement/lib/operations/patchSchedules.js index e53448c873..c1a021f448 100644 --- a/lib/services/rediscachemanagement/lib/operations/patchSchedules.js +++ b/lib/services/rediscachemanagement/lib/operations/patchSchedules.js @@ -14,6 +14,152 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; +/** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName 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 - The 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 if an error did not occur. + * See {@link RedisPatchScheduleListResult} 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. + */ +function _listByRedisResource(resourceGroupName, cacheName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + 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 (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 (cacheName === null || cacheName === undefined || typeof cacheName.valueOf() !== 'string') { + throw new Error('cacheName 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 + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/patchSchedules'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{cacheName}', encodeURIComponent(cacheName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RedisPatchScheduleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * Create or replace the patching schedule for Redis cache (requires Premium * SKU). @@ -52,6 +198,7 @@ function _createOrUpdate(resourceGroupName, name, scheduleEntries, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let defaultParameter = 'default'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -74,8 +221,7 @@ function _createOrUpdate(resourceGroupName, name, scheduleEntries, options, call } let parameters = new client.models['RedisPatchSchedule'](); try { - if (scheduleEntries !== null && scheduleEntries !== undefined) - { + if (scheduleEntries !== null && scheduleEntries !== undefined) { parameters.scheduleEntries = scheduleEntries; } } catch (error) { @@ -84,9 +230,10 @@ function _createOrUpdate(resourceGroupName, name, scheduleEntries, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'; + let 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('{default}', encodeURIComponent(defaultParameter)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -236,6 +383,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let defaultParameter = 'default'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -259,9 +407,10 @@ function _deleteMethod(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'; + let 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('{default}', encodeURIComponent(defaultParameter)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -364,6 +513,7 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let defaultParameter = 'default'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -387,9 +537,10 @@ function _get(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'; + let 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('{default}', encodeURIComponent(defaultParameter)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -474,6 +625,134 @@ function _get(resourceGroupName, name, options, callback) { }); } +/** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @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 - The 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 if an error did not occur. + * See {@link RedisPatchScheduleListResult} 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. + */ +function _listByRedisResourceNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink 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 + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RedisPatchScheduleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** Class representing a PatchSchedules. */ class PatchSchedules { /** @@ -482,9 +761,98 @@ class PatchSchedules { */ constructor(client) { this.client = client; + this._listByRedisResource = _listByRedisResource; this._createOrUpdate = _createOrUpdate; this._deleteMethod = _deleteMethod; this._get = _get; + this._listByRedisResourceNext = _listByRedisResourceNext; + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName The name of the Redis cache. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByRedisResourceWithHttpOperationResponse(resourceGroupName, cacheName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByRedisResource(resourceGroupName, cacheName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} cacheName 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} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RedisPatchScheduleListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RedisPatchScheduleListResult} 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. + */ + listByRedisResource(resourceGroupName, cacheName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByRedisResource(resourceGroupName, cacheName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByRedisResource(resourceGroupName, cacheName, options, optionalCallback); + } } /** @@ -750,6 +1118,91 @@ class PatchSchedules { } } + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByRedisResourceNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByRedisResourceNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all patch schedules in the specified redis cache (there is only one). + * + * @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} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RedisPatchScheduleListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RedisPatchScheduleListResult} 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. + */ + listByRedisResourceNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByRedisResourceNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByRedisResourceNext(nextPageLink, options, optionalCallback); + } + } + } module.exports = PatchSchedules; diff --git a/lib/services/rediscachemanagement/lib/operations/redis.js b/lib/services/rediscachemanagement/lib/operations/redis.js index 8ad636c376..5e31d0e71f 100644 --- a/lib/services/rediscachemanagement/lib/operations/redis.js +++ b/lib/services/rediscachemanagement/lib/operations/redis.js @@ -14,6 +14,300 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; +/** + * Checks that the redis cache name is valid and is not already in use. + * + * @param {object} parameters Parameters supplied to the CheckNameAvailability + * Redis operation. The only supported resource type is 'Microsoft.Cache/redis' + * + * @param {string} parameters.name Resource name. + * + * @param {string} parameters.type Resource type. The only legal value of this + * property for checking redis cache name availability is + * 'Microsoft.Cache/redis'. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The 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 if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _checkNameAvailability(parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + 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); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Cache/CheckNameAvailability'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CheckNameAvailabilityParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets any upgrade notifications for a Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {number} history how many minutes in past to look for upgrade + * notifications + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The 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 if an error did not occur. + * See {@link NotificationListResponse} 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. + */ +function _listUpgradeNotifications(resourceGroupName, name, history, options, callback) { + /* jshint validthis: true */ + let 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 (history === null || history === undefined || typeof history !== 'number') { + throw new Error('history cannot be null or undefined and it must be of type number.'); + } + 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 + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/listUpgradeNotifications'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('history=' + encodeURIComponent(history.toString())); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + 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(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NotificationListResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * Create or replace (overwrite/recreate, with potential downtime) an existing @@ -34,17 +328,14 @@ const WebResource = msRest.WebResource; * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} parameters.sku The SKU of the Redis cache to deploy. * @@ -59,7 +350,18 @@ const WebResource = msRest.WebResource; * 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 {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/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 {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * + * @param {string} parameters.location The geo-location where the resource + * lives * * @param {object} [parameters.tags] Resource tags. * @@ -151,17 +453,14 @@ function _create(resourceGroupName, name, parameters, options, callback) { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} [parameters.sku] The SKU of the Redis cache to deploy. * @@ -594,7 +893,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/'; + let 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)); let queryParameters = []; @@ -728,7 +1027,7 @@ function _list(options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis/'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Cache/Redis'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -1467,17 +1766,14 @@ function _exportData(resourceGroupName, name, parameters, options, callback) { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} parameters.sku The SKU of the Redis cache to deploy. * @@ -1492,7 +1788,18 @@ function _exportData(resourceGroupName, name, parameters, options, callback) { * 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 {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/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 {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * + * @param {string} parameters.location The geo-location where the resource + * lives * * @param {object} [parameters.tags] Resource tags. * @@ -1601,7 +1908,7 @@ function _beginCreate(resourceGroupName, name, parameters, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1630,7 +1937,7 @@ function _beginCreate(resourceGroupName, name, parameters, options, callback) { let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1647,7 +1954,7 @@ function _beginCreate(resourceGroupName, name, parameters, options, callback) { } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1762,7 +2069,7 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1912,7 +2219,7 @@ function _beginImportData(resourceGroupName, name, parameters, options, callback return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2064,7 +2371,7 @@ function _beginExportData(resourceGroupName, name, parameters, options, callback return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2359,6 +2666,8 @@ class Redis { */ constructor(client) { this.client = client; + this._checkNameAvailability = _checkNameAvailability; + this._listUpgradeNotifications = _listUpgradeNotifications; this._create = _create; this._update = _update; this._deleteMethod = _deleteMethod; @@ -2378,6 +2687,194 @@ class Redis { this._listNext = _listNext; } + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param {object} parameters Parameters supplied to the CheckNameAvailability + * Redis operation. The only supported resource type is 'Microsoft.Cache/redis' + * + * @param {string} parameters.name Resource name. + * + * @param {string} parameters.type Resource type. The only legal value of this + * property for checking redis cache name availability is + * 'Microsoft.Cache/redis'. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + checkNameAvailabilityWithHttpOperationResponse(parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkNameAvailability(parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Checks that the redis cache name is valid and is not already in use. + * + * @param {object} parameters Parameters supplied to the CheckNameAvailability + * Redis operation. The only supported resource type is 'Microsoft.Cache/redis' + * + * @param {string} parameters.name Resource name. + * + * @param {string} parameters.type Resource type. The only legal value of this + * property for checking redis cache name availability is + * 'Microsoft.Cache/redis'. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + checkNameAvailability(parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._checkNameAvailability(parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkNameAvailability(parameters, options, optionalCallback); + } + } + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {number} history how many minutes in past to look for upgrade + * notifications + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listUpgradeNotificationsWithHttpOperationResponse(resourceGroupName, name, history, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listUpgradeNotifications(resourceGroupName, name, history, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets any upgrade notifications for a Redis cache. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name The name of the Redis cache. + * + * @param {number} history how many minutes in past to look for upgrade + * notifications + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NotificationListResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NotificationListResponse} 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. + */ + listUpgradeNotifications(resourceGroupName, name, history, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listUpgradeNotifications(resourceGroupName, name, history, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listUpgradeNotifications(resourceGroupName, name, history, options, optionalCallback); + } + } + /** * Create or replace (overwrite/recreate, with potential downtime) an existing * Redis cache. @@ -2397,17 +2894,14 @@ class Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} parameters.sku The SKU of the Redis cache to deploy. * @@ -2422,7 +2916,18 @@ class Redis { * 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 {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/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 {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * + * @param {string} parameters.location The geo-location where the resource + * lives * * @param {object} [parameters.tags] Resource tags. * @@ -2470,17 +2975,14 @@ class Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} parameters.sku The SKU of the Redis cache to deploy. * @@ -2495,7 +2997,18 @@ class Redis { * 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 {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/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 {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * + * @param {string} parameters.location The geo-location where the resource + * lives * * @param {object} [parameters.tags] Resource tags. * @@ -2564,17 +3077,14 @@ class Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} [parameters.sku] The SKU of the Redis cache to deploy. * @@ -2634,17 +3144,14 @@ class Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} [parameters.sku] The SKU of the Redis cache to deploy. * @@ -3545,17 +4052,14 @@ class Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} parameters.sku The SKU of the Redis cache to deploy. * @@ -3570,7 +4074,18 @@ class Redis { * 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 {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/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 {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * + * @param {string} parameters.location The geo-location where the resource + * lives * * @param {object} [parameters.tags] Resource tags. * @@ -3618,17 +4133,14 @@ class Redis { * @param {boolean} [parameters.enableNonSslPort] Specifies whether the non-ssl * Redis server port (6379) is enabled. * - * @param {object} [parameters.tenantSettings] tenantSettings + * @param {object} [parameters.tenantSettings] A dictionary of tenant settings * * @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 {string} [parameters.minimumTlsVersion] Optional: requires clients to + * use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', + * '1.2'). Possible values include: '1.0', '1.1', '1.2' * * @param {object} parameters.sku The SKU of the Redis cache to deploy. * @@ -3643,7 +4155,18 @@ class Redis { * 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 {string} [parameters.subnetId] The full resource ID of a subnet in a + * virtual network to deploy the Redis cache in. Example format: + * /subscriptions/{subscriptionId}/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 {array} [parameters.zones] A list of availability zones denoting + * where the resource needs to come from. + * + * @param {string} parameters.location The geo-location where the resource + * lives * * @param {object} [parameters.tags] Resource tags. * diff --git a/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts b/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts index 3fb4d60876..bdddb83ca6 100644 --- a/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts +++ b/lib/services/rediscachemanagement/lib/redisManagementClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class RedisManagementClient extends AzureServiceClient { +export default class RedisManagementClient extends AzureServiceClient { /** * Initializes a new instance of the RedisManagementClient class. * @constructor @@ -33,11 +34,11 @@ declare class RedisManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -55,9 +56,11 @@ declare class RedisManagementClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + operations: operations.Operations; redis: operations.Redis; + firewallRules: operations.FirewallRules; patchSchedules: operations.PatchSchedules; - redisLinkedServerOperations: operations.RedisLinkedServerOperations; + linkedServer: operations.LinkedServer; } -export = RedisManagementClient; +export { RedisManagementClient, models as RedisManagementModels }; diff --git a/lib/services/rediscachemanagement/lib/redisManagementClient.js b/lib/services/rediscachemanagement/lib/redisManagementClient.js index 33aaacce36..a6d2457abe 100644 --- a/lib/services/rediscachemanagement/lib/redisManagementClient.js +++ b/lib/services/rediscachemanagement/lib/redisManagementClient.js @@ -34,9 +34,9 @@ class RedisManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -50,7 +50,7 @@ class RedisManagementClient extends ServiceClient { super(credentials, options); - this.apiVersion = '2017-02-01'; + this.apiVersion = '2018-03-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -72,9 +72,11 @@ class RedisManagementClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.operations = new operations.Operations(this); this.redis = new operations.Redis(this); + this.firewallRules = new operations.FirewallRules(this); this.patchSchedules = new operations.PatchSchedules(this); - this.redisLinkedServerOperations = new operations.RedisLinkedServerOperations(this); + this.linkedServer = new operations.LinkedServer(this); this.models = models; msRest.addSerializationMixin(this); } @@ -82,3 +84,6 @@ class RedisManagementClient extends ServiceClient { } module.exports = RedisManagementClient; +module.exports['default'] = RedisManagementClient; +module.exports.RedisManagementClient = RedisManagementClient; +module.exports.RedisManagementModels = models; diff --git a/lib/services/rediscachemanagement/package.json b/lib/services/rediscachemanagement/package.json index edf695b9ac..98e58dcee4 100644 --- a/lib/services/rediscachemanagement/package.json +++ b/lib/services/rediscachemanagement/package.json @@ -1,37 +1,25 @@ { "name": "azure-arm-rediscache", "author": "Microsoft Corporation", - "contributors": [ - "Thaniyulla Parambath, Alfan ", - "Dacosta, Carlyle ", - "Zavery, Amar " - ], - "version": "2.1.0-preview", - "description": "Microsoft Azure Redis Cache Client Library for node", - "tags": [ - "azure", - "sdk" - ], + "description": "RedisManagementClient Library with typescript type definitions for node", + "version": "3.0.0", + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, "keywords": [ "node", "azure" ], + "license": "MIT", "main": "./lib/redisManagementClient.js", "types": "./lib/redisManagementClient.d.ts", - "license": "MIT", - "dependencies": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" - }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/rediscachemanagement", "repository": { "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" + "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}